-
-
Notifications
You must be signed in to change notification settings - Fork 211
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
Add documentation to readme on how to use with sass-loader #42
Comments
Just use sass-loader before (so after in the loader definition). This should not need any specific doc. |
Sorry I can change my mind if this issue will be popular. |
@MoOx Yea, I tried that autoprefixer, and it doesn't seem to work. Here's my config: var webpack = require('webpack');
var path = require('path');
var ExtractTextPlugin = require("extract-text-webpack-plugin");
var autoprefixer = require('autoprefixer');
var precss = require('precss');
module.exports = {
context: __dirname,
output: {
path: path.join(__dirname, 'build'),
filename: '[name].js'
},
entry: {
app: './js/app.js'
},
module: {
loaders: [
{
test: /\.(scss|sass)$/,
loader: ExtractTextPlugin.extract('style-loader', 'css-loader', 'postcss-loader', 'sass-loader')}
]
},
postcss: function() {
return [autoprefixer, precss];
},
sassLoader: {
includePaths: [path.join(__dirname, 'scss')]
},
plugins: [
new ExtractTextPlugin('styles.css')
]
} Here's the sass file: .banner {
background-color: green;
font-size: 48px;
text-align: center;
color: white;
border-radius: 4px;
box-shadow: black 1px 1px 1px;
transform: rotate(7deg);
} And the output file: .banner {
background-color: green;
font-size: 48px;
text-align: center;
color: white;
border-radius: 4px;
box-shadow: black 1px 1px 1px;
transform: rotate(7deg);
} @ai Using this loader with sass or less is an extremely common use-case -- no one in practice is writing plain-vanilla CSS. I think it would be very useful to have a concrete example of how to use these tools together. |
I am open for PR. But try to suggest some compact changes. We already have too many config for different cases. |
@ajsharp I think you are not using ExtractTextPlugin the right way. |
@MoOx Ah, that was it 😄 Thanks very much for the help. |
+1 |
@MoOx this saved my life |
In the .scss file, use the Chinese comments, |
@MoOx Ah +1 |
@MoOx gooood job! |
@MoOx Thanks!! |
Using auto prefixer as last 2 versions of browser doesn't add prefixes but if I remove 'last 2 versions' then it works fine. Can someone tell me how does this happen?
@MoOx I mean, by your 'first parameter is optional' will my |
@aseem2625 It's because last 2 versions of browsers don't need any prefix. :p |
Not related but this is somehow top Google result. Here is my Stylus, PostCSS, Webpack 2 config for React, if someone needs. |
I just used it like so |
@ai I think It should reopen with webpack being so popular! |
@IamManchanda I am not a maintainer anymore =^_^= ask @michael-ciniawsky |
I think there may be differing definitions of what "works for me" means here.
indeed works fine .. until you need to do Still no idea how to order the plugins so that this works. (And yes, it works fine if |
No description provided.
The text was updated successfully, but these errors were encountered: