fix dayjs is not excluded in dist (#6767)
parent
4fe57fa322
commit
37059c38fd
|
@ -14,14 +14,15 @@ function addLocales(webpackConfig) {
|
||||||
}
|
}
|
||||||
|
|
||||||
function externalDayjs(config) {
|
function externalDayjs(config) {
|
||||||
config.externals.dayjs = {
|
config.externals.push({
|
||||||
dayjs: {
|
dayjs: {
|
||||||
root: 'dayjs',
|
root: 'dayjs',
|
||||||
commonjs2: 'dayjs',
|
commonjs2: 'dayjs',
|
||||||
commonjs: 'dayjs',
|
commonjs: 'dayjs',
|
||||||
amd: 'dayjs',
|
amd: 'dayjs',
|
||||||
|
module: 'dayjs',
|
||||||
},
|
},
|
||||||
};
|
});
|
||||||
config.externals.push(function ({ _context, request }, callback) {
|
config.externals.push(function ({ _context, request }, callback) {
|
||||||
if (/^dayjs\/plugin\//.test(request)) {
|
if (/^dayjs\/plugin\//.test(request)) {
|
||||||
const name = request.replace(/\//g, '_');
|
const name = request.replace(/\//g, '_');
|
||||||
|
@ -30,6 +31,7 @@ function externalDayjs(config) {
|
||||||
commonjs2: name,
|
commonjs2: name,
|
||||||
commonjs: name,
|
commonjs: name,
|
||||||
amd: name,
|
amd: name,
|
||||||
|
module: name,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
callback();
|
callback();
|
||||||
|
|
Loading…
Reference in New Issue