-
Notifications
You must be signed in to change notification settings - Fork 0
/
rollup.config.js
executable file
·97 lines (83 loc) · 1.66 KB
/
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
import resolve from "rollup-plugin-node-resolve";
import commonjs from "rollup-plugin-commonjs";
//import alias from 'rollup-plugin-alias';
import babel from 'rollup-plugin-babel';
import replace from 'rollup-plugin-replace';
import cleanup from 'rollup-plugin-cleanup';
import pkgConfig from "./package.json";
var version = process.env.NEW_VERSION ? process.env.NEW_VERSION : pkgConfig.version;
var banner =
`
/*
* turf-google-maps
* version v${version}
* MIT Licensed
* Felipe Figueroa ([email protected])
* https://github.com/HuasoFoundries/turf-google-maps
*/
`;
var input = "src/ig_turfhelper.js",
output = [{
file: "dist/ig_turfhelper.js",
format: "umd",
name: 'turfHelper',
exports: 'named',
extend: false,
banner
},
{
file: "dist/ig_turfhelper.esm.js",
format: "es",
extend: false,
banner
}
],
plugins = [
commonjs({
include: [
'node_modules/simplify-js/**',
'node_modules/rbush/**',
'node_modules/@turf/**',
'node_modules/quickselect/**',
'node_modules/wicket/**'
]
}),
replace({
const: 'var',
let: 'var',
}),
resolve({
module: true, // Default: true
jsnext: true, // Default: false
main: false
}),
babel(),
cleanup()
];
if (process.env.UTILS) {
input = "src/components/utils.js";
output = [{
file: "dist/utils.js",
format: "umd",
name: 'turfUtils',
exports: 'named',
extend: false,
banner
}];
}
if (process.env.SUBSET) {
input = "src/ig_subset.js";
output = [{
file: "dist/ig_subset.js",
format: "umd",
name: 'turfSubset',
exports: 'named',
extend: false,
banner
}];
}
export default {
input: input,
plugins: plugins,
output: output
};