File tree Expand file tree Collapse file tree 6 files changed +74
-1
lines changed Expand file tree Collapse file tree 6 files changed +74
-1
lines changed Original file line number Diff line number Diff line change
1
+ /tests /dist /
1
2
node_modules
2
3
jsconfig.json
Original file line number Diff line number Diff line change 23
23
" duplicate" ,
24
24
" extract-text-webpack-plugin"
25
25
],
26
- "license" : " MIT"
26
+ "license" : " MIT" ,
27
+ "devDependencies" : {
28
+ "css-loader" : " ^0.23.1" ,
29
+ "extract-text-webpack-plugin" : " ^1.0.1" ,
30
+ "file-loader" : " ^0.9.0" ,
31
+ "webpack" : " ^1.13.2"
32
+ },
33
+ "scripts" : {
34
+ "test" : " NODE_ENV=production webpack -p --progress --profile --colors --config ./tests/webpack.config.js"
35
+ }
27
36
}
Original file line number Diff line number Diff line change
1
+ .body {
2
+ background : url ('./app.png' ) top left no-repeat;
3
+ }
4
+
5
+ .body {
6
+ color : black;
7
+ }
8
+
9
+ .body {
10
+ padding : 0 ;
11
+ }
Original file line number Diff line number Diff line change
1
+ require ( './app.css' ) ;
2
+
3
+ console . log ( 'Hello!' ) ;
Original file line number Diff line number Diff line change
1
+ var projectPath = __dirname ;
2
+ var buildPath = projectPath + '/dist' ;
3
+
4
+ var Webpack = require ( 'webpack' ) ;
5
+ var ExtractTextPlugin = require ( 'extract-text-webpack-plugin' ) ;
6
+ var OptimizeCssAssetsPlugin = require ( '../index.js' ) ;
7
+
8
+ var globalVarPlugin = new Webpack . DefinePlugin ( {
9
+ 'process.env' : {
10
+ 'NODE_ENV' : JSON . stringify ( process . env . NODE_ENV ) ,
11
+ } ,
12
+ } ) ;
13
+
14
+ var entry = {
15
+ app : './app.js' ,
16
+ } ;
17
+
18
+ var plugins = [
19
+ globalVarPlugin ,
20
+ new Webpack . optimize . CommonsChunkPlugin ( 'library' , 'library.js' ) ,
21
+ new Webpack . optimize . UglifyJsPlugin ( {
22
+ compress : {
23
+ warnings : false
24
+ }
25
+ } ) ,
26
+ new ExtractTextPlugin ( '[name].css' , { allChunks : true } ) ,
27
+ new OptimizeCssAssetsPlugin ( {
28
+ cssProcessorOptions : { discardComments : { removeAll : true } , zindex : false } ,
29
+ } )
30
+ ] ;
31
+
32
+ module . exports = {
33
+ context : projectPath + '/' ,
34
+ entry : entry ,
35
+ output : {
36
+ filename : 'app.js' ,
37
+ path : buildPath ,
38
+ } ,
39
+ module : {
40
+ loaders : [ {
41
+ test : / \. c s s $ / ,
42
+ loader : ExtractTextPlugin . extract ( 'css-loader?&discardDuplicates&discardComments' ) ,
43
+ } , {
44
+ test : / \. p n g $ / ,
45
+ loader : 'file-loader'
46
+ } ]
47
+ } ,
48
+ plugins : plugins ,
49
+ } ;
You can’t perform that action at this time.
0 commit comments