-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathrollup.config.js
43 lines (43 loc) · 1.12 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
import resolve from '@rollup/plugin-node-resolve';
import css from'rollup-plugin-css-only'
import html from 'rollup-plugin-html';
import copy from 'rollup-plugin-copy';
// import serve from 'rollup-plugin-serve';
// import livereload from 'rollup-plugin-livereload';
export default {
input: './src/index.js',
output: [
{
format: 'esm',
file: './dist/bundle.js',
inlineDynamicImports: true
},
],
plugins: [
resolve(),
css({ output: 'dist/bundle.css' }),
html({
include: '**/*.html',
htmlMinifierOptions: {
collapseWhitespace: true,
collapseBooleanAttributes: true,
conservativeCollapse: true,
minifyCSS: true,
minifyJS: true,
}
}),
copy({
targets: [
{src: 'src/icon.png', dest: 'dist'},
{ src: 'src/*.html', dest: 'dist' }, // Copy all HTML files from src to dist
{ src: './wasm', dest: 'dist' }, // Copy the entire 'wasm' folder
],
}),
// serve({
// open: true,
// contentBase: 'dist',
// port: 3000, // Choose the port you prefer
// }),
// livereload('dist'),
]
};