Skip to content

Commit

Permalink
fix playground build
Browse files Browse the repository at this point in the history
  • Loading branch information
jonaslagoni committed Sep 11, 2023
1 parent 3b9b717 commit 55e04c0
Showing 1 changed file with 48 additions and 9 deletions.
57 changes: 48 additions & 9 deletions playground/config-overrides.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,51 @@
const path = require('path');

module.exports = function override(config, env) {
config.resolve = {
...config.resolve,
...{
modules: [path.resolve(__dirname, 'node_modules'), 'node_modules'],
},
};

return config;
module.exports = {
webpack: function(config, env) {
config.plugins;
config.module.rules = config.module.rules.map(rootRule => {
if (rootRule.oneOf) {
rootRule.oneOf = rootRule.oneOf.map(rule => {
if ((rule.loader ?? '').includes('babel-loader/lib/index.js')) {
rule.use = [
path.join(
__dirname,
'../library/loaders/remove-hashbag-loader.js',
),
{
loader: rule.loader,
options: {
...rule.options,
plugins: [
...(rule.options.plugins ?? []),
'@babel/plugin-proposal-class-properties',
],
},
},
];
delete rule.loader;
delete rule.options;
}
return rule;
});
}
return rootRule;
});
config.resolve = {
...config.resolve,
...{
alias: {
'nimma/legacy$': path.resolve(
__dirname,
'node_modules/nimma/dist/legacy/cjs/index.js',
),
'nimma/fallbacks$': path.resolve(
__dirname,
'node_modules/nimma/dist/cjs/fallbacks/index.js',
),
},
},
};
return config;
},
};

0 comments on commit 55e04c0

Please sign in to comment.