Created
March 16, 2019 21:43
-
-
Save anacampesan/b0d851cbd2ba885178037a7a8c8f0214 to your computer and use it in GitHub Desktop.
Basic webpack config for JS and SASS
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
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