Skip to content

Commit

Permalink
Supprt legacy webpack config option name (#782)
Browse files Browse the repository at this point in the history
  • Loading branch information
doug-wade committed Jan 9, 2017
1 parent aabcbd8 commit 1be5933
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions packages/react-server-cli/src/compileClient.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,18 @@ export default (opts = {}) => {
stats = false,
longTermCaching = false,
} = opts;

// support legacy webpack configuration name
const webpackConfiguration = webpackConfig || opts['webpack-config'];
if (longTermCaching && hot) {
// chunk hashes can't be used in hot mode, so we can't use long-term caching
// and hot mode at the same time.
throw new Error("Hot reload cannot be used with long-term caching. Please disable either long-term caching or hot reload.");
}

var webpackConfigFunc = (data) => { return data }
if (webpackConfig) {
const webpackDirAbsolute = path.resolve(process.cwd(), webpackConfig);
if (webpackConfiguration) {
const webpackDirAbsolute = path.resolve(process.cwd(), webpackConfiguration);
const userWebpackConfigFunc = require(webpackDirAbsolute)
webpackConfigFunc = userWebpackConfigFunc.default
}
Expand Down

0 comments on commit 1be5933

Please sign in to comment.