Skip to content

Commit 0bdf663

Browse files
committed
Use expose?React webpack loader only in dev environment
1 parent 790f21d commit 0bdf663

File tree

3 files changed

+3
-2
lines changed

3 files changed

+3
-2
lines changed

webpack/webpack.common.config.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ module.exports = {
1717
},
1818
module: {
1919
loaders: [
20-
{ test: require.resolve("react"), loader: "expose?React" },
2120
{ test: /\.css$/, loader: "style-loader!css-loader" },
2221
{ test: /\.scss$/, loader: "style!css!sass?outputStyle=expanded&imagePath=/assets/images"},
2322

webpack/webpack.hot.config.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@ config.entry.push("webpack-dev-server/client?http://localhost:3000",
1313
config.output = { filename: "express-bundle.js", // this file is served directly by webpack
1414
path: __dirname };
1515
config.module.loaders.push(
16-
{ test: /\.jsx$/, loaders: ["react-hot", "es6", "jsx?harmony"] },
16+
{ test: require.resolve("react"), loader: "expose?React" },
17+
{ test: /\.jsx$/, loaders: ["react-hot", "es6", "jsx?harmony"] }
1718
);
1819
config.plugins = [ new webpack.HotModuleReplacementPlugin() ];
1920
config.devtool = "eval-source-map";

webpack/webpack.rails.config.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ var devBuild = (typeof process.env["BUILDPACK_URL"]) === "undefined";
2121
if (devBuild) {
2222
console.log("Webpack dev build for Rails");
2323
config.module.loaders.push(
24+
{ test: require.resolve("react"), loader: "expose?React" },
2425
{ test: /\.jsx$/, loaders: ["react-hot", "es6", "jsx?harmony"] }
2526
);
2627
config.devtool = "eval-source-map";

0 commit comments

Comments
 (0)