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"
|
||||
],
|
||||
"rules": {
|
||||
"webpack/apply-externals": "off",
|
||||
"github/convert-npm-to-bun": "off"
|
||||
},
|
||||
"match": {
|
||||
|
|
|
|||
|
|
@ -27,6 +27,7 @@ const notEmpty = (a) => a;
|
|||
const clean = (array) => array.filter(notEmpty);
|
||||
|
||||
const noParse = (a) => /\.spec\.js$/.test(a);
|
||||
const convertToWebpack5Externals = (fn) => (context, request, cb) => fn({context, request}, cb);
|
||||
|
||||
const options = {
|
||||
babelrc: true,
|
||||
|
|
@ -100,7 +101,7 @@ module.exports = {
|
|||
devtoolModuleFilenameTemplate,
|
||||
publicPath: '/dist/',
|
||||
},
|
||||
externals: [externals],
|
||||
externals: [convertToWebpack5Externals(externals)],
|
||||
module: {
|
||||
rules,
|
||||
noParse,
|
||||
|
|
@ -112,7 +113,7 @@ module.exports = {
|
|||
},
|
||||
};
|
||||
|
||||
function externals(context, request, fn) {
|
||||
function externals({request}, fn) {
|
||||
if (!isDev)
|
||||
return fn();
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue