Last active
December 10, 2018 14:40
-
-
Save stephencweiss/62d2540daecdc3f9a8797b20c0698e16 to your computer and use it in GitHub Desktop.
Template for customizing the webpack config file for modes development and production
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
//webpack.config.js | |
const path = require('path'); | |
const SRC_DIR = path.resolve(__dirname, 'client') | |
const DIST_DIR = path.resolve(__dirname, 'public') | |
var config = { | |
entry: `${SRC_DIR}/index.jsx`, | |
output: { | |
filename: 'bundle.js', | |
path: DIST_DIR | |
} | |
} | |
module.exports = (env, argv) => { | |
if (argv.mode === "development") { | |
// settings that are customized *beyond* the defaults for the development mode | |
// config.devtool = 'source-map'; | |
console.log(`Development mode!`) | |
} | |
if (argv.mode === "production") { | |
// settings that are customized *beyond* the defaults for the production mode | |
console.log(`Development mode!`) | |
} | |
return config; | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment