-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.core.js
32 lines (28 loc) · 938 Bytes
/
webpack.core.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
// / <reference types="./nodejs.d.ts" />
const path = require('path');
const merge = require('webpack-merge');
const common = require('./webpack.common');
/** @type { import("webpack").Configuration } */
const prodConfig = merge(common, {
mode: 'production',
entry: path.join(__dirname, 'src', 'core', 'index'),
output: {
filename: 'aol.core.min.js',
},
externals: [
// 引入包里的特定部分
function(context, request, callback) {
// 所有 ol 包里的内容
if (/^ol\/?/.test(request)) {
// console.log(request);
// https://segmentfault.com/q/1010000021965610?_ea=33440450
// https://blog.meathill.com/fe-tool-chain/webpack-4-notes.html
/** 先关闭webgl */
// if (request === 'ol/layer/WebGLPoints') return callback();
return callback(null, request.replace(/\//g, '.'));
}
callback();
},
],
});
module.exports = prodConfig;