Created
April 26, 2021 04:38
-
-
Save iampavangandhi/b403ecb45d75d81fc28c2e6b71f9d60e to your computer and use it in GitHub Desktop.
Config file for webpack crash course tutorial on youtube, 2021
This file contains hidden or 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'); | |
const HtmlWebpackPlugin = require('html-webpack-plugin'); | |
module.exports = { | |
entry: './app/index.js', | |
module: { | |
rules: [ | |
{ | |
test: /\.svg$/, | |
use: 'svg-inline-loader', | |
}, | |
{ | |
test: /\.css$/i, | |
use: ['style-loader', 'css-loader'], | |
}, | |
{ | |
test: /\.(js)$/, | |
use: 'babel-loader', | |
}, | |
], | |
}, | |
output: { | |
path: path.resolve(__dirname, 'dist'), | |
filename: 'bundle.js', | |
}, | |
plugins: [ | |
new HtmlWebpackPlugin({ | |
template: './app/index.html', | |
}), | |
], | |
mode: process.env.NODE_ENV === 'production' ? 'production' : 'development', | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment