Skip to content

Instantly share code, notes, and snippets.

@bholloway
Last active February 14, 2017 00:41
Show Gist options
  • Save bholloway/68ac1225b633cfc79ca5572232ae2995 to your computer and use it in GitHub Desktop.
Save bholloway/68ac1225b633cfc79ca5572232ae2995 to your computer and use it in GitHub Desktop.
sass-loader@6.0.0 source-map issue
"use strict";
const path = require("path");
const ExtractTextPlugin = require("extract-text-webpack-plugin");
const sassLoader = require.resolve("../../lib/loader");
const extractSass = new ExtractTextPlugin({
filename: "[name].[contenthash].css",
disable: false
});
module.exports = {
entry: path.resolve(__dirname, "../scss/bootstrap-sass.scss"),
output: {
path: path.resolve(__dirname, "../output"),
filename: "bundle.bootstrap-sass.js"
},
devtool: "source-map",
module: {
rules: [{
test: /\.scss$/,
use: extractSass.extract({
loader: [{
loader: "css-loader",
options: {
sourceMap: true
}
}, {
loader: 'adjust-sourcemap-loader', options: {
debug: true,
format: false//'absolute'
}
}, {
loader: sassLoader,
options: {
sourceMap: true,
includePaths: [
path.resolve(__dirname, "../scss/from-include-path")
]
}
}],
fallbackLoader: "style-loader"
})
}, {
test: /\.woff2?$|\.ttf$|\.eot$|\.svg$/,
use: [{
loader: "file-loader"
}]
}]
},
plugins: [
extractSass
]
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment