Last active
February 16, 2022 07:55
-
-
Save znck/4ae3a705bccba0a3feecfa7b5f3da1ea to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Using rollup-plugin-vue |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"parserOptions": { | |
"ecmaVersion": 6, | |
"sourceType": "module", | |
}, | |
"env": { | |
"browser": true, | |
"es6": true | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<template> | |
<h1>{{ message }}</h1> | |
</template> | |
<script> | |
export default { | |
data: { | |
message: 'Hello Vue!' | |
} | |
}; | |
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Vue from 'vue'; | |
import App from './App.vue'; | |
new Vue({ | |
el: '#app', | |
...App | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"name": "rpv-issue-28", | |
"version": "1.0.0", | |
"description": "", | |
"main": "index.js", | |
"scripts": { | |
"build": "rollup -c" | |
}, | |
"keywords": [], | |
"author": "Rahul Kadyan <[email protected]>", | |
"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" | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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