diff --git a/templates/Angular2Spa/webpack.config.js b/templates/Angular2Spa/webpack.config.js index 3cfc02ca..8c1969d3 100644 --- a/templates/Angular2Spa/webpack.config.js +++ b/templates/Angular2Spa/webpack.config.js @@ -18,7 +18,7 @@ module.exports = (env) => { rules: [ { test: /\.ts$/, include: /ClientApp/, use: ['awesome-typescript-loader?silent=true', 'angular2-template-loader'] }, { test: /\.html$/, use: 'html-loader?minimize=false' }, - { test: /\.css$/, use: ['to-string-loader', 'css-loader'] }, + { test: /\.css$/, use: [ 'to-string-loader', isDevBuild ? 'css-loader' : 'css-loader?minimize' ] }, { test: /\.(png|jpg|jpeg|gif|svg)$/, use: 'url-loader?limit=25000' } ] }, diff --git a/templates/Angular2Spa/webpack.config.vendor.js b/templates/Angular2Spa/webpack.config.vendor.js index 3b507ead..df1cfa85 100644 --- a/templates/Angular2Spa/webpack.config.vendor.js +++ b/templates/Angular2Spa/webpack.config.vendor.js @@ -51,7 +51,7 @@ module.exports = (env) => { output: { path: path.join(__dirname, 'wwwroot', 'dist') }, module: { rules: [ - { test: /\.css(\?|$)/, use: extractCSS.extract({ use: 'css-loader' }) } + { test: /\.css(\?|$)/, use: extractCSS.extract({ use: isDevBuild ? 'css-loader' : 'css-loader?minimize' }) } ] }, plugins: [ @@ -73,7 +73,7 @@ module.exports = (env) => { libraryTarget: 'commonjs2', }, module: { - rules: [ { test: /\.css(\?|$)/, use: ['to-string-loader', 'css-loader'] } ] + rules: [ { test: /\.css(\?|$)/, use: ['to-string-loader', isDevBuild ? 'css-loader' : 'css-loader?minimize' ] } ] }, entry: { vendor: ['aspnet-prerendering'] }, plugins: [ diff --git a/templates/AureliaSpa/webpack.config.js b/templates/AureliaSpa/webpack.config.js index a971f0c3..e529b58d 100644 --- a/templates/AureliaSpa/webpack.config.js +++ b/templates/AureliaSpa/webpack.config.js @@ -16,7 +16,7 @@ module.exports = { loaders: [ { test: /\.ts$/, include: /ClientApp/, loader: 'ts-loader', query: { silent: true } }, { test: /\.html$/, loader: 'html-loader' }, - { test: /\.css$/, loaders: [ 'style-loader', 'css-loader' ] }, + { test: /\.css$/, loaders: [ 'style-loader', isDevBuild ? 'css-loader' : 'css-loader?minimize' ] }, { test: /\.(png|woff|woff2|eot|ttf|svg)$/, loader: 'url-loader?limit=100000' }, { test: /\.json$/, loader: 'json-loader' } ] diff --git a/templates/AureliaSpa/webpack.config.vendor.js b/templates/AureliaSpa/webpack.config.vendor.js index da293bb6..dbde7047 100644 --- a/templates/AureliaSpa/webpack.config.vendor.js +++ b/templates/AureliaSpa/webpack.config.vendor.js @@ -11,7 +11,7 @@ module.exports = { module: { loaders: [ { test: /\.(png|woff|woff2|eot|ttf|svg)(\?|$)/, loader: 'url-loader?limit=100000' }, - { test: /\.css(\?|$)/, loader: extractCSS.extract(['css-loader']) } + { test: /\.css(\?|$)/, loader: extractCSS.extract([ isDevBuild ? 'css-loader' : 'css-loader?minimize' ]) } ] }, entry: { diff --git a/templates/KnockoutSpa/webpack.config.js b/templates/KnockoutSpa/webpack.config.js index 6d98babd..9be0b9ee 100644 --- a/templates/KnockoutSpa/webpack.config.js +++ b/templates/KnockoutSpa/webpack.config.js @@ -19,7 +19,7 @@ module.exports = (env) => { rules: [ { test: /\.ts$/, include: /ClientApp/, use: 'awesome-typescript-loader?silent=true' }, { test: /\.html$/, use: 'raw-loader' }, - { test: /\.css$/, use: isDevBuild ? ['style-loader', 'css-loader'] : ExtractTextPlugin.extract({ use: 'css-loader' }) }, + { test: /\.css$/, use: isDevBuild ? [ 'style-loader', 'css-loader' ] : ExtractTextPlugin.extract({ use: 'css-loader?minimize' }) }, { test: /\.(png|jpg|jpeg|gif|svg)$/, use: 'url-loader?limit=25000' } ] }, diff --git a/templates/KnockoutSpa/webpack.config.vendor.js b/templates/KnockoutSpa/webpack.config.vendor.js index 5ada91f4..f53c6bac 100644 --- a/templates/KnockoutSpa/webpack.config.vendor.js +++ b/templates/KnockoutSpa/webpack.config.vendor.js @@ -13,7 +13,7 @@ module.exports = (env) => { module: { rules: [ { test: /\.(png|woff|woff2|eot|ttf|svg)(\?|$)/, use: 'url-loader?limit=100000' }, - { test: /\.css(\?|$)/, use: extractCSS.extract({ use: 'css-loader' }) } + { test: /\.css(\?|$)/, use: extractCSS.extract({ use: isDevBuild ? 'css-loader' : 'css-loader?minimize' }) } ] }, entry: { diff --git a/templates/ReactReduxSpa/webpack.config.js b/templates/ReactReduxSpa/webpack.config.js index ce9ece32..98ebbc23 100644 --- a/templates/ReactReduxSpa/webpack.config.js +++ b/templates/ReactReduxSpa/webpack.config.js @@ -30,7 +30,7 @@ module.exports = (env) => { entry: { 'main-client': './ClientApp/boot-client.tsx' }, module: { rules: [ - { test: /\.css$/, use: ExtractTextPlugin.extract({ use: 'css-loader' }) }, + { test: /\.css$/, use: ExtractTextPlugin.extract({ use: isDevBuild ? 'css-loader' : 'css-loader?minimize' }) }, { test: /\.(png|jpg|jpeg|gif|svg)$/, use: 'url-loader?limit=25000' } ] }, diff --git a/templates/ReactReduxSpa/webpack.config.vendor.js b/templates/ReactReduxSpa/webpack.config.vendor.js index 9041e4f2..bd180821 100644 --- a/templates/ReactReduxSpa/webpack.config.vendor.js +++ b/templates/ReactReduxSpa/webpack.config.vendor.js @@ -49,7 +49,7 @@ module.exports = (env) => { output: { path: path.join(__dirname, 'wwwroot', 'dist') }, module: { rules: [ - { test: /\.css(\?|$)/, use: extractCSS.extract({ use: 'css-loader' }) } + { test: /\.css(\?|$)/, use: extractCSS.extract({ use: isDevBuild ? 'css-loader' : 'css-loader?minimize' }) } ] }, plugins: [ @@ -71,7 +71,7 @@ module.exports = (env) => { libraryTarget: 'commonjs2', }, module: { - rules: [ { test: /\.css(\?|$)/, use: 'css-loader' } ] + rules: [ { test: /\.css(\?|$)/, use: isDevBuild ? 'css-loader' : 'css-loader?minimize' } ] }, entry: { vendor: ['aspnet-prerendering', 'react-dom/server'] }, plugins: [ diff --git a/templates/ReactSpa/webpack.config.js b/templates/ReactSpa/webpack.config.js index fa76d107..a54d5cee 100644 --- a/templates/ReactSpa/webpack.config.js +++ b/templates/ReactSpa/webpack.config.js @@ -19,7 +19,7 @@ module.exports = (env) => { rules: [ { test: /\.ts(x?)$/, include: /ClientApp/, use: { loader: 'babel-loader', options: { cacheDirectory: true } } }, { test: /\.tsx?$/, include: /ClientApp/, use: 'awesome-typescript-loader?silent=true' }, - { test: /\.css$/, use: isDevBuild ? ['style-loader', 'css-loader'] : ExtractTextPlugin.extract({ use: 'css-loader' }) }, + { test: /\.css$/, use: isDevBuild ? ['style-loader', 'css-loader'] : ExtractTextPlugin.extract({ use: 'css-loader?minimize' }) }, { test: /\.(png|jpg|jpeg|gif|svg)$/, use: 'url-loader?limit=25000' } ] }, diff --git a/templates/ReactSpa/webpack.config.vendor.js b/templates/ReactSpa/webpack.config.vendor.js index 7ac7a7fd..c8eacdb4 100644 --- a/templates/ReactSpa/webpack.config.vendor.js +++ b/templates/ReactSpa/webpack.config.vendor.js @@ -13,7 +13,7 @@ module.exports = (env) => { module: { rules: [ { test: /\.(png|woff|woff2|eot|ttf|svg)(\?|$)/, use: 'url-loader?limit=100000' }, - { test: /\.css(\?|$)/, use: extractCSS.extract(['css-loader']) } + { test: /\.css(\?|$)/, use: extractCSS.extract([ isDevBuild ? 'css-loader' : 'css-loader?minimize' ]) } ] }, entry: { diff --git a/templates/VueSpa/webpack.config.js b/templates/VueSpa/webpack.config.js index c967f0a4..6bfda964 100644 --- a/templates/VueSpa/webpack.config.js +++ b/templates/VueSpa/webpack.config.js @@ -17,7 +17,7 @@ module.exports = (env) => { rules: [ { test: /\.vue\.html$/, include: /ClientApp/, loader: 'vue-loader', options: { loaders: { js: 'awesome-typescript-loader?silent=true' } } }, { test: /\.ts$/, include: /ClientApp/, use: 'awesome-typescript-loader?silent=true' }, - { test: /\.css$/, use: isDevBuild ? ['style-loader', 'css-loader'] : ExtractTextPlugin.extract({ use: 'css-loader' }) }, + { test: /\.css$/, use: isDevBuild ? [ 'style-loader', 'css-loader' ] : ExtractTextPlugin.extract({ use: 'css-loader?minimize' }) }, { test: /\.(png|jpg|jpeg|gif|svg)$/, use: 'url-loader?limit=25000' } ] }, diff --git a/templates/VueSpa/webpack.config.vendor.js b/templates/VueSpa/webpack.config.vendor.js index da8d7277..2cd2af60 100644 --- a/templates/VueSpa/webpack.config.vendor.js +++ b/templates/VueSpa/webpack.config.vendor.js @@ -22,7 +22,7 @@ module.exports = (env) => { }, module: { rules: [ - { test: /\.css(\?|$)/, use: extractCSS.extract({ use: 'css-loader' }) }, + { test: /\.css(\?|$)/, use: extractCSS.extract({ use: isDevBuild ? 'css-loader' : 'css-loader?minimize' }) }, { test: /\.(png|woff|woff2|eot|ttf|svg)(\?|$)/, use: 'url-loader?limit=100000' } ] }, diff --git a/templates/WebApplicationBasic/webpack.config.js b/templates/WebApplicationBasic/webpack.config.js index 712ab407..80ff4616 100644 --- a/templates/WebApplicationBasic/webpack.config.js +++ b/templates/WebApplicationBasic/webpack.config.js @@ -14,7 +14,7 @@ module.exports = merge({ module: { loaders: [ { test: /\.ts(x?)$/, include: /ClientApp/, loader: 'ts-loader?silent=true' }, - { test: /\.css/, loader: extractCSS.extract(['css-loader']) } + { test: /\.css/, loader: extractCSS.extract([ isDevelopment ? 'css-loader' : 'css-loader?minimize' ]) } ] }, entry: { diff --git a/templates/WebApplicationBasic/webpack.config.vendor.js b/templates/WebApplicationBasic/webpack.config.vendor.js index 546fd233..2efe99e8 100644 --- a/templates/WebApplicationBasic/webpack.config.vendor.js +++ b/templates/WebApplicationBasic/webpack.config.vendor.js @@ -11,7 +11,7 @@ module.exports = { module: { loaders: [ { test: /\.(png|woff|woff2|eot|ttf|svg)$/, loader: 'url-loader?limit=100000' }, - { test: /\.css/, loader: extractCSS.extract(['css-loader']) } + { test: /\.css/, loader: extractCSS.extract([ isDevelopment ? 'css-loader' : 'css-loader?minimize' ]) } ] }, entry: {