Skip to content
This repository was archived by the owner on Apr 1, 2023. It is now read-only.

[request] ability to add babel plugins/edit webpack config. #226

Open
r3wt opened this issue Apr 10, 2020 · 1 comment
Open

[request] ability to add babel plugins/edit webpack config. #226

r3wt opened this issue Apr 10, 2020 · 1 comment

Comments

@r3wt
Copy link

r3wt commented Apr 10, 2020

i would like my development build to maintain the console.log statements, however i would like the production build to have console.log statements stripped. i have did this in several projects using babel-plugin-transform-remove-console, but i can't figure out where to start with this project, called microbundle-crl.i also can't find the github page for the package, as the readme points to the microbundle library it was forked from

@JasonHeylon
Copy link
Contributor

I believe you can just add your own .babelrc in the root of your project folder. And set NODE_ENV=production in 'build' script. Like below

// package.json
"build": "NODE_ENV=production microbundle-crl --no-compress --format modern,cjs",
// .babelrc.js
const plugins = [
  process.env.NODE_ENV === 'production' && 'transform-remove-console',
].filter(Boolean)

module.exports = {
  plugins,
}

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants