Last active
November 26, 2018 01:18
-
-
Save znck/140d5e9deabfa41f2e935d053a59f23e to your computer and use it in GitHub Desktop.
Example for `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
Create a module for vue component. |
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> | |
<div class="hello"> | |
<h1 class="hello__title">{{ msg }}</h1> | |
</div> | |
</template> | |
<script> | |
export default { | |
data () { | |
return { | |
msg: 'Hello World!' | |
} | |
} | |
} | |
</script> | |
<style lang="stylus"> | |
.hello { | |
&__title { | |
color: #42b983; | |
} | |
} | |
</style> |
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 Hello from './Hello.vue' | |
export default Hello |
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": "test-rollup-plugin-vue", | |
"version": "1.0.0", | |
"devDependencies": { | |
"rollup-plugin-buble": "^0.14.0", | |
"rollup-plugin-commonjs": "^5.0.4", | |
"rollup-plugin-node-resolve": "^2.0.0", | |
"rollup-plugin-vue": "^2.2.3" | |
} | |
} |
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 'rollup-plugin-vue'; | |
import babel from 'rollup-plugin-buble'; | |
import resolve from 'rollup-plugin-node-resolve'; | |
import commonjs from 'rollup-plugin-commonjs'; | |
export default { | |
moduleName: 'hello', | |
entry: 'index.js', | |
dest: 'dist/bundle.js', | |
format: 'iife', | |
plugins: [ | |
resolve({ | |
jsnext: true, | |
main: true, | |
browser: true, | |
}), | |
commonjs(), | |
vue({compileTemplate: true}), | |
babel(), | |
], | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Dumping terminal history