Skip to content

Commit

Permalink
Merge pull request #129 from michaelknoch/introduce-sass
Browse files Browse the repository at this point in the history
Introduce sass
  • Loading branch information
alicoding authored Aug 30, 2016
2 parents 8846f15 + cd8d357 commit 4c3a983
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 4 deletions.
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,10 @@
"homepage": "https://github.com/alicoding/react-webpack-babel#readme",
"dependencies": {
"bootstrap": "^4.0.0-alpha.3",
"node-sass": "^3.8.0",
"react": "15.3.0",
"react-dom": "15.3.0"
"react-dom": "15.3.0",
"sass-loader": "^4.0.0"
},
"devDependencies": {
"babel-core": "6.13.2",
Expand Down
2 changes: 1 addition & 1 deletion src/index.jsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import 'bootstrap/dist/css/bootstrap.min.css';
import styles from './index.css';
import styles from './index.scss';
import React from 'react';
import { render } from 'react-dom';

Expand Down
File renamed without changes.
12 changes: 11 additions & 1 deletion webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,19 @@ loaders.push({
'css'
]
});
// local scss modules
loaders.push({
test: /[\/\\]src[\/\\].*\.scss/,
loaders: [
'style?sourceMap',
'css?modules&importLoaders=1&localIdentName=[path]___[name]__[local]___[hash:base64:5]',
'sass'
]
});

// local css modules
loaders.push({
test: /[\/\\]src[\/\\].*\.css$/,
test: /[\/\\]src[\/\\].*\.css/,
loaders: [
'style?sourceMap',
'css?modules&importLoaders=1&localIdentName=[path]___[name]__[local]___[hash:base64:5]'
Expand Down
8 changes: 7 additions & 1 deletion webpack.production.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,15 @@ var WebpackCleanupPlugin = require('webpack-cleanup-plugin');

// local css modules
loaders.push({
test: /[\/\\]src[\/\\].*\.css$/,
test: /[\/\\]src[\/\\].*\.css/,
loader: ExtractTextPlugin.extract('style', 'css?modules&importLoaders=1&localIdentName=[name]__[local]___[hash:base64:5]')
});

// local scss modules
loaders.push({
test: /[\/\\]src[\/\\].*\.scss/,
loader: ExtractTextPlugin.extract('style', 'css?modules&importLoaders=1&localIdentName=[name]__[local]___[hash:base64:5]', 'sass')
});
// global css files
loaders.push({
test: /[\/\\](node_modules|global)[\/\\].*\.css$/,
Expand Down

0 comments on commit 4c3a983

Please sign in to comment.