forked from mbloch/mapshaper
-
Notifications
You must be signed in to change notification settings - Fork 0
/
rollup.config.js
33 lines (31 loc) · 795 Bytes
/
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
import { nodeResolve } from '@rollup/plugin-node-resolve';
const onBundle = {
name: 'onbundle',
writeBundle() {
// copy mapshaper.js to www/
const fs = require('fs');
const path = require('path');
const src = path.join(__dirname, 'mapshaper.js');
const dest = path.join(__dirname, 'www/mapshaper.js');
fs.writeFileSync(dest, fs.readFileSync(src));
}
};
export default [{
treeshake: false,
input: 'src/gui/gui.mjs',
output: [{
strict: false,
format: 'iife',
file: 'www/mapshaper-gui.js'
}]
}, {
treeshake: false,
input: 'src/mapshaper.mjs',
output: [{
strict: false,
format: 'iife',
file: 'mapshaper.js',
intro: 'var VERSION = "' + require('./package.json').version + '";\n'
}],
plugins: [onBundle, nodeResolve()]
}];