Created
January 25, 2020 09:44
-
-
Save elgganor/990a121b98069376597551b73f31c696 to your computer and use it in GitHub Desktop.
Minimal webpack configuration
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
{ | |
"name": "projectTitle", | |
"version": "1.0.0", | |
"description": "", | |
"private": true, | |
"scripts": { | |
"test": "echo \"Error: no test specified\" && exit 1", | |
"start": "webpack-dev-server --open", | |
"watch": "webpack --watch", | |
"build": "webpack" | |
}, | |
"keywords": [], | |
"author": "mrouabeh", | |
"license": "ISC", | |
"devDependencies": { | |
"css-loader": "^3.4.2", | |
"node-sass": "^4.13.0", | |
"sass-loader": "^8.0.1", | |
"style-loader": "^1.1.2", | |
"webpack": "^4.41.5", | |
"webpack-cli": "^3.3.10", | |
"webpack-dev-server": "^3.10.1" | |
} | |
} |
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
const path = require('path'); | |
module.exports = { | |
entry: './src/index.js', | |
output: { | |
filename: 'bundle.js', | |
path: path.resolve(__dirname, 'dist') | |
}, | |
module: { | |
rules: [ | |
{ | |
test: /\.css$/, | |
use: ['style-loader', 'css-loader'] | |
}, | |
{ | |
test: /\.s[ac]ss/, | |
use: ['style-loader', 'css-loader', 'sass-loader'] | |
} | |
] | |
}, | |
devServer: { | |
contentBase: './dist' | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment