mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-01-23 02:35:49 +00:00
chore: webpack: apply webpack5 externals
This commit is contained in:
parent
48dba5fa7e
commit
72df4288ef
2 changed files with 3 additions and 3 deletions
|
|
@ -7,7 +7,6 @@
|
||||||
"fontello.json"
|
"fontello.json"
|
||||||
],
|
],
|
||||||
"rules": {
|
"rules": {
|
||||||
"webpack/apply-externals": "off",
|
|
||||||
"github/convert-npm-to-bun": "off"
|
"github/convert-npm-to-bun": "off"
|
||||||
},
|
},
|
||||||
"match": {
|
"match": {
|
||||||
|
|
|
||||||
|
|
@ -27,6 +27,7 @@ const notEmpty = (a) => a;
|
||||||
const clean = (array) => array.filter(notEmpty);
|
const clean = (array) => array.filter(notEmpty);
|
||||||
|
|
||||||
const noParse = (a) => /\.spec\.js$/.test(a);
|
const noParse = (a) => /\.spec\.js$/.test(a);
|
||||||
|
const convertToWebpack5Externals = (fn) => (context, request, cb) => fn({context, request}, cb);
|
||||||
|
|
||||||
const options = {
|
const options = {
|
||||||
babelrc: true,
|
babelrc: true,
|
||||||
|
|
@ -100,7 +101,7 @@ module.exports = {
|
||||||
devtoolModuleFilenameTemplate,
|
devtoolModuleFilenameTemplate,
|
||||||
publicPath: '/dist/',
|
publicPath: '/dist/',
|
||||||
},
|
},
|
||||||
externals: [externals],
|
externals: [convertToWebpack5Externals(externals)],
|
||||||
module: {
|
module: {
|
||||||
rules,
|
rules,
|
||||||
noParse,
|
noParse,
|
||||||
|
|
@ -112,7 +113,7 @@ module.exports = {
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
function externals(context, request, fn) {
|
function externals({request}, fn) {
|
||||||
if (!isDev)
|
if (!isDev)
|
||||||
return fn();
|
return fn();
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue