-
Notifications
You must be signed in to change notification settings - Fork 640
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* build: mpas 包添加 umd 产物 * chore: add changeset * test: sleepTime
- Loading branch information
Showing
4 changed files
with
50 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'@antv/l7-maps': patch | ||
--- | ||
|
||
build: mpas 包添加 umd 产物 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,48 @@ | ||
import type { IFatherConfig } from 'father'; | ||
import { defineConfig } from 'father'; | ||
import { BundleAnalyzerPlugin } from 'webpack-bundle-analyzer'; | ||
|
||
const isProduction = process.env.NODE_ENV === 'production'; | ||
|
||
const umdConfig: IFatherConfig['umd'] = { | ||
name: 'L7Maps', | ||
output: { | ||
path: './dist', | ||
filename: 'l7-maps.min.js', | ||
}, | ||
platform: 'browser', | ||
targets: { ie: 11 }, | ||
externals: { | ||
'mapbox-gl': { | ||
root: 'mapboxgl', | ||
commonjs: 'mapbox-gl', | ||
commonjs2: 'mapbox-gl', | ||
amd: 'mapbox-gl', | ||
}, | ||
'maplibre-gl': { | ||
root: 'maplibregl', | ||
commonjs: 'maplibre-gl', | ||
commonjs2: 'maplibre-gl', | ||
amd: 'maplibre-gl', | ||
}, | ||
}, | ||
chainWebpack(memo) { | ||
// 关闭压缩方便调试,默认开启 | ||
// memo.optimization.minimize(false); | ||
|
||
// 打包体积分析 | ||
memo | ||
.plugin('webpack-bundle-analyzer') | ||
.use(BundleAnalyzerPlugin, [{ analyzerMode: 'static', openAnalyzer: false }]); | ||
|
||
return memo; | ||
}, | ||
}; | ||
|
||
export default defineConfig({ | ||
extends: '../../.fatherrc.base.ts', | ||
// 使用 babel 编译 esm/cjs 产物,启用 transform-import-css-l7 插件完成 CSS 内联打包 | ||
esm: { transformer: 'babel' }, | ||
cjs: isProduction ? { transformer: 'babel' } : undefined, | ||
umd: isProduction ? umdConfig : undefined, | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters