forked from terraformer-js/terraformer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
rollup.umd.config.js
41 lines (36 loc) · 961 Bytes
/
rollup.umd.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
import resolve from 'rollup-plugin-node-resolve';
import json from 'rollup-plugin-json';
import babel from '@rollup/plugin-babel';
const path = require('path');
/**
* Since Rollup runs inside each package
* we can just get the current package we are bundling.
*/
const pkg = require(path.join(process.cwd(), 'package.json'));
const copyright = `/* @preserve
* ${pkg.name} - v${pkg.version} - ${pkg.license}
* Copyright (c) 2012-${new Date().getFullYear()} Environmental Systems Research Institute, Inc.
* ${new Date().toString()}
*/`;
/**
* and dig out its name.
*/
const { name } = pkg;
const sanitizedName = name.replace('@terraformer/', 't-');
export default {
input: 'src/index.js', // resolved by our plugin
plugins: [
resolve(),
json(),
babel({
rootMode: 'upward'
})
],
output: {
file: `./dist/${sanitizedName}.umd.js`,
banner: copyright,
format: 'umd',
name: 'Terraformer',
extend: true
}
};