chore: webpack: apply webpack5 externals

This commit is contained in:
coderaiser 2023-12-04 20:46:25 +02:00
parent 48dba5fa7e
commit 72df4288ef
2 changed files with 3 additions and 3 deletions

View file

@ -7,7 +7,6 @@
"fontello.json"
],
"rules": {
"webpack/apply-externals": "off",
"github/convert-npm-to-bun": "off"
},
"match": {

View file

@ -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();