Created
July 30, 2017 15:14
-
-
Save carlosrymer/60d19ab23096b5cb9c30b546077a5582 to your computer and use it in GitHub Desktop.
A Webpack 3 configuration file used for opening an app for local development. Relies on: https://gist.github.com/carlosrymer/dff53dd8ab35574f236174530b6f1a44.
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
'use strict'; | |
const config = require('config'); | |
const path = require('path'); | |
const url = require('url'); | |
const webpack = require('webpack'); | |
const webpackConfig = require('./webpack.config'); | |
const HotModuleReplacementPlugin = webpack.HotModuleReplacementPlugin; // Hot reloading and inline style replacement | |
webpackConfig.devServer = { | |
allowedHosts : [ | |
'local.myapp.com' | |
], | |
compress : true, | |
contentBase : path.join(__dirname, 'dev'), | |
historyApiFallback : true, | |
hot : true, | |
inline : true, | |
noInfo : true, | |
port : 8080, | |
public : 'local.myapp.com:8080', | |
watchContentBase : true | |
}; | |
webpackConfig.devtool = 'inline-source-map'; | |
webpackConfig.output = { | |
filename : '[name].min.js', | |
path : path.resolve(__dirname, 'dev'), | |
publicPath : '/' | |
}; | |
webpackConfig.plugins.push(new HotModuleReplacementPlugin()); | |
module.exports = webpackConfig; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment