Skip to content

Commit 82803d8

Browse files
committed
[feature] 预定义符号打包配置
review by zhaoq
1 parent 1d8d01e commit 82803d8

File tree

6 files changed

+88270
-177128
lines changed

6 files changed

+88270
-177128
lines changed

build/webpack.config.symbol.js

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
const configBase = require('./webpack.config.base');
2+
//端名
3+
const libName = 'symbol';
4+
//产品包名
5+
const productName = 'iclient-symbol';
6+
//
7+
const CopyPlugin = require('copy-webpack-plugin');
8+
9+
module.exports = {
10+
target: configBase.target,
11+
mode: configBase.mode,
12+
//页面入口文件配置
13+
entry: configBase.entry,
14+
//入口文件输出配置
15+
output: configBase.output(libName, productName),
16+
//是否启用压缩
17+
optimization: configBase.optimization,
18+
//不显示打包文件大小相关警告
19+
performance: configBase.performance,
20+
//其它解决方案配置
21+
resolve: configBase.resolve,
22+
23+
module: {
24+
rules: (function () {
25+
let moduleRules = [];
26+
const babelConfig = {
27+
test: [/\.js$/],
28+
loader: 'babel-loader',
29+
options: {
30+
presets: ['@babel/preset-env'],
31+
plugins: [
32+
[
33+
'@babel/plugin-transform-runtime',
34+
{
35+
absoluteRuntime: false,
36+
corejs: false,
37+
helpers: false,
38+
regenerator: true,
39+
useESModules: false
40+
}
41+
]
42+
]
43+
}
44+
}
45+
configBase.moduleVersion === "es6" && (babelConfig.include = /FGBLayer|flatgeobuf/);
46+
moduleRules.push(babelConfig);
47+
return moduleRules;
48+
})()
49+
},
50+
plugins: [
51+
new CopyPlugin([
52+
{ from: `${__dirname}/../src/symbol/resources`, to: `${__dirname}/../dist/${libName}/resources` }
53+
])]
54+
};

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy