forked from cuixiaorui/mini-vue
-
Notifications
You must be signed in to change notification settings - Fork 0
/
rollup.config.js
40 lines (39 loc) · 938 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
34
35
36
37
38
39
40
import pkg from "./package.json";
import typescript from "@rollup/plugin-typescript";
import sourceMaps from "rollup-plugin-sourcemaps";
import resolve from "@rollup/plugin-node-resolve";
import commonjs from "@rollup/plugin-commonjs";
import replace from "@rollup/plugin-replace";
export default {
input: "./src/index.ts",
plugins: [
replace({
"process.env.NODE_ENV": JSON.stringify("development"),
"process.env.VUE_ENV": JSON.stringify("browser"),
"process.env.LANGUAGE": JSON.stringify(process.env.LANGUAGE),
}),
resolve(),
commonjs(),
typescript(),
sourceMaps(),
],
output: [
{
format: "cjs",
file: pkg.main,
sourcemap: true,
},
{
name: "vue",
format: "es",
file: pkg.module,
sourcemap: true,
},
],
onwarn: (msg, warn) => {
// 忽略 Circular 的错误
if (!/Circular/.test(msg)) {
warn(msg);
}
},
};