added sourcemap option for webpack
This commit is contained in:
parent
504b7e06b5
commit
a0746f088f
@ -4,10 +4,15 @@ const NodemonPlugin = require('nodemon-webpack-plugin')
|
|||||||
|
|
||||||
module.exports = env => {
|
module.exports = env => {
|
||||||
const isProduction = !!env.production
|
const isProduction = !!env.production
|
||||||
|
const generateSourceMap = !!env.sourcemap
|
||||||
|
let devtool = null
|
||||||
|
if (!isProduction) {
|
||||||
|
devtool = generateSourceMap ? 'source-map' : 'eval'
|
||||||
|
}
|
||||||
const config = {
|
const config = {
|
||||||
mode: isProduction ? 'production' : 'development',
|
mode: isProduction ? 'production' : 'development',
|
||||||
entry: './src/index.ts',
|
entry: './src/index.ts',
|
||||||
devtool: isProduction ? false : 'eval',
|
devtool,
|
||||||
module: {
|
module: {
|
||||||
rules: [
|
rules: [
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user