generated from pwa-builder/pwa-starter
-
Notifications
You must be signed in to change notification settings - Fork 0
/
rollup.config.js
41 lines (40 loc) · 1.07 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
import resolve from "@rollup/plugin-node-resolve";
import { terser } from "rollup-plugin-terser";
import html from "@open-wc/rollup-plugin-html";
import replace from "@rollup/plugin-replace";
import strip from "@rollup/plugin-strip";
import copy from "rollup-plugin-copy";
import typescript from "@rollup/plugin-typescript";
export default {
input: "index.html",
output: {
dir: "dist",
format: "es",
},
plugins: [
resolve({
exportConditions: ['production']
}),
replace({
"preventAssignment": true,
"window.ENV": JSON.stringify(process.env.NODE_ENV || "production"),
"process.env.NODE_ENV": JSON.stringify(process.env.NODE_ENV || "production")
}),
html(),
typescript({
tsconfig: "tsconfig.json"
}),
terser(),
strip({
functions: ["console.log"],
}),
copy({
targets: [
{ src: "assets/**/*", dest: "dist/assets/" },
{ src: "styles/global.css", dest: "dist/styles/" },
{ src: "manifest.json", dest: "dist/" },
],
})
],
preserveEntrySignatures: 'strict',
};