Closed AshKyd closed 6 years ago
This can be fixed by manually adding babel-preset-react
to the config with something like this:
const path = require('path');
module.exports = {
webpack: function(config){
const jsRule = config.module.rules.find(rule => String(rule.test).includes('.js'));
jsRule.options.presets.push(path.join(__dirname, 'node_modules/babel-preset-react/lib/index.js'));
return config;
}
};
Looks like the default webpack config doesn't have it.
I'm hoping this is something that can be fixed by adding the type
property to your config object:
module.exports = {
type: 'react', // <-- ✨
build: { },
webpack: function(config){
return config;
}
}
Yeah, that's correct. Let's close this as user error unless you have more specific thoughts.
On a new project, the following
aunty.config.js
breaks the React build:with the following error:
Edit: this also applies to the following webpack.config.js: