Did anyone had the same issue?
Jan 27, 2020
1
Level 3
How to setup babel to read package.json in mix?
Hi Guys,
I"m new to react and front end stuff, so today i learned stuff about
@babel/plugin-proposal-class-properties in babel plugin. I learned that in babel you can put the presets and plugins together in package.json under babel: ... tag.
However when I put them there it is not loaded by laravel mix when I run them , do i need to change any config of webpack or something?
I manage to do it after I created .babelrc with this:
{
"presets": [
"@babel/preset-env",
"@babel/preset-react"
],
"plugins": [
[
"@babel/plugin-proposal-class-properties",
{
"loose": true
}
]
]
}
Previously when I try to put that in package.json it does not get loaded. Already checked it through
console.log(Config.babel());
Any help would be appreciated, I don't want to have multiple configs for my js files so I want them as one in package.json
Thanks
Please or to participate in this conversation.