forked from facebook/create-react-app
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support for scss files in both dev & prod environments
- Loading branch information
1 parent
95bb5f8
commit ad0bad7
Showing
3 changed files
with
36 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,40 @@ | ||
'use strict'; | ||
|
||
const autoprefixer = require('autoprefixer'); | ||
|
||
const postCssOptions = { | ||
// Necessary for external CSS imports to work | ||
// https://github.com/facebookincubator/create-react-app/issues/2677 | ||
ident: 'postcss', | ||
plugins: () => [ | ||
require('postcss-flexbugs-fixes'), | ||
autoprefixer({ | ||
browsers: [ | ||
'>1%', | ||
'last 4 versions', | ||
'Firefox ESR', | ||
'not ie < 9', // React doesn't support IE8 anyway | ||
], | ||
flexbox: 'no-2009', | ||
}), | ||
], | ||
}; | ||
|
||
module.exports = { | ||
babelPresets: [require.resolve('babel-preset-stage-0')], | ||
babelPlugins: [require.resolve('babel-plugin-transform-decorators-legacy')], | ||
webpackLoaders: [ | ||
{ | ||
test: /\.scss$/, | ||
loaders: [ | ||
require.resolve('style-loader'), | ||
require.resolve('css-loader'), | ||
{ | ||
loader: require.resolve('postcss-loader'), | ||
options: postCssOptions, | ||
}, | ||
require.resolve('sass-loader'), | ||
], | ||
}, | ||
], | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters