ci: keep function names when minifying code

This commit is contained in:
Johannes Loher 2021-10-27 23:04:35 +02:00
parent e8674b84c8
commit 4f0e885494

View file

@ -5,12 +5,17 @@
const sourcemaps = require('rollup-plugin-sourcemaps');
const { terser } = require('rollup-plugin-terser');
module.exports = {
/**
* @type {import('rollup').RollupOptions}
*/
const config = {
input: 'src/module/darkness-dependent-vision.js',
output: {
dir: 'dist/module',
format: 'es',
sourcemap: true,
},
plugins: [sourcemaps(), process.env.NODE_ENV === 'production' && terser()],
plugins: [sourcemaps(), process.env.NODE_ENV === 'production' && terser({ ecma: 2020, keep_fnames: true })],
};
module.exports = config;