generated from hbxks18/icon-tpl
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrollup.config.js
67 lines (65 loc) · 1.77 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
/*
* @Author: DG
* @Date: 2020-10-13 20:10:24
* @LastEditors: DG
* @LastEditTime: 2020-10-14 14:59:49
* @Description: file content
*/
import commonjs from "rollup-plugin-commonjs";
import babel from "rollup-plugin-babel";
import postcss from "rollup-plugin-postcss";
import ascii from "rollup-plugin-ascii";
import resolve from "@rollup/plugin-node-resolve";
import includePaths from "rollup-plugin-includepaths";
import { terser } from "rollup-plugin-terser";
const externalAry = [
"antd",
"antd/es/locale/zh_CN",
"antd/dist/antd.css",
"moment",
"moment/locale/zh-cn",
"echarts",
"prop-types",
"snowflake-id",
"win-trade-base",
"@lugia/lugiax",
"@ant-design/icons",
"react",
"react-transition-group",
"react-dnd",
"react-dnd-html5-backend",
"react-loadable",
"react-resizable",
];
export default {
input: "src/index.js",
output: {
file: "dist/index.js",
format: "esm",
sourcemap: true,
},
plugins: [
resolve(),
includePaths({
include: { "yss-biz": "./yss-biz-base/index.js" },
}),
babel({ exclude: "**/node_modules/**", runtimeHelpers: true }),
commonjs(),
ascii(),
// postcss({
// // Extract CSS to the same location where JS file is generated but with .css extension.
// extract: true,
// // Use named exports alongside default export.
// namedExports: true,
// // Minimize CSS, boolean or options for cssnano.
// minimize: true,
// // Enable sourceMap.
// sourceMap: true,
// // This plugin will process files ending with these extensions and the extensions supported by custom loaders.
// extensions: [".less", ".css"],
// }),
terser(),
],
//不能使用正则匹配,有定制化组件也是以echarts命名
external: externalAry,
};