Skip to content

Instantly share code, notes, and snippets.

@carlosrymer
Created July 30, 2017 15:14
Show Gist options
  • Save carlosrymer/60d19ab23096b5cb9c30b546077a5582 to your computer and use it in GitHub Desktop.
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.
'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