Answer the question
In order to leave comments, you need to log in
Babel on Nuxt doesn't work (all sorts of ES6 things like "const" remain in the code), how to fix it?
I generate a static project in Nuxt, but for some reason it does not bring it to the ES5 format (I need it to be without const, etc.).
Tried setting up Babel myself.
$ npm install --save-dev @babel/preset-env
$ npm install --save @babel/runtime
$ npm install --save-dev @babel/plugin-transform-runtime
build: {
babel: {
"presets": ["@babel/preset-env"],
"plugins": [
["@babel/transform-runtime"]
]
}
}
Answer the question
In order to leave comments, you need to log in
Customize .browserlistrc
.
Let and Const are well supported and in the default setting they seem to be allowed.
For browser- or Electron-based projects, we recommend using a .browserslistrc file to specify targets. You may already have this configuration file as it is used by many tools in the ecosystem, like autoprefixer, stylelint, eslint-plugin-compat and many others.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question