Skip to content

Commit

Permalink
build(dev): adding flexible bundler for dev environtment & global var…
Browse files Browse the repository at this point in the history
…iable for clientside
  • Loading branch information
tagraha committed Mar 19, 2018
1 parent 0530d42 commit 8221d59
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ const browserConfig = {
use: [
{
loader: "css-loader",
options: { importLoaders: 1, minimize: true }
options: { importLoaders: 1, minimize: !isDev }
},
{
loader: "postcss-loader",
Expand All @@ -51,6 +51,12 @@ const browserConfig = {
new ExtractTextPlugin({
filename: "css/[name].css"
}),
// Setup global variables for client
new webpack.DefinePlugin({
__CLIENT__: true,
__SERVER__: false,
__DEV__: isDev
}),
new SWPrecacheWebpackPlugin(
{
minify: true,
Expand All @@ -63,7 +69,7 @@ const browserConfig = {
),
],
optimization: {
minimize: true,
minimize: !isDev,

splitChunks: {
cacheGroups: {
Expand Down Expand Up @@ -115,7 +121,7 @@ const serverConfig = {
]
},
optimization: {
minimize: true
minimize: !isDev
}
};

Expand Down

0 comments on commit 8221d59

Please sign in to comment.