File tree Expand file tree Collapse file tree 3 files changed +94
-1
lines changed Expand file tree Collapse file tree 3 files changed +94
-1
lines changed Original file line number Diff line number Diff line change @@ -220,6 +220,44 @@ module.exports = {
220220 } ,
221221 ] ,
222222 } ,
223+ {
224+ test : / \. s c s s $ / ,
225+ use : [
226+ require . resolve ( 'style-loader' ) ,
227+ {
228+ loader : require . resolve ( 'css-loader' ) ,
229+ options : {
230+ importLoaders : 1 ,
231+ } ,
232+ } ,
233+ {
234+ loader : require . resolve ( 'postcss-loader' ) ,
235+ options : {
236+ // Necessary for external CSS imports to work
237+ // https://github.com/facebookincubator/create-react-app/issues/2677
238+ ident : 'postcss' ,
239+ plugins : ( ) => [
240+ require ( 'postcss-flexbugs-fixes' ) ,
241+ autoprefixer ( {
242+ browsers : [
243+ '>1%' ,
244+ 'last 4 versions' ,
245+ 'Firefox ESR' ,
246+ 'not ie < 9' , // React doesn't support IE8 anyway
247+ ] ,
248+ flexbox : 'no-2009' ,
249+ } ) ,
250+ ] ,
251+ } ,
252+ } ,
253+ {
254+ loader : require . resolve ( 'sass-loader' ) ,
255+ options : {
256+ importLoaders : 1 ,
257+ } ,
258+ } ,
259+ ] ,
260+ } ,
223261 // "file" loader makes sure those assets get served by WebpackDevServer.
224262 // When you `import` an asset, you get its (virtual) filename.
225263 // In production, they would get copied to the `build` folder.
Original file line number Diff line number Diff line change @@ -247,6 +247,59 @@ module.exports = {
247247 ) ,
248248 // Note: this won't work without `new ExtractTextPlugin()` in `plugins`.
249249 } ,
250+ {
251+ test : / \. s c s s $ / ,
252+ loader : ExtractTextPlugin . extract (
253+ Object . assign (
254+ {
255+ fallback : {
256+ loader : require . resolve ( 'style-loader' ) ,
257+ options : {
258+ hmr : false ,
259+ } ,
260+ } ,
261+ use : [
262+ {
263+ loader : require . resolve ( 'css-loader' ) ,
264+ options : {
265+ importLoaders : 1 ,
266+ minimize : true ,
267+ sourceMap : shouldUseSourceMap ,
268+ } ,
269+ } ,
270+ {
271+ loader : require . resolve ( 'postcss-loader' ) ,
272+ options : {
273+ // Necessary for external CSS imports to work
274+ // https://github.com/facebookincubator/create-react-app/issues/2677
275+ ident : 'postcss' ,
276+ plugins : ( ) => [
277+ require ( 'postcss-flexbugs-fixes' ) ,
278+ autoprefixer ( {
279+ browsers : [
280+ '>1%' ,
281+ 'last 4 versions' ,
282+ 'Firefox ESR' ,
283+ 'not ie < 9' , // React doesn't support IE8 anyway
284+ ] ,
285+ flexbox : 'no-2009' ,
286+ } ) ,
287+ ] ,
288+ } ,
289+ } ,
290+ {
291+ loader : require . resolve ( 'sass-loader' ) ,
292+ options : {
293+ importLoaders : 1 ,
294+ } ,
295+ } ,
296+ ] ,
297+ } ,
298+ extractTextPluginOptions
299+ )
300+ ) ,
301+ // Note: this won't work without `new ExtractTextPlugin()` in `plugins`.
302+ } ,
250303 // "file" loader makes sure assets end up in the `build` folder.
251304 // When you `import` an asset, you get its filename.
252305 // This loader doesn't use a "test" so it will catch all modules
Original file line number Diff line number Diff line change 3636 "fs-extra" : " 3.0.1" ,
3737 "html-webpack-plugin" : " 2.29.0" ,
3838 "jest" : " 22.4.2" ,
39+ "node-sass-chokidar" : " ^1.3.3" ,
3940 "object-assign" : " 4.1.1" ,
4041 "postcss-flexbugs-fixes" : " 3.2.0" ,
4142 "postcss-loader" : " 2.0.8" ,
4243 "promise" : " 8.0.1" ,
4344 "raf" : " 3.4.0" ,
44- "source-map-loader" : " ^0.2.1" ,
4545 "react-dev-utils" : " ^5.0.1" ,
4646 "resolve" : " 1.6.0" ,
47+ "sass-loader" : " ^7.1.0" ,
48+ "source-map-loader" : " ^0.2.1" ,
4749 "style-loader" : " 0.19.0" ,
4850 "sw-precache-webpack-plugin" : " 0.11.4" ,
4951 "ts-jest" : " 22.0.1" ,
You can’t perform that action at this time.
0 commit comments