Skip to content

Instantly share code, notes, and snippets.

@elgganor
Created January 25, 2020 09:44
Show Gist options
  • Save elgganor/990a121b98069376597551b73f31c696 to your computer and use it in GitHub Desktop.
Save elgganor/990a121b98069376597551b73f31c696 to your computer and use it in GitHub Desktop.
Minimal webpack configuration
{
"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"
}
}
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