Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added support for node env provide plugin. #204

Merged
merged 4 commits into from
Oct 9, 2017
Merged

Conversation

carloskelly13
Copy link

@carloskelly13 carloskelly13 commented Oct 9, 2017

For electron webpack dashboard we want to visually show differences when running in production and be more specific in webpack dashboard. This will be needed for FormidableLabs/electron-webpack-dashboard#33.

Addresses #197

  • See if the DefinePlugin exists and safely traverse the object to see if a production NODE_ENV variable is set
  • Report that value once when the webpack process starts (since it cannot change over the lifetime of the running dashboard instance)

cc @kenwheeler @ryan-roemer

Copy link
Member

@ryan-roemer ryan-roemer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Needs a node4 change + new ticket. After that, good to merge.

README.md Outdated
@@ -59,6 +59,10 @@ You would change that to:
```
Now you can just run your start script like normal, except now, you are awesome. Not that you weren't before. I'm just saying. More so.

### InspectPack and Node Environments

Webpack Dashboard does additional analysis of individual module sizes, asset sizes and any problems when your bundle is unminified and not in a production environment. The Webpack Plugin automatically adds `pathinfo = true` to your configuration’s output object. Environments are defined through the `DefinePlugin` with `process.env["NODE_ENV"]` being `"production"`. Webpack Dashboard will produce a warning if a production configuration is run.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NIT: s/asset sizes and/asset sizes, and/

plugin/index.js Outdated
@@ -2,6 +2,7 @@
"use strict";

const _ = require("lodash/fp");
const { get } = require("lodash");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Uh oh.

  1. This will break in node4 which is supported. Can you file a ticket with a 1.0 milestone tag that is basically "CI: ensure code works in supported nodes".
  2. For here, just remove and use _ which is already in scope above.

@carloskelly13 carloskelly13 merged commit 7f02ea9 into master Oct 9, 2017
@carloskelly13 carloskelly13 deleted the node-env-support branch October 9, 2017 20:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants