Skip to content

Commit

Permalink
Use proper loaders for external module's CSS. (#157)
Browse files Browse the repository at this point in the history
- react-toolbox requires its own setup with sass-loader for now
- redux-notifications doen's need to use css-modules
- exclude `node_modules` from our own CSS pipeline

Realted to bcca98b
  • Loading branch information
okonet authored and cassiozen committed Nov 23, 2016
1 parent 16c32b0 commit fed0066
Showing 1 changed file with 19 additions and 7 deletions.
26 changes: 19 additions & 7 deletions webpack.base.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,25 +7,37 @@ module.exports = {
module: {
loaders: [
{
test: /\.(png|eot|woff|woff2|ttf|svg|gif)(\?v=\d+\.\d+\.\d+)?$/,
loader: 'url-loader?limit=10000',
loader: 'babel',
test: /\.js?$/,
exclude: /node_modules/,
},
{
test: /\.json$/,
loader: 'json-loader',
/* CSS loader for npm modules that are shipped with CSS.
List all of theme in the array
*/
test: /\.css$/,
include: [/redux-notifications/],
loader: ExtractTextPlugin.extract('style', 'css'),
},
{
/* React-toolbox still relies on SCSS and css-modules */
test: /\.scss$/,
include: [/react-toolbox/],
loader: ExtractTextPlugin.extract('style', 'css?modules!sass'),
},
{
/* We use CSS-modules and PostCSS for CMS styles */
test: /\.css$/,
exclude: /node_modules/,
loader: ExtractTextPlugin.extract('style', 'css?modules&importLoaders=1&&localIdentName=cms__[name]__[local]!postcss'),
},
{
loader: 'babel',
test: /\.js?$/,
exclude: /node_modules/,
test: /\.(png|eot|woff|woff2|ttf|svg|gif)(\?v=\d+\.\d+\.\d+)?$/,
loader: 'url-loader?limit=10000',
},
{
test: /\.json$/,
loader: 'json-loader',
},
],
},
Expand Down

0 comments on commit fed0066

Please sign in to comment.