Skip to content

Commit

Permalink
webpack for server: ignore browserslist
Browse files Browse the repository at this point in the history
  • Loading branch information
Diablohu committed Nov 5, 2019
1 parent dbb8bd0 commit 7467991
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions packages/koot-webpack/loaders/babel/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,20 +71,22 @@ module.exports = require('babel-loader').custom(babel => {
// return preset
// })
if (stage === 'server') {
newPresets.map(preset => {
newPresets.forEach((preset, index) => {
if (
typeof preset.file === 'object' &&
/^@babel\/preset-env$/.test(preset.file.request)
) {
if (!preset.options) preset.options = {};
preset.options.modules = false;
preset.options.exclude = [
const thisPreset = newPresets[index];
if (typeof thisPreset.options !== 'object')
thisPreset.options = {};
thisPreset.options.modules = false;
thisPreset.options.exclude = [
'@babel/plugin-transform-regenerator',
'@babel/plugin-transform-async-to-generator'
];
return preset;
thisPreset.options.ignoreBrowserslistConfig = true;
// console.log(thisPreset);
}
return preset;
});
}

Expand Down

0 comments on commit 7467991

Please sign in to comment.