2021-07-28 15:17:13 -04:00
|
|
|
import resolve from "@rollup/plugin-node-resolve"
|
|
|
|
import commonjs from "@rollup/plugin-commonjs"
|
|
|
|
import { terser } from "rollup-plugin-terser"
|
2018-04-25 09:46:56 -04:00
|
|
|
|
2021-07-28 15:17:13 -04:00
|
|
|
const terserOptions = {
|
|
|
|
mangle: false,
|
|
|
|
compress: false,
|
|
|
|
format: {
|
|
|
|
beautify: true,
|
|
|
|
indent_level: 2
|
|
|
|
}
|
2018-04-25 09:46:56 -04:00
|
|
|
}
|
|
|
|
|
2021-07-28 15:17:13 -04:00
|
|
|
export default [
|
|
|
|
{
|
|
|
|
input: "app/javascript/activestorage/index.js",
|
|
|
|
output: {
|
|
|
|
file: "app/assets/javascripts/activestorage.js",
|
|
|
|
format: "umd",
|
|
|
|
name: "ActiveStorage"
|
|
|
|
},
|
|
|
|
plugins: [
|
|
|
|
resolve(),
|
|
|
|
commonjs(),
|
|
|
|
terser(terserOptions)
|
|
|
|
]
|
2018-04-25 09:46:56 -04:00
|
|
|
},
|
2021-07-28 15:17:13 -04:00
|
|
|
|
|
|
|
{
|
|
|
|
input: "app/javascript/activestorage/index.js",
|
|
|
|
output: {
|
|
|
|
file: "app/assets/javascripts/activestorage.esm.js",
|
|
|
|
format: "es"
|
|
|
|
},
|
|
|
|
plugins: [
|
|
|
|
resolve(),
|
|
|
|
commonjs(),
|
|
|
|
terser(terserOptions)
|
|
|
|
]
|
|
|
|
}
|
|
|
|
]
|