Skip to content

Commit 0a91705

Browse files
committed
Migrate to vue rollup for building
1 parent da47e83 commit 0a91705

28 files changed

+3381
-23002
lines changed

.browserslistrc

Lines changed: 0 additions & 3 deletions
This file was deleted.

.editorconfig

Lines changed: 0 additions & 7 deletions
This file was deleted.

babel.config.js

Lines changed: 0 additions & 5 deletions
This file was deleted.

build/rollup.config.js

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
// rollup.config.js
2+
import vue from 'rollup-plugin-vue';
3+
import buble from 'rollup-plugin-buble';
4+
import commonjs from 'rollup-plugin-commonjs';
5+
import replace from 'rollup-plugin-replace';
6+
import { terser } from 'rollup-plugin-terser';
7+
import minimist from 'minimist';
8+
9+
const argv = minimist(process.argv.slice(2));
10+
11+
const config = {
12+
input: 'src/entry.js',
13+
output: {
14+
name: 'VueFunnelGraph',
15+
exports: 'named',
16+
globals: {
17+
'polymorph-js': 'interpolate',
18+
'@tweenjs/tween.js': 'TWEEN',
19+
'funnel-graph-js': 'FunnelGraph',
20+
'funnel-graph-js/src/js/number': 'formatNumber',
21+
'funnel-graph-js/src/js/graph': 'getDefaultColors'
22+
}
23+
},
24+
external: [
25+
'@tweenjs/tween.js',
26+
'polymorph-js',
27+
'funnel-graph-js',
28+
'funnel-graph-js/src/js/number',
29+
'funnel-graph-js/src/js/graph',
30+
'funnel-graph-js/src/scss/main.scss',
31+
'funnel-graph-js/src/scss/theme.scss'
32+
],
33+
plugins: [
34+
replace({
35+
'process.env.NODE_ENV': JSON.stringify('production'),
36+
}),
37+
commonjs(),
38+
vue({
39+
css: true,
40+
compileTemplate: true,
41+
template: {
42+
isProduction: true,
43+
},
44+
}),
45+
buble(),
46+
],
47+
};
48+
49+
// Only minify browser (iife) version
50+
if (argv.format === 'iife') {
51+
config.plugins.push(terser());
52+
}
53+
54+
export default config;

0 commit comments

Comments
 (0)