https://github.com/verywow/vue-simple-rollup-lib-starter
A simple vue lib starter with rollup
https://github.com/verywow/vue-simple-rollup-lib-starter
Last synced: 8 months ago
JSON representation
A simple vue lib starter with rollup
- Host: GitHub
- URL: https://github.com/verywow/vue-simple-rollup-lib-starter
- Owner: VeryWow
- License: mit
- Created: 2018-04-10T14:08:26.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2018-04-10T15:59:11.000Z (about 8 years ago)
- Last Synced: 2025-10-13T00:14:01.868Z (8 months ago)
- Language: JavaScript
- Size: 18.6 KB
- Stars: 2
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# vue-simple-rollup-lib-starter
A simple vue lib starter with rollup
## Usage
Just download as ZIP or clone, delete `.git` folder and edit `package.json` to suit your project.
## NPM scripts
```bash
# Runs example & docs with hot-reload
npm run dev
# Builds a lib for different ES versions and browsers
npm run build
# Builds docs for gitpages
npm run docs
# Build docs and lib, increment version, commit everything, publish to npm and push to git
npm run patch # increment patch version
npm run minor # increment minor version
npm run major # increment major version
```
## Project directory outline
```bash
./ # Root
├── build/
│ ├── bundles.js # A bundle config, defines polyfills and etc.
│ ├── rollup.config.js # Rollup config.
│ └── index.js
├── example/
│ ├── src/
│ ├── webpack.config.js # Webpack config for the example.
│ └── .babelrc # Babel config for the example.
├── lib/
│ ├── YourComponent.vue
│ └── index.js
└── config.js
```
## Configuration
### `./config.js`
```js
module.exports = {
// Lib main entry
entry: 'lib/index.js',
// Lib entry with auto-install to window.Vue
entryWithAutoDefine: 'lib/index.auto.js',
// Lib compiled output
output: 'dist',
// Lib name
name: ''
}
```
### `./build/bundles.js`
A bundle config, defines polyfills and etc.
```js
module.exports = exports = {
// Key - rollup build format
['cjs' || 'es6' || 'es7' || 'umd' || 'iife']: {
// Whether to minify the output
compress: true/false,
// Whether to auto-install the lib in this build
autoDefine: true/false,
// Define polyfills for the build
polyfills: {
// Polyfill arrow functions
arrows: true/false,
// Polyfill Object.assign and friends
assign: true/false,
// Polyfill async/await with promises
async: true/false,
// Polyfill promises & fetch
promise: true/false
},
}
}
```