-
Notifications
You must be signed in to change notification settings - Fork 0
/
rollup.config.mjs
54 lines (53 loc) · 1.75 KB
/
rollup.config.mjs
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
// Import rollup plugins
import { rollupPluginHTML as html } from "@web/rollup-plugin-html";
import copy from 'rollup-plugin-copy';
import resolve from '@rollup/plugin-node-resolve';
import {terser} from 'rollup-plugin-terser';
import { minifyTemplateLiterals } from "rollup-plugin-minify-template-literals";import summary from 'rollup-plugin-summary';
import del from 'rollup-plugin-delete'
import sourcemaps from 'rollup-plugin-sourcemaps';
export default {
plugins: [
sourcemaps(),
del({ targets: 'build/**/*'}),
// Entry point for application build; can specify a glob to build multiple
// HTML files for non-SPA app
html({
input: ['index.html', 'demo.html', 'mapbox.html','cgstromen.html'],
}),
// Resolve bare module specifiers to relative paths
resolve({
exportConditions: ['development']
}),
// Minify HTML template literals
minifyTemplateLiterals(),
// Minify JS
terser({
ecma: 2020,
module: true,
warnings: true,
}),
// Print bundle summary
summary(),
// Optional: copy any static assets to build directory
copy({
targets: [
{src: "images/**/*", dest: "build/images"},
{src: "maps/**/*", dest: "build/maps"},
{src: "styles/**/*", dest: "build/styles"},
{src: "notosans-*woff2", dest: "build"},
{src: "node_modules/hopscotch/dist/img/sprite-*.png", dest: "build/img"},
{src: "images/manifest/*", dest: "build/assets/images"},
{src: "course/**/*", dest: "build/course"},
{src: "src/workers/*", dest: "build/src"},
{src: "src/locales/**/*", dest: "build/src"}
],
flatten: false
}),
],
output: {
sourcemap: true,
dir: 'build',
},
preserveEntrySignatures: 'strict',
};