js-sass-loader

A Webpack loader to add JavaScript variables to SASS

Downloads in past

Stats

StarsIssuesVersionUpdatedCreatedSize
js-sass-loader
000.0.17 years ago7 years agoMinified + gzip package size for js-sass-loader in KB

Readme

Javascript to SASS loader
A Webpack loader that converts a JavaScript file into SASS variables, maps and lists. Any valid JSON is valid.

Example Webpack usage

module.exports = {

	module: {
	
	    rules: [{
	        test: /.scss$/,
	        loader: ExtractTextPlugin.extract({
	            fallbackLoader: 'style-loader',
	            loader: [
	                {loader: 'css-loader'}, 
	                {loader: 'sass-loader'}, 
	                {loader: 'jstosass-loader'}
	            ]
	        })
	    }]
	},
		
	plugins: [
	
	    new webpack.LoaderOptionsPlugin({
	        options: {
	            jsToSass: {path: paths.sassVars}
	        }
	    })
	]
}