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

sass-integration #109

Closed
wants to merge 5 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
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
5 changes: 4 additions & 1 deletion .npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,10 @@ build/Release

# Dependency directory
# https://www.npmjs.org/doc/misc/npm-faq.html#should-i-check-my-node_modules-folder-into-git
node_modules
node_modules/
examples/biz-website/public/
examples/blog/public/
*.un~

# IDEA/WebStorm configuration directory
.idea/
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't this be added to the .gitignore?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure, I usually don't include it as not to pollute the project with unnecessary IDE configuration files

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the npm ignore file not .gitignore.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ohh good catch, I feel silly, let me quickly fix it.

15 changes: 13 additions & 2 deletions lib/utils/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ module.exports = (program, directory, stage, webpackPort = 1500, routes = []) =>

function resolve () {
return {
extensions: ['', '.js', '.jsx', '.cjsx', '.coffee', '.json', '.less', '.toml', '.yaml'],
extensions: ['', '.js', '.jsx', '.cjsx', '.coffee', '.json', '.less', '.scss', '.toml', '.yaml'],
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't sass be added here too?

modulesDirectories: [
directory,
`${__dirname}/../isomorphic`,
Expand Down Expand Up @@ -207,6 +207,10 @@ module.exports = (program, directory, stage, webpackPort = 1500, routes = []) =>
test: /\.less/,
loaders: ['style', 'css', 'less'],
})
config.loader('sass', {
test: /\.scss/,
loaders: ['style', 'css', 'sass'],
})
config.loader('js', {}, (cfg) => {
cfg.loaders.unshift('react-hot')
return cfg
Expand All @@ -226,6 +230,10 @@ module.exports = (program, directory, stage, webpackPort = 1500, routes = []) =>
test: /\.less/,
loaders: ['css', 'less'],
})
config.loader('sass', {
test: /\.scss/,
loaders: ['css', 'sass'],
})
return config

case 'production':
Expand All @@ -237,7 +245,10 @@ module.exports = (program, directory, stage, webpackPort = 1500, routes = []) =>
test: /\.less/,
loaders: ['style', 'css', 'less'],
})

config.loader('sass', {
test: /\.scss/,
loaders: ['style', 'css', 'sass'],
})
return config

default:
Expand Down
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
"negotiator": "^0.5.3",
"node-cjsx": "^1.0.0",
"node-libs-browser": "^0.5.2",
"node-sass": "^3.4.2",
"null-loader": "^0.1.1",
"object-assign": "^4.0.1",
"parse-filepath": "^0.5.0",
Expand All @@ -49,6 +50,7 @@
"react-hot-loader": "^1.2.7",
"react-router": "^0.13.5",
"rimraf": "^2.4.2",
"sass-loader": "^3.1.2",
"static-site-generator-webpack-plugin": "^1.0.0",
"style-loader": "^0.13.0",
"toml": "^2.2.2",
Expand Down