Skip to content

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
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
];

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