-
Notifications
You must be signed in to change notification settings - Fork 44
/
rollup.examples.config.js
48 lines (42 loc) · 1.02 KB
/
rollup.examples.config.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
import { terser } from 'rollup-plugin-terser';
import resolve from 'rollup-plugin-node-resolve';
import commonjs from 'rollup-plugin-commonjs';
import json from 'rollup-plugin-json';
// The module name
const name = 'vuejs-datatable';
// Plugins used for build
const plugins = [
commonjs({
namedExports: {
// left-hand side can be an absolute path, a path
// relative to the current directory, or the name
// of a module in node_modules
'object-path': [ 'get', 'set' ],
'axios': [ 'get' ],
}
}),
json(),
resolve(),
terser(),
];
// Destination dir
const outDir = 'build';
// Should we generate source maps?
const sourcemap = true;
const generateDemoConfig = dir => ({
input: `${__dirname}/${dir}/app.js`,
output: {
file: `${__dirname}/${dir}/${outDir}/app.js`,
format: 'iife',
// Use `name` as window to hack a bit & avoid exports.
name: 'window',
sourcemap,
globals: { vue: 'Vue' },
},
plugins,
external: ['vue'],
})
export default [
generateDemoConfig('ajax'),
generateDemoConfig('custom-theme'),
]