-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(rollup): Use rollup to generate UMD and ESM build
- Loading branch information
Showing
8 changed files
with
15,299 additions
and
7,380 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
import resolve from '@rollup/plugin-node-resolve'; | ||
import buble from '@rollup/plugin-buble'; | ||
import commonjs from '@rollup/plugin-commonjs'; | ||
import filesize from 'rollup-plugin-filesize'; | ||
import { terser } from 'rollup-plugin-terser'; | ||
import VuePlugin from 'rollup-plugin-vue'; | ||
import pkg from './package.json'; | ||
|
||
export default [ | ||
// browser-friendly UMD build | ||
{ | ||
input: './src/install.js', | ||
output: { | ||
name: 'VueImageWall', | ||
file: pkg.main, | ||
format: 'umd', | ||
}, | ||
plugins: [ | ||
resolve(), | ||
commonjs(), | ||
VuePlugin(), | ||
buble(), | ||
terser(), | ||
filesize(), | ||
], | ||
}, | ||
|
||
// ESM build | ||
{ | ||
input: './src/install.js', | ||
external: ['vue', 'lodash'], | ||
output: [ | ||
{ file: pkg.module, format: 'es' }, | ||
], | ||
plugins: [ | ||
resolve(), | ||
commonjs(), | ||
VuePlugin(), | ||
terser(), | ||
filesize(), | ||
], | ||
}, | ||
]; |
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,17 @@ | ||
import VueImageWall from './components/ImageWallWrapper'; | ||
import VueImageWall from './components/ImageWallWrapper.vue'; | ||
|
||
export default VueImageWall; | ||
const componentName = 'vue-image-wall'; | ||
|
||
// For use as global component | ||
// To use: Vue.use(VueImageWall) | ||
VueImageWall.install = function (Vue) { | ||
Vue.component(componentName, VueImageWall); | ||
}; | ||
|
||
// For browser tag | ||
// For browser tag <script> usage | ||
// No need to register (its done here) | ||
if (typeof window !== 'undefined' && window.Vue) { | ||
window.Vue.component('VueImageWall', VueImageWall); | ||
window.Vue.component(componentName, VueImageWall); | ||
} | ||
|
||
export default VueImageWall; |
Oops, something went wrong.