-
Notifications
You must be signed in to change notification settings - Fork 0
/
rollup.config.js
55 lines (52 loc) · 1.48 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
import resolve from "@rollup/plugin-node-resolve";
import commonjs from "@rollup/plugin-commonjs";
import babel from "@rollup/plugin-babel";
import cleaner from "rollup-plugin-cleaner";
import filesize from "rollup-plugin-filesize";
import { terser } from "rollup-plugin-terser";
import minifyHTML from "rollup-plugin-minify-html-literals";
import cleanup from "rollup-plugin-cleanup";
import { name, version } from "./package.json";
// The main JavaScript bundle for modern browsers that support
// JavaScript modules and other ES2015+ features.
const config = {
input: {
servicio: "./src/js/servicio.js"
},
output: [{
banner: `/*! ${name} - release: ${version} */`,
dir: "dist/common/js/",
chunkFileNames: "[name]-[hash].js",
format: "es"
}],
plugins: [
cleaner({
targets: [
"./dist/common/js/"
]
}),
minifyHTML(),
resolve(),
commonjs(),
cleanup({
comments: "none"
}),
babel({
exclude: "node_modules/**", // only transpile our source code
babelHelpers: "bundled",
}),
filesize({
showMinifiedSize: true,
showGzippedSize: true
})
],
preserveEntrySignatures: false
};
// eslint-disable-next-line no-undef
if (process.env.NODE_ENV !== "development") {
config.plugins.push(terser({
module: true,
warnings: true
}));
}
export default config;