Skip to content

Instantly share code, notes, and snippets.

@znck
Last active February 16, 2022 07:55
Show Gist options
  • Star 11 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save znck/4ae3a705bccba0a3feecfa7b5f3da1ea to your computer and use it in GitHub Desktop.
Save znck/4ae3a705bccba0a3feecfa7b5f3da1ea to your computer and use it in GitHub Desktop.
Using rollup-plugin-vue
{
"parserOptions": {
"ecmaVersion": 6,
"sourceType": "module",
},
"env": {
"browser": true,
"es6": true
}
}
<template>
<h1>{{ message }}</h1>
</template>
<script>
export default {
data: {
message: 'Hello Vue!'
}
};
</script>
import Vue from 'vue';
import App from './App.vue';
new Vue({
el: '#app',
...App
});
{
"name": "rpv-issue-28",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"build": "rollup -c"
},
"keywords": [],
"author": "Rahul Kadyan <hi@znck.me>",
"license": "MIT",
"devDependencies": {
"rollup": "^0.36.1",
"rollup-plugin-buble": "^0.14.0",
"rollup-plugin-commonjs": "^5.0.4",
"rollup-plugin-eslint": "^3.0.0",
"rollup-plugin-node-globals": "^1.0.9",
"rollup-plugin-node-resolve": "^2.0.0",
"rollup-plugin-uglify": "^1.0.1",
"rollup-plugin-vue": "^2.2.3"
},
"dependencies": {
"vue": "^2.0.0-rc.8"
}
}
import buble from 'rollup-plugin-buble';
import eslint from 'rollup-plugin-eslint';
import resolve from 'rollup-plugin-node-resolve';
import commonjs from 'rollup-plugin-commonjs';
import uglify from 'rollup-plugin-uglify';
import vue from 'rollup-plugin-vue';
import nodeGlobals from 'rollup-plugin-node-globals';
export default {
entry: 'main.js',
dest: 'build/js/main.min.js',
format: 'iife',
sourceMap: true,
useStrict: false,
plugins: [
vue(),
buble({
objectAssign: 'Object.assign'
}),
resolve({
jsnext: true,
main: true,
browser: true
}),
commonjs(),
eslint({
exclude: [
'src/styles/**'
]
}),
nodeGlobals(),
(process.env.NODE_ENV === 'production' && uglify()),
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment