0.1.0 • Published 2 years ago

npmcounterpackage v0.1.0

Weekly downloads
-
License
-
Repository
-
Last release
2 years ago

npm_Counter_React_Component

Whether you're a seasoned developer or just getting started, this repository will walk you through all the necessary steps to share your React component with the world as an npm package.

  1. Crete a index.js file at a root directory

  2. Export your component in the index.js

  export { default as Test } from './dist/your_component_name';
  1. Update the package.json file
  "babel": {
    "presets": [
      "@babel/preset-react"
    ]
  },

Use the specific version of babel/cli

   "devDependencies": {
    "@babel/cli": "^7.22.9"
  }

for Windows

  "publish:npm": "rmdir /s /q dist && mkdir dist && babel src/components -d dist --copy-files",

for Mac/ Linux

  "publish:npm": "rm -rf dist && mkdir dist && babel src/components -d dist --copy-files",

After complete development

  npm run publish:npm

Make sure you are having a npm account

  npm login

Enter your all details while logging

  npm publish

Make sure your project name is unique, else update the name from package.json