sass-site/rollup.config.js

32 lines
671 B
JavaScript
Raw Normal View History

2023-01-09 20:10:02 +01:00
import { babel } from '@rollup/plugin-babel';
import commonjs from '@rollup/plugin-commonjs';
import inject from '@rollup/plugin-inject';
import { nodeResolve } from '@rollup/plugin-node-resolve';
import terser from '@rollup/plugin-terser';
2023-01-06 23:35:10 +01:00
2023-01-09 20:10:02 +01:00
const prod = process.env.BABEL_ENV === 'production';
2023-01-06 23:35:10 +01:00
const plugins = [
nodeResolve({ browser: true }),
commonjs(),
inject({
2023-01-09 20:10:02 +01:00
$: 'jquery',
jQuery: 'jquery',
2023-01-06 23:35:10 +01:00
}),
2023-01-09 20:10:02 +01:00
babel({ babelHelpers: 'bundled' }),
2023-01-06 23:35:10 +01:00
];
if (prod) {
plugins.push(terser());
}
export default {
2023-01-09 20:10:02 +01:00
input: 'source/assets/js/sass.js',
2023-01-06 23:35:10 +01:00
output: {
2023-01-09 20:10:02 +01:00
file: 'source/assets/dist/js/sass.js',
format: 'iife',
2023-01-06 23:35:10 +01:00
sourcemap: !prod,
},
plugins,
};