-
Notifications
You must be signed in to change notification settings - Fork 16
/
rollup.config.js
45 lines (43 loc) · 1.02 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
import { terser } from "rollup-plugin-terser"
import resolve from "@rollup/plugin-node-resolve"
import commonjs from "@rollup/plugin-commonjs"
import babel from "@rollup/plugin-babel"
const inputFile = "app/javascript/hotwire/spark/index.js"
const outputDir = "app/assets/javascripts"
export default {
input: inputFile,
output: [
{
file: `${outputDir}/hotwire_spark.js`,
name: "HotwireSpark",
format: "iife",
inlineDynamicImports: true
},
{
file: `${outputDir}/hotwire_spark.min.js`,
format: "iife",
name: "HotwireSpark",
sourcemap: true,
inlineDynamicImports: true,
plugins: [ terser() ]
},
],
plugins: [
resolve(),
commonjs(),
babel({
babelHelpers: "bundled",
presets: [
[
"@babel/preset-env",
{
targets: "> 0.25%, not dead",
exclude: [ "transform-template-literals" ],
modules: false,
},
],
],
exclude: "node_modules/**",
}),
]
}