https://www.npmjs.com/package/babel-plugin-transform-remove-console
Create nuxt project
In nuxt.config.js place:
babel: {
babelrc: true,
cacheDirectory: undefined,
presets: ["@nuxt/babel-preset-app"]
},
In .babelrc file place:
{
"env": {
"production": {
"plugins": ["transform-remove-console"]
}
}
}
In terminal/console do: npm install babel-plugin-transform-remove-console --save
I expect that the babel plugin is loaded and being run, in this case stripping all my console logs
It's not working, it seems like it's not being loaded at all.
Any reason it won't work out with build.babel.plugins as shown in https://twitter.com/TheAlexLichter/status/1058296116876320769 ? :thinking:
That work does work out! It is just an option i did not came accross!
I followed whatever was on this page: https://nuxtjs.org/api/configuration-build/ and went by that.
But this is what i needed so thanks for that :)
what was the full solution again?
Most helpful comment
Any reason it won't work out with
build.babel.pluginsas shown in https://twitter.com/TheAlexLichter/status/1058296116876320769 ? :thinking: