Created
April 23, 2018 17:32
-
-
Save Muirrum/1c129d2bea67232b52b07be11bcf968f to your computer and use it in GitHub Desktop.
This file contains 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
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