forked from gisarmory/mapboxgl.InternetMapCorrection
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathrollup-config.js
39 lines (36 loc) · 1.12 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
import rollupGitVersion from 'rollup-plugin-git-version'
import json from 'rollup-plugin-json'
import babel from 'rollup-plugin-babel';
import resolve from 'rollup-plugin-node-resolve';
import commonjs from '@rollup/plugin-commonjs';
import { string } from "rollup-plugin-string";
let release;
// Skip the git branch+rev in the banner when doing a release build
if (process.env.NODE_ENV === 'release') {
release = true;
} else {
release = false;
}
export default {
input: 'src/rasterTileLayer.js', // 入口文件
output: [
{
file: 'dist/rasterTileLayer-src.js', // 出口文件
format: 'umd', // 代码打包时的格式,这个格式可以前后端通用,除此之外还有其他格式:cjs,iife,es,amd, umd
name: 'rasterTileLayer', // 包的名字,
sourcemap: true
}
],
legacy: true, // Needed to create files loadable by IE8
plugins: [
string({
include: "src/shaders/*",
}),
release ? json() : rollupGitVersion(),
resolve(), //此插件可以将引用库中的文件进行打包
commonjs(),
babel({
exclude: ['node_modules/**'],
}),
]
};