@@ -8,20 +8,25 @@ const BABEL_LOADER = 'babel-loader?' + JSON.stringify(babelrc);
88const CSS_LOADER = 'css-loader?modules&importLoaders=2&sourceMap&localIdentName=[local]___[hash:base64:5]' ;
99const SASS_LOADER = 'sass-loader?sourceMap' ;
1010const LESS_LOADER = 'less-loader?sourceMap' ;
11- const STYLE_LOADERS = [ 'style-loader' , CSS_LOADER , 'postcss-loader' ] ;
12-
13- export const extensions = [ '' , '.web.js' , '.js' ] ;
11+ const STYLE_LOADERS = [
12+ 'style-loader' ,
13+ CSS_LOADER ,
14+ {
15+ loader : 'postcss-loader' ,
16+ options : {
17+ plugins ( ) {
18+ return [ autoprefixer ] ;
19+ } ,
20+ } ,
21+ }
22+ ] ;
1423
1524export default ( options ) => ( {
1625 context : options . context ,
1726 entry : options . entry ,
1827 output : options . output ,
1928 devtool : options . devtool ,
2029
21- postcss ( ) {
22- return [ autoprefixer ] ;
23- } ,
24-
2530 plugins : [
2631 new webpack . NoErrorsPlugin ( ) ,
2732 new webpack . DefinePlugin ( {
@@ -44,7 +49,7 @@ export default (options) => ({
4449 . concat ( options . plugins || [ ] ) ,
4550
4651 module : {
47- loaders : [
52+ rules : [
4853 {
4954 test : / \. j s $ / ,
5055 exclude : / n o d e _ m o d u l e s / ,
@@ -56,21 +61,21 @@ export default (options) => ({
5661 } ,
5762 {
5863 test : / \. c s s $ / ,
59- loaders : STYLE_LOADERS ,
64+ use : STYLE_LOADERS ,
6065 } ,
6166 {
6267 test : / \. l e s s $ / ,
63- loaders : [ ...STYLE_LOADERS , LESS_LOADER ] ,
68+ use : [ ...STYLE_LOADERS , LESS_LOADER ] ,
6469 } ,
6570 {
6671 test : / \. s c s s $ / ,
67- loaders : [ ...STYLE_LOADERS , SASS_LOADER ] ,
72+ use : [ ...STYLE_LOADERS , SASS_LOADER ] ,
6873 } ,
6974 {
7075 test : / \. ( g i f | j p g | p n g | w e b p | s v g ) $ / ,
7176 loader : 'url?limit=25000' ,
7277 } ,
73- ]
78+ ] ,
7479 } ,
7580
7681 resolveLoader : {
@@ -81,7 +86,6 @@ export default (options) => ({
8186 } ,
8287
8388 resolve : {
84- extensions,
8589 modules : [
8690 path . join ( CURRENTDIR , 'node_modules' ) ,
8791 path . resolve ( options . context , 'node_modules' ) ,
0 commit comments