Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use proper loaders for external module's CSS #157

Merged
merged 1 commit into from
Nov 23, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Use proper loaders for external module's CSS.
- 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 committed Nov 14, 2016
commit 9d4950f0a124d77991053e269b681f7b6b6f327b
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