I'm new to Neutrino, but I have my project working for everything but the object spread operator let bar = {...foo, x: 1}
yields Module parse failed: Unexpected token
over and over.
I'm already using the react preset/middleware, but I went ahead and manually added the transform plugin as well when the preset alone didn't work. Here is my .neutrinorc.js config:
module.exports = {
options: {
mains: {
index: 'index',
login: 'login'
}
},
use: [
['@neutrinojs/react', { html: { title: 'SST' }}],
['@neutrinojs/dev-server', { port: 1332 }],
'@neutrinojs/mocha',
neutrino => {
// access the Neutrino API
neutrino.config.resolve.modules.add('node_modules');
neutrino.config.module
.rule('compile')
.use('babel')
.tap(options => {
options.plugins.push(require.resolve('babel-plugin-transform-object-rest-spread'))
return options;
});
}
]
};