forked from hawksearch/vue-hawksearch
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrollup.config.js
70 lines (63 loc) · 1.52 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
62
63
64
65
66
67
68
69
70
import pkg from './package.json';
import resolve from '@rollup/plugin-node-resolve';
import babel from 'rollup-plugin-babel';
import vuePlugin from 'rollup-plugin-vue';
import scss from 'rollup-plugin-scss'
import autoprefixer from 'autoprefixer'
import postcss from 'rollup-plugin-postcss'
import { terser } from 'rollup-plugin-terser';
const extensions = ['.mjs', '.web.js', '.js', '.json', '.vue'];
// our peer dependencies are considered external, and must be provided by the consumer
const external = Object.keys(pkg.peerDependencies);
const config = {
input: 'src/index.js',
output: {
file: pkg.module,
format: 'esm',
compact: true
},
external,
plugins: [
resolve({
extensions,
browser: true,
preferBuiltIns: false,
customResolveOptions: {
moduleDirectory: ['src', 'node_modules'],
},
}),
babel({
extensions: ['.js'],
runtimeHelpers: true,
exclude: 'node_modules/**',
presets: [
[
"@babel/preset-env",
{
"targets": {
"edge": "17",
"firefox": "60",
"chrome": "67",
"safari": "11.1",
"ie": "11"
}
}
]
],
plugins: [
'@babel/plugin-proposal-class-properties',
'@babel/plugin-proposal-object-rest-spread',
'@babel/plugin-transform-arrow-functions',
'@babel/plugin-transform-destructuring',
'@babel/plugin-syntax-dynamic-import',
["@babel/plugin-proposal-decorators", { "decoratorsBeforeExport": true }]
]
}),
vuePlugin({
css: false
}),
scss(),
terser()
],
};
export default config;