Exclude from production build
See original GitHub issueI am currently trying to remove your library from production builds since it is not needed. I wrapped the install statements:
const installExtensions = async () => {
if (process.env.NODE_ENV === 'development') {
const extensions = ['REACT_DEVELOPER_TOOLS', 'REDUX_DEVTOOLS'];
return Promise
.all(extensions.map(name => install.default(install[name])))
.catch(console.log);
}
return Promise.resolve();
};
For some odd reasons, the dependency still stays in production. Is it intended to?
Issue Analytics
- State:
- Created 6 years ago
- Comments:6 (4 by maintainers)
Top Results From Across the Web
How to exclude code from production in build-time?
I want when I build my app using webpack configuration to exclude this code. javascript · node.js · webpack · Share.
Read more >Is there a way to exclude files from the bundle in production?
I have some mock data which I use for testing in dev but it's getting bundled with the rest of my code in...
Read more >Exclude Mirage from Vue CLI production builds
Since Mirage is a development tool, you should configure Vue CLI to exclude it when building your app for production. This keeps the...
Read more >How to: Exclude Files from the Build - MSBuild | Microsoft Learn
Use conditions to exclude a file or directory from the inputs for a build ... If there are items that you want to...
Read more >Blog Exclude Drafts From Production | janosh.dev
When filtering out draft content for the production build, it's best to do so as close to the source as possible. There might...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

The way most people do it is to make
electron-devtools-installera devDep and then try catch the require 👍@SirWindfield If you are using webpack with Electron (for whatever reason) then the code you would want is this.