Created
April 11, 2017 22:35
-
-
Save jaburns/6b84cd1b019379ad06df8f2d1d62cc40 to your computer and use it in GitHub Desktop.
Example of building only sass with webpack for legacy project
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const isProduction = process.env.NODE_ENV === 'production'; | |
module.exports = { | |
context: __dirname, | |
entry: { | |
styles: ['./sass/main.scss'] | |
}, | |
output: { | |
filename: 'build.css' | |
}, | |
module: { | |
loaders: [{ | |
test: /\.scss$/, | |
loader: isProduction | |
? 'css-loader!sass-loader' | |
: 'css-loader?sourceMap!sass-loader?outputStyle=expanded&sourceMap=true&sourceMapContents=true' | |
}] | |
} | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Here is the version I made from @jakeguti's suggestion.
https://www.dotnetthailand.com/to-other-languages/typescript-for-c-sharp-developers/webpack-configuration-for-sass-only