0.0.7 • Published 7 years ago
pterosaur v0.0.7
Pterosaur
Base structure in Webpack 4 & Babel 6 & Sass for the creation of npm modules in React
Installation
1. Clone
git clone git@github.com:OceanwingERP/pterosaur.git
cd pterosaur
npm install2. Create Link
npm run build
npm linkDevelopment
Start
Watch changes in mode development
npm startBuild
Compile in mode production
npm run BuildStructure
Test the component in a project
cd Existing-React-Project
npm link your-react-component-nameAt this point you can already use your component, usage:
import React, { Component } from 'react';
import { Example } from 'your-react-component-name'
class HelloWorld extends Component {
render() {
return (
<Example />
);
}
}
export default HelloWorld;Production
Publish in NPM
1. Compile to production
npm run build2. Login
npm login
# login with your credentials in https://www.npmjs.com/3. Upload package
Note: package.json 内的 package-name 不能与他人重复 Note: 每次发布 version 不能与之前的版本相同
npm publish
# Available in https://www.npmjs.com/package/your-react-component-nameNow, you can install your package with:
npm install your-react-component-name--save
# :)Delete this package publish
npx force-unpublish package-name 'the reason'License
MIT © Anker-in