Skip to content

md-command-line/hello-world-react-npm-component

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Usage

Script for the example sourced from: https://github.com/MichaelDimmitt/ship-my-component-npm

## Important for the init command: 
  ## specify the entrypoint: build/index.js  
  ## specify test: webpack 
npm init &&
mkdir build &&
curl -L -o webpack.config.js https://raw.githubusercontent.com/MichaelDimmitt/ship-my-component-npm/master/webpack.config.js &&

npm install [email protected] [email protected] && 
npm install -D [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] &&
npm test &&
npm publish

## cleanup
rm -rf node_modules package.json package-lock.json webpack.config.js 
// normal class component implementation is version #7
npm install --save hello-world-npm-component@1.0.7
import HelloWorld from 'hello-world-npm-component';

// functional component implementation is version #6
npm install --save hello-world-npm-component@1.0.6
import { HelloWorld } from 'hello-world-npm-component';

see the code at these two branches:

git checkout react-class-component;
git checkout react-functional-component;

success reached through the following helpful document:
https://medium.com/@BrodaNoel/how-to-create-a-react-component-and-publish-it-in-npm-668ad7d363ce

About

adds webpack and some folder conventions to let you publish components to npm publically.

Resources

Stars

Watchers

Forks

Packages

No packages published