This repository has been archived by the owner on May 5, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrollup.serve.config.js
75 lines (65 loc) · 1.65 KB
/
rollup.serve.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
71
72
73
74
75
const resolve = require('rollup-plugin-node-resolve');
const commonjs = require('rollup-plugin-commonjs');
const glob = require('rollup-plugin-glob-import');
const babel = require('rollup-plugin-babel');
const serve = require('rollup-plugin-serve');
const copy = require('rollup-plugin-copy-assets-to');
module.exports = {
input: 'demo/salte-app.js',
external: [],
output: {
dir: 'dist',
format: 'es',
sourcemap: true,
exports: 'named'
},
plugins: [
resolve(),
commonjs(),
glob(),
babel({
exclude: /node_modules\/(?!(@webcomponents|lit-html|lit-element|chai-as-promised)\/).*/,
runtimeHelpers: true,
presets: [['@babel/preset-env', {
modules: false,
targets: {
browsers: [
'last 2 chrome versions',
'last 2 firefox versions',
'last 2 edge versions',
'IE >= 10',
'Safari >= 7'
]
}
}]],
plugins: [
'@babel/plugin-syntax-dynamic-import',
['@babel/plugin-transform-runtime', {
regenerator: true
}]
]
}),
serve({
host: '0.0.0.0',
port: 8080,
contentBase: 'dist',
historyApiFallback: true
}),
copy({
assets: [
'demo/index.html',
'node_modules/web-animations-js/web-animations-next-lite.min.js',
'node_modules/web-animations-js/web-animations-next-lite.min.js.map'
],
outputDir: 'dist'
})
],
watch: {
include: ['src/**', 'demo/**']
},
onwarn: function(warning) {
if (warning.code !== 'CIRCULAR_DEPENDENCY') {
console.error(`(!) ${warning.message}`);
}
}
}