Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Serve website from src directory in dev mode
  • Loading branch information
simonsmith committed Feb 19, 2017
1 parent c480485 commit 1633025
Show file tree
Hide file tree
Showing 6 changed files with 173 additions and 30 deletions.
2 changes: 1 addition & 1 deletion .gitignore
@@ -1,3 +1,3 @@
node_modules
dist/assets
build
.envrc
12 changes: 0 additions & 12 deletions dist/index.html

This file was deleted.

1 change: 1 addition & 0 deletions package.json
Expand Up @@ -63,6 +63,7 @@
"eslint-plugin-lodash-fp": "^2.1.3",
"eslint-plugin-react": "^6.9.0",
"flow-bin": "^0.38.0",
"html-webpack-plugin": "^2.28.0",
"jest": "^18.1.0",
"react-addons-test-utils": "^15.4.2",
"react-svg-loader": "^1.1.1",
Expand Down
11 changes: 11 additions & 0 deletions src/index.html
@@ -0,0 +1,11 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title></title>
</head>
<body>
<div id="root"></div>
</body>
</html>
11 changes: 7 additions & 4 deletions webpack.config.js
@@ -1,5 +1,6 @@
const webpack = require('webpack');
const path = require('path');
const HtmlWebpackPlugin = require('html-webpack-plugin');

const devMode = process.env.NODE_ENV === 'development';

Expand All @@ -8,9 +9,8 @@ const config = {
app: './src/client',
},
output: {
path: path.join(process.cwd(), 'dist'),
path: path.join(process.cwd(), 'build'),
filename: '[name].bundle.js',
publicPath: '/assets',
},
module: {
rules: [
Expand Down Expand Up @@ -45,12 +45,15 @@ const config = {
new webpack.EnvironmentPlugin([
'USER_SEARCH_OAUTH',
]),
new HtmlWebpackPlugin({
template: 'src/index.html',
}),
],
devServer: {
contentBase: 'dist',
inline: true,
contentBase: 'src',
port: '3001',
publicPath: '/assets',
publicPath: '/',
historyApiFallback: true,
},
devtool: devMode ? 'eval-source-map' : null,
Expand Down

0 comments on commit 1633025

Please sign in to comment.