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

Fix definePlugin usage in the webpack configs #39

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions webpack/client.dev.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,7 @@ module.exports = {
new webpack.HotModuleReplacementPlugin(),
new webpack.NoEmitOnErrorsPlugin(),
new webpack.DefinePlugin({
'process.env': {
NODE_ENV: JSON.stringify('development')
}
'process.env.NODE_ENV': JSON.stringify('development')
}),
new AutoDllPlugin({
context: path.join(__dirname, '..'),
Expand Down
8 changes: 2 additions & 6 deletions webpack/client.prod.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,7 @@ module.exports = {
}),

new webpack.DefinePlugin({
'process.env': {
NODE_ENV: JSON.stringify('production')
}
'process.env.NODE_ENV': JSON.stringify('production')
}),
new webpack.optimize.UglifyJsPlugin({
compress: {
Expand Down Expand Up @@ -92,9 +90,7 @@ module.exports = {
},
plugins: [
new webpack.DefinePlugin({
'process.env': {
NODE_ENV: JSON.stringify('production')
}
'process.env.NODE_ENV': JSON.stringify('production')
}),

new webpack.optimize.UglifyJsPlugin({
Expand Down
12 changes: 3 additions & 9 deletions webpack/server.dev.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,8 @@ const res = p => path.resolve(__dirname, p)
// within Webpack and can properly make connections to client modules:
const externals = fs
.readdirSync(res('../node_modules'))
.filter(
x =>
!/\.bin|react-universal-component|require-universal-module|webpack-flush-chunks/.test(
x
)
)
.filter(x =>
!/\.bin|react-universal-component|require-universal-module|webpack-flush-chunks/.test(x))
.reduce((externals, mod) => {
externals[mod] = `commonjs ${mod}`
return externals
Expand Down Expand Up @@ -63,9 +59,7 @@ module.exports = {
}),

new webpack.DefinePlugin({
'process.env': {
NODE_ENV: JSON.stringify('development')
}
'process.env.NODE_ENV': JSON.stringify('development')
})
]
}
12 changes: 3 additions & 9 deletions webpack/server.prod.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,8 @@ const res = p => path.resolve(__dirname, p)
// within Webpack and can properly make connections to client modules:
const externals = fs
.readdirSync(res('../node_modules'))
.filter(
x =>
!/\.bin|react-universal-component|require-universal-module|webpack-flush-chunks/.test(
x
)
)
.filter(x =>
!/\.bin|react-universal-component|require-universal-module|webpack-flush-chunks/.test(x))
.reduce((externals, mod) => {
externals[mod] = `commonjs ${mod}`
return externals
Expand Down Expand Up @@ -62,9 +58,7 @@ module.exports = {
}),

new webpack.DefinePlugin({
'process.env': {
NODE_ENV: JSON.stringify('production')
}
'process.env.NODE_ENV': JSON.stringify('production')
})
]
}