Skip to content

Commit d7a8bd0

Browse files
committed
【fix】copy-webpack-plugin
1 parent 0a910fa commit d7a8bd0

File tree

2 files changed

+17
-14
lines changed

2 files changed

+17
-14
lines changed

build/webpack.config.mapboxgl.js

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ module.exports = {
1010
target: configBase.target,
1111
mode: configBase.mode,
1212
//页面入口文件配置
13-
entry: [...configBase.entry, `${__dirname}/../src/mapboxgl/namespace.js` ,`${__dirname}/../src/mapboxgl/css/index.js`],
13+
entry: [...configBase.entry, `${__dirname}/../src/mapboxgl/namespace.js`, `${__dirname}/../src/mapboxgl/css/index.js`],
1414
//入口文件输出配置
1515
output: configBase.output(libName, productName),
1616
//是否启用压缩
@@ -35,7 +35,7 @@ module.exports = {
3535
module: {
3636
noParse: /[\/\\]node_modules[\/\\]mapbox-gl[\/\\]dist[\/\\]mapbox-gl\.js$/,
3737

38-
rules: (function() {
38+
rules: (function () {
3939
let moduleRules = [];
4040
moduleRules.push(configBase.module.rules.img);
4141
const babelConfig = {
@@ -46,16 +46,16 @@ module.exports = {
4646
presets: ['@babel/preset-env'],
4747
plugins: [
4848
[
49-
'@babel/plugin-transform-runtime',
50-
{
51-
absoluteRuntime: false,
52-
corejs: false,
53-
helpers: false,
54-
regenerator: true,
55-
useESModules: false
56-
}
49+
'@babel/plugin-transform-runtime',
50+
{
51+
absoluteRuntime: false,
52+
corejs: false,
53+
helpers: false,
54+
regenerator: true,
55+
useESModules: false
56+
}
5757
]
58-
]
58+
]
5959
}
6060
}
6161
configBase.moduleVersion === "es6" && (babelConfig.include = /FGBLayer|flatgeobuf/);
@@ -66,8 +66,10 @@ module.exports = {
6666
},
6767
plugins: [
6868
...configBase.plugins(libName, productName),
69-
new CopyPlugin([
70-
{ from: `${__dirname}/../dist/resources/symbols`, to: `${__dirname}/../dist/mapboxgl/resources/symbols`}
71-
])
69+
new CopyPlugin({
70+
patterns: [
71+
{ from: `${__dirname}/../dist/resources/symbols`, to: `${__dirname}/../dist/mapboxgl/resources/symbols` }
72+
]
73+
})
7274
]
7375
};

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@
8686
"chromedriver": "87.0.5",
8787
"clean-css-cli": "^4.3.0",
8888
"commander": "^9.0.0",
89+
"copy-webpack-plugin": "^9.1.0",
8990
"cross-env": "^7.0.2",
9091
"css-loader": "^6.7.1",
9192
"elasticsearch": "16.7.3",

0 commit comments

Comments
 (0)