I have a class where I use some static properties like this:
class Entity {
static LIMIT = 10;
}
So, i can do:
Entity.LIMIT
In order to do that I'm using babel plugin-proposal-class-properties and in my .babelrc I have:
{
"presets": ["@babel/preset-env"],
"plugins": [
["@babel/plugin-proposal-class-properties", { "loose": true }]
]
}
I'm using jest and my test passes using that config. Now I need to use funcionality of Entity class inside a vuejs component. But I got the error:
Module parse failed: Unexpected token. You may need an appropriate loader to handle this file type
I also tried a babel config file in my project root: babel.config.js
module.exports = {
presets: ["@babel/preset-env"],
plugins: [
["@babel/plugin-proposal-class-properties", { "loose": true }]
]
};
But didn't work. How can i configure vuejs, to make work this babel plugin?
I'm using vue2.6.11 and vue-cli 3