included source-maps for debugging locally

This commit is contained in:
andres alcocer
2022-11-24 10:18:34 -05:00
parent cc110b6aae
commit 58c04ec1dd
2 changed files with 8 additions and 1 deletions

View File

@@ -4,7 +4,9 @@ const MiniCssExtractPlugin = require('mini-css-extract-plugin')
const { CleanWebpackPlugin } = require('clean-webpack-plugin')
const dotenv = require('dotenv')
const webpack = require('webpack')
var path = require('path')
const prod =
(process.env.NODE_ENV ? process.env.NODE_ENV : '').trim() === 'production'
const path = require('path')
module.exports = () => {
// call dotenv and it will return an Object with a parsed key
@@ -21,7 +23,11 @@ module.exports = () => {
path: path.resolve(__dirname, 'dist'),
filename: 'bundle.js',
publicPath: '/',
clean: true,
},
mode: prod ? 'production' : 'development',
// Enable sourcemaps for debugging webpack's output.
devtool: prod ? 'none' : 'eval-source-map',
module: {
rules: [
{