-
Notifications
You must be signed in to change notification settings - Fork 0
/
rollup.config.js
executable file
·61 lines (56 loc) · 1.66 KB
/
rollup.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
49
50
51
52
53
54
55
56
57
58
59
60
61
const path = require('path');
const alias = require('@rollup/plugin-alias');
const typescript = require('rollup-plugin-typescript');
const { nodeResolve } = require('@rollup/plugin-node-resolve');
const commonjs = require('@rollup/plugin-commonjs');
const { babel } = require('@rollup/plugin-babel');
const json = require('@rollup/plugin-json');
const { terser } = require('rollup-plugin-terser');
module.exports = function (config) {
// const extensions = ['.ts', '.js'];
config.forEach(v => {
// just keep the reference for third-party libs
v.external = ['plugin-error', 'through2', 'vue-template-compiler', '@vue/component-compiler', 'vinyl-sourcemaps-apply'];
v.plugins.push(
alias({
entries: [
{ find: '@utils', replacement: path.resolve(__dirname, 'src/utils') }
]
})
)
});
// umd
// config.push({
// input: 'src/index.ts',
// output: {
// file: 'umd/gulp-plugin-vue-sfc.min.js',
// format: 'umd',
// name: '$gulp-plugin-vue-sfc',
// exports: 'named',
// compact: true
// },
// plugins: [
// nodeResolve({
// extensions,
// preferBuiltins: true,
// browser: true
// }),
// commonjs(),
// typescript({
// target: 'es2015',
// module: 'ESNext',
// lib: ['es5', 'es6', 'es2015', 'es2016', 'dom'],
// declaration: false
// }),
// babel({
// exclude: 'node_modules/**',
// plugins: [['@babel/plugin-transform-runtime', { corejs: 3 }]],
// babelHelpers: 'runtime',
// extensions
// }),
// json(),
// terser()
// ]
// });
return config;
}