✓ Ready to transpile ES6 with rollup-plugin-buble & rollup-plugin-babel
✓ Fastest bundle by precompiling templates with vue-template-compiler
✓ Let's see the example config
✗ No support for vue-hot-reload-api (help needed)
✗ No support for css compilation, but can trigger another build tool
npm install --save-dev rollup-plugin-vue2
Put vue()
before any transpiler like Bublé or Babel
// rollup.config.js
import vue from 'rollup-plugin-vue2';
import buble from 'rollup-plugin-buble';
import nodeResolve from 'rollup-plugin-node-resolve';
import commonjs from 'rollup-plugin-commonjs';
import uglify from 'rollup-plugin-uglify';
export default {
entry: 'src/main.js',
dest: 'dist/bundle.js',
plugins: [
vue(),
buble(),
nodeResolve({ browser: true, jsnext: true, main: true }),
commonjs(),
uglify()
]
}
Time to rollup!
# Build
# -c will default to rollup.config.js
rollup -c
# Development
# -w will watch for changes
rollup -c -w
There is only 1 option for now: css
.
By default the plugin will base the filename for the css on the bundle destination.
vue({
// Filename to write all styles to
css: 'bundle.scss',
// Callback that will be called ongenerate with two arguments:
// - styles: the contents of all style tags combined: 'body { color: green }'
// - styleNodes: an array of style objects: [{lang: 'css', content: 'body { color: green }'}]
css: function (styles, styleNodes) {
writeFileSync('bundle.scss', styles)
},
// Disable any style output or callbacks
css: false,
// Default behaviour is to write all styles to the bundle destination where .js is replaced by .css
css: null
})
Please see CHANGELOG for more information what has changed recently.
The linter will check for JS Standard Style
# Unittests
npm run unit
# Linting
npm run lint
# Run all the above
npm run test
Contributions and feedback are very welcome.
To get it running:
- Clone the project.
npm install
npm run build
- Thomas Ghysels - Support for <style>, Bublé & Vue 2.0
- Rahul Kadyan - Author of the original rollup-plugin-vue
- All Contributors
The MIT License (MIT). Please see License File for more information.