Hi all,
I’ve recently had an issue with JS async/await and found out that the default transpiler for Sage9 (buble) does not support them Using async throws “unexpected token”
So I’m trying to switch to babel, but I don’t really know what I’m doing!
Here’s what I’ve tried:
yarn add babel-loader -dev
followed by yarn-add @babel/core -dev
In my webpack.config.js
from line 53
I have:
{
test: /\.js$/,
exclude: [/node_modules(?)/],
use: [
{ loader: 'cache' },
{
loader: 'babel-loader',
options: {
objectAssign: 'Object.assign',
transforms: {
modules: false,
dangerousForOf: true,
},
},
},
],
},
Then I go yarn build
and I get:
ERROR Failed to compile with 2 errors 2:25:17 PM
Module build failed: TypeError: this.getOptions is not a function
at Object.loader (/Users/kevinpriceward/Sites/4x4tyres/public_html/app/themes/4x4tyres/node_modules/babel-loader/lib/index.js:46:28)
at Object.<anonymous> (/Users/kevinpriceward/Sites/4x4tyres/public_html/app/themes/4x4tyres/node_modules/babel-loader/lib/index.js:41:12)
Module build failed: TypeError: this.getOptions is not a function
at Object.loader (/Users/kevinpriceward/Sites/4x4tyres/public_html/app/themes/4x4tyres/node_modules/babel-loader/lib/index.js:46:28)
at Object.<anonymous> (/Users/kevinpriceward/Sites/4x4tyres/public_html/app/themes/4x4tyres/node_modules/babel-loader/lib/index.js:41:12)
You may use special comments to disable some warnings.
Use // eslint-disable-next-line to ignore the next line.
Use /* eslint-disable */ to ignore all warnings in a file.
What am I doing wrong?