A project boilerplate for writing a js library using the Rollup packaging tool.
- /build —— The build config file path.
- /build/rollup.config.js —— The rollup config file.
- /dist —— Dev and prod environment library path.
- /doc —— Project documentation directory, using gitbook to write documentation.
- /example —— The example path.
- /src —— The source code path.
- .editorconfig —— Code style format configuration file.
- .eslintignore —— Eslint check tool ignores files.
- .eslintrc.js —— Eslint check tool configuration file.
- .gitignore —— The gitignore file.
- .travis.yml —— Travis continues to integrate tool configuration files.
- LICENSE —— The LISENSE file.
- package-lock.json —— The NPM lock file.
- package.json —— The NPM config file.
- README.zh-CN.md —— The project README(zh-CN) file.
- README.md —— The project README(EN) file.
Project documentation, built using travis and deployed to github pages. rollup-lib-starter document
-
Install dependency packages.
npm install
-
Listen source code.
npm run dev
-
Build source code.
npm run build
It is recommended to publish to the NPM or CDN to use the library.
- Publish to the NPM.
- Register a NPM account.
- Login NPM account on terminal.
- Modify package.js's version and watch and build source code before publish.
- Run "npm puiblish".
- Use library.
- NPM:Run "npm install LIBNAME --save" to install library. Use CommonJS standard to write code.
- script:Use unpkg CDN after publish NPM. e.g. "https://unpkg.com/LIBNAME/dist/LIBNAME.min.js"
- Es6 is recommended for developing library.
- The configuration files are mainly rollup.config.js and package.json. Contains configuration such as class library name, version, and package directory.
- Unlike usual development, note that the dist directory needs to be submitted to the repository.
- The travis continuous integration tool needs to be configured on the travis official website for automatic build deployment.
- The project follows the standard specification and can be modified by itself.
- Submit using the commitizen specification git. Use npm run commit instead of git commit.
- If you don't like gitbook, maybe you can try vuepress.