forked from vmware-archive/clarity
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.dark-theme.config.js
62 lines (58 loc) · 1.74 KB
/
webpack.dark-theme.config.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
/*
* Copyright (c) 2016-2018 VMware, Inc. All Rights Reserved.
* This software is released under MIT license.
* The full license information can be found in LICENSE in the root directory of this project.
*/
const ExtractTextPlugin = require('extract-text-webpack-plugin');
const OptimizeCssAssetsPlugin = require('optimize-css-assets-webpack-plugin');
const path = require('path');
module.exports = {
entry: {
'clr-ui/clr-ui-dark': './src/clr-angular/dark-theme.scss',
'clr-ui/clr-ui-dark.min': './src/clr-angular/dark-theme.scss'
},
output: {
path: path.resolve(__dirname, 'dist'),
filename: '[name].css'
},
module: {
rules: [
{
include: [
path.join(process.cwd(), "src/clr-angular/dark-theme.scss")
],
test: /\.scss$/,
loaders: ExtractTextPlugin.extract({
use: [
{
loader: 'text-transform-loader',
options: {
transformText: function(content, loaderOptions) {
return content.replace(/@VERSION/g, require('./package.json').version);
}
}
},
"css-loader",
"sass-loader", // loaders to preprocess css
],
fallback: "style-loader"
})
}
]
},
plugins: [
new ExtractTextPlugin({ // define where to save the file
filename: '[name].css',
allChunks: true,
}),
new OptimizeCssAssetsPlugin({
assetNameRegExp: /\.min\.css$/,
cssProcessorOptions: {
autoprefixer: false,
safe: true,
mergeLonghand: false,
discardComments: {remove: (comment) => !(/Copyright|@preserve|@license|[@#]\s*source(?:Mapping)?URL|^!/i.test(comment))}
}
}),
],
};