Skip to content

Commit

Permalink
[patch] update dep and use node:false webpack option (#534)
Browse files Browse the repository at this point in the history
  • Loading branch information
jchip authored Aug 10, 2017
1 parent c5a126c commit 7ed8eb7
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 19 deletions.
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
"use strict";

const archetype = require("electrode-archetype-react-app/config/archetype");
const webpack = require("webpack");
const FunctionModulePlugin = require("webpack/lib/FunctionModulePlugin");
const logger = require("electrode-archetype-react-app/lib/logger");

module.exports = function(options) {
Expand All @@ -14,22 +12,7 @@ module.exports = function(options) {
archetype.webpack.enableNodeSourcePlugin !== true
) {
logger.info("Disabling NodeSourcePlugin for production");
// disable NodeSourcePlugin by setting a custom target, and then apply the
// plugins the original web target would've applied.
// will be much easier once webapck with node: false option is released
const output = config.output;
config.target = () => undefined;
config.plugins = [
new webpack.JsonpTemplatePlugin(output),
new FunctionModulePlugin(output),
new webpack.LoaderTargetPlugin("web")
].concat(config.plugins);
return {
resolve: {
aliasFields: ["browser"],
mainFields: ["browser", "module", "main"]
}
};
return { node: false };
} else {
logger.info(`Not disabling NodeSourcePlugin. NODE_ENV: '${process.env.NODE_ENV}'`);
return {};
Expand Down
2 changes: 1 addition & 1 deletion packages/electrode-archetype-react-app-dev/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
"eslint-config-walmart": "^1.1.0",
"eslint-plugin-filenames": "^1.1.0",
"eslint-plugin-react": "^6.5.0",
"extract-text-webpack-plugin": "^2.1.2",
"extract-text-webpack-plugin": "^3.0.0",
"favicons": "^4.8.3",
"file-loader": "^0.11.1",
"fs-extra": "^0.26.5",
Expand Down

0 comments on commit 7ed8eb7

Please sign in to comment.