Skip to content
This repository has been archived by the owner on Nov 16, 2019. It is now read-only.

Dry property needed #20

Open
devrafalko opened this issue Jul 6, 2017 · 0 comments
Open

Dry property needed #20

devrafalko opened this issue Jul 6, 2017 · 0 comments

Comments

@devrafalko
Copy link

In many other webpack plugins I can control whether I want or not to run the plugin, eg:

plugins:[
  new somePlugin({
    dry: production, //process.env.NODE_ENV
  })
]

I don't want to run open-browser-webpack-plugin for each webpack execution, just for webpack-dev-server. For now, I concatenated the function for webpack.config.js plugins array

plugins: [
  //some static plugins
].concat(checkNodeEnv());

function checkNodeEnv(){
  if(process.env.NODE_ENV==='dev') return [new somePlugin({})];
}

that checks process.env.NODE_ENV and conditionally returns the array item with open-browser-webpack-plugin plugin, but it's quite tricky and not very handy.

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

1 participant