-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Minimize css assets in production (#225)
- Loading branch information
1 parent
36f1300
commit 9d4cb99
Showing
1 changed file
with
6 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,14 @@ | ||
const ExtractTextPlugin = require('extract-text-webpack-plugin') | ||
const { env } = require('../configuration.js') | ||
|
||
module.exports = { | ||
test: /\.(scss|sass|css)$/i, | ||
use: ExtractTextPlugin.extract({ | ||
fallback: 'style-loader', | ||
use: ['css-loader', 'postcss-loader', 'sass-loader'] | ||
use: [ | ||
{ loader: 'css-loader', options: { minimize: env.NODE_ENV === 'production' } }, | ||
'postcss-loader', | ||
'sass-loader' | ||
] | ||
}) | ||
} |