Skip to content

Instantly share code, notes, and snippets.

@Muirrum
Created April 23, 2018 17:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Muirrum/1c129d2bea67232b52b07be11bcf968f to your computer and use it in GitHub Desktop.
Save Muirrum/1c129d2bea67232b52b07be11bcf968f to your computer and use it in GitHub Desktop.
module.exports = [{
entry: './app.scss',
output: {
// This is necessary for webpack to compile
// But we never use style-bundle.js
filename: 'style-bundle.js',
},
module: {
rules: [{
test: /\.scss$/,
use: [{
loader: 'file-loader',
options: {
name: 'bundle.css',
},
},
{
loader: 'extract-loader'
},
{
loader: 'css-loader'
},
{
loader: 'sass-loader',
options: {
importer: function (url, prev) {
if (url.indexOf('@material') === 0) {
var filePath = url.split('@material')[1];
var nodeModulePath = `./node_modules/@material/${filePath}`;
return {
file: require('path').resolve(nodeModulePath)
};
}
return {
file: url
};
}
}
}
]
}]
},
}];
module.exports.push({
entry: "./app.js",
output: {
filename: "bundle.js"
},
module: {
loaders: [{
test: /\.js$/,
loader: 'babel-loader',
query: {
presets: ['es2015']
}
}]
},
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment