Skip to content

Instantly share code, notes, and snippets.

@anacampesan
Created March 16, 2019 21:43
Show Gist options
  • Save anacampesan/b0d851cbd2ba885178037a7a8c8f0214 to your computer and use it in GitHub Desktop.
Save anacampesan/b0d851cbd2ba885178037a7a8c8f0214 to your computer and use it in GitHub Desktop.
Basic webpack config for JS and SASS
var path = require("path");
module.exports = {
entry: "./main.js",
output: {
path: path.resolve(__dirname, "dist"),
filename: "bundle.js",
publicPath: "/dist"
},
module: {
rules: [
{
test: /\.js$/,
},
{
test: /\.scss$/,
use: [
{
loader: "style-loader" // inserts css into the page as a <style> tag
},
{
loader: "css-loader" // resolves all imports and url() in the CSS
},
{
loader: "sass-loader" // compiles Sass to CSS
}
]
}
]
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment