forked from openzim/python-scraperlib
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrollup.config.js
More file actions
39 lines (35 loc) · 1.02 KB
/
Copy pathrollup.config.js
File metadata and controls
39 lines (35 loc) · 1.02 KB
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
import { nodeResolve } from '@rollup/plugin-node-resolve'; // used to bundle node_modules code
import commonjs from '@rollup/plugin-commonjs'; // used to bundle CommonJS node_modules
import terser from '@rollup/plugin-terser'; // used to minify JS code
import strip from '@rollup/plugin-strip';
import versionInjector from 'rollup-plugin-version-injector';
const noStrict = {
renderChunk(code) {
return code.replace("'use strict';", '');
},
};
const watchOptions = {
exclude: 'node_modules/**',
chokidar: {
alwaysStat: true,
usePolling: true,
},
};
const plugins = [nodeResolve({ preferBuiltins: false }), commonjs(), noStrict];
if (!process.env.DEV) {
plugins.push(terser());
plugins.push(strip());
}
plugins.push(versionInjector()); // do it last so that it is kept no matter what
export default {
input: 'src/wombatSetup.js',
output: {
name: 'wombatSetup',
file: 'dist/wombatSetup.js',
sourcemap: false,
format: 'iife',
exports: 'named',
},
watch: watchOptions,
plugins: plugins,
};