@@ -6,11 +6,11 @@ const WebpackShellPluginNext = require('webpack-shell-plugin-next')
66// @endif
77
88// @if !css-module
9- const cssLoader = " css-loader" ;
9+ const cssLoader = ' css-loader' ;
1010// @endif
1111// @if css-module
1212const cssLoader = {
13- loader : " css-loader" ,
13+ loader : ' css-loader' ,
1414 options : {
1515 modules : true ,
1616 // https://github.com/webpack-contrib/css-loader#importloaders
@@ -68,30 +68,98 @@ module.exports = function(env, { /* @if jasmine || tape || mocha*/runTest, /* @e
6868 } ,
6969 module : {
7070 rules : [
71+ { test : / \. ( p n g | g i f | j p g | c u r ) $ / i, loader : 'url-loader' , options : { limit : 8192 } } ,
72+ { test : / \. w o f f 2 ( \? v = [ 0 - 9 ] \. [ 0 - 9 ] \. [ 0 - 9 ] ) ? $ / i, loader : 'url-loader' , options : { limit : 10000 , mimetype : 'application/font-woff2' } } ,
73+ { test : / \. w o f f ( \? v = [ 0 - 9 ] \. [ 0 - 9 ] \. [ 0 - 9 ] ) ? $ / i, loader : 'url-loader' , options : { limit : 10000 , mimetype : 'application/font-woff' } } ,
74+ { test : / \. ( t t f | e o t | s v g | o t f ) ( \? v = [ 0 - 9 ] \. [ 0 - 9 ] \. [ 0 - 9 ] ) ? $ / i, loader : 'file-loader' } ,
75+
7176 // @if !shadow-dom
72- { test : / \. / * @if css * / c s s / * @endif * //* @if less */less/* @endif *//* @if sass */scss/* @endif */$/i, use: [ 'style-loader', cssLoader, postcssLoader/* @if less */, 'less-loader'/* @endif *//* @if sass */, sassLoader/* @endif */ ] },
77+ { test : / \. c s s $ / i, use : [ 'style-loader' , cssLoader , postcssLoader ] } ,
78+ // @if less
79+ { test : / \. l e s s $ / i, use : [ 'style-loader' , cssLoader , postcssLoader , 'less-loader' ] } ,
80+ // @endif
81+ // @if sass
82+ { test : / \. s c s s $ / i, use : [ 'style-loader' , cssLoader , postcssLoader , sassLoader ] } ,
83+ // @endif
7384 // @endif
85+
7486 // @if shadow-dom
7587 {
76- test : / \. / * @if css * / c s s / * @endif * //* @if less */less/* @endif *//* @if sass */scss/* @endif */$/i,
88+ test : / \. c s s $ / i,
89+ // For style loaded in src/main.js, it's not loaded by style-loader.
90+ // It's for shared styles for shadow-dom only.
91+ issuer : / \/ s r c \/ m a i n \. ( j s | t s ) $ / ,
92+ use : [ 'to-string-loader' , cssLoader , postcssLoader ]
93+ } ,
94+ // @if less
95+ {
96+ test : / \. l e s s $ / i,
97+ // For style loaded in src/main.js, it's not loaded by style-loader.
98+ // It's for shared styles for shadow-dom only.
99+ issuer : / \/ s r c \/ m a i n \. ( j s | t s ) $ / ,
100+ use : [ 'to-string-loader' , cssLoader , postcssLoader , 'less-loader' ]
101+ } ,
102+ // @endif
103+ // @if sass
104+ {
105+ test : / \. s c s s $ / i,
77106 // For style loaded in src/main.js, it's not loaded by style-loader.
78107 // It's for shared styles for shadow-dom only.
79108 issuer : / \/ s r c \/ m a i n \. ( j s | t s ) $ / ,
80- use : [ 'to-string-loader' , cssLoader , postcssLoader /* @if less */ , 'less-loader' /* @endif */ /* @if sass */ , sassLoader /* @endif */ ]
109+ use : [ 'to-string-loader' , cssLoader , postcssLoader , sassLoader ]
81110 } ,
111+ // @endif
112+
82113 {
83- test : / \. / * @ if css * / c s s / * @ endif * //* @if less */less/* @endif *//* @if sass */scss/* @endif */ $/i,
114+ test : / \. c s s $ / i,
84115 // For style loaded in other js/ts files, it's loaded by style-loader.
85116 // They are directly injected to HTML head.
86117 issuer : / (?< ! \/ s r c \/ m a i n ) \. ( j s | t s ) $ / ,
87- use : [ 'style-loader' , cssLoader , postcssLoader /* @if less */ , 'less-loader' /* @endif */ /* @if sass */ , sassLoader /* @endif */ ]
118+ use : [ 'style-loader' , cssLoader , postcssLoader ]
88119 } ,
120+ // @if less
89121 {
90- test : / \. / * @if css * / c s s / * @endif * //* @if less */less/* @endif *//* @if sass */scss/* @endif */$/i,
122+ test : / \. l e s s $ / i,
123+ // For style loaded in other js/ts files, it's loaded by style-loader.
124+ // They are directly injected to HTML head.
125+ issuer : / (?< ! \/ s r c \/ m a i n ) \. ( j s | t s ) $ / ,
126+ use : [ 'style-loader' , cssLoader , postcssLoader , 'less-loader' ]
127+ } ,
128+ // @endif
129+ // @if sass
130+ {
131+ test : / \. s c s s $ / i,
132+ // For style loaded in other js/ts files, it's loaded by style-loader.
133+ // They are directly injected to HTML head.
134+ issuer : / (?< ! \/ s r c \/ m a i n ) \. ( j s | t s ) $ / ,
135+ use : [ 'style-loader' , cssLoader , postcssLoader , sassLoader ]
136+ } ,
137+ // @endif
138+
139+ {
140+ test : / \. c s s $ / i,
141+ // For style loaded in html files, Aurelia will handle it.
91142 issuer : / \. h t m l $ / ,
92- use : [ 'to-string-loader' , cssLoader , postcssLoader /* @if less */ , 'less-loader' /* @endif */ /* @if sass */ , sassLoader /* @endif */ ]
143+ use : [ 'to-string-loader' , cssLoader , postcssLoader ]
144+ } ,
145+ // @if less
146+ {
147+ test : / \. l e s s $ / i,
148+ // For style loaded in html files, Aurelia will handle it.
149+ issuer : / \. h t m l $ / ,
150+ use : [ 'to-string-loader' , cssLoader , postcssLoader , 'less-loader' ]
93151 } ,
94152 // @endif
153+ // @if sass
154+ {
155+ test : / \. s c s s $ / i,
156+ // For style loaded in html files, Aurelia will handle it.
157+ issuer : / \. h t m l $ / ,
158+ use : [ 'to-string-loader' , cssLoader , postcssLoader , sassLoader ]
159+ } ,
160+ // @endif
161+ // @endif
162+
95163 // @if babel
96164 { test : / \. j s $ / i, use : [ 'babel-loader' , '@aurelia/webpack-loader' ] , exclude : / n o d e _ m o d u l e s / } ,
97165 // @endif
0 commit comments