Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

webpack dev server #8

Open
wants to merge 9 commits into
base: master
Choose a base branch
from
Open

webpack dev server #8

wants to merge 9 commits into from

Conversation

ghost
Copy link

@ghost ghost commented Sep 11, 2018

Additional settings for webpack dev server

@ghost ghost changed the title Proxy js file to index.html webpack dev server Sep 17, 2018
@ghost ghost requested a review from JakeSidSmith September 19, 2018 10:07
Copy link
Contributor

@JakeSidSmith JakeSidSmith left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You need some tests for the new config. E.g. check that the publicPath is constructed correctly.

src/index.js Outdated
@@ -223,6 +228,7 @@ function createWebpackConfig(options) {
output: {
filename: outFile,
path: outDir,
publicPath: options.outDir.replace(MATCHES_LEADING_DOT_SLASHES, ''),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You should add this option only to devServer

https://webpack.js.org/configuration/dev-server/#devserver-publicpath-

src/index.js Outdated
@@ -8,7 +8,12 @@ const POLYFILLS = [
require.resolve('babel-polyfill'),
require.resolve('raf/polyfill'),
];

const HOST = '0.0.0.0';
const PORT = 3000;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You should pull these from process.env, and have these as default values.

const { HOST = '0.0.0.0', PORT = 3000 } = process.env; 

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant