-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
build: remove publicPath from webpack dev config #2173
build: remove publicPath from webpack dev config #2173
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks @johnpaulmedina. Previously localhost:8080 showed a file listing of the rootdir and after some tweaking this is what most resembles prev situation:
diff --git a/build-config/fragments/dev.js b/build-config/fragments/dev.js
index 57bcc0e..c432996 100644
--- a/build-config/fragments/dev.js
+++ b/build-config/fragments/dev.js
@@ -1,6 +1,7 @@
/* eslint-env node */
const path = require('path');
+const rootDir = path.resolve(__dirname, '..', '..');
module.exports = {
mode: 'development',
@@ -11,9 +12,8 @@ module.exports = {
devServer: {
static: [
{
- directory: path.resolve(__dirname, '..', '..'),
+ directory: rootDir,
staticOptions: {},
- publicPath: '/dist/',
serveIndex: true,
watch: {
ignored: [
Otherwise browsing to localhost:8080 will result in a GET error. Can you make test and make these changes?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Got it. I tested it and it now serves the root dir as requested. So the localhost can access either directory now as previously.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks!
* Webpack dev config - added rootDir * Update to allow root access on webpack build-configs/dev * Remove unnecessary options on webpack dev config
Added rootDir const to webpack dev config. Should resolve issue with build we discussed on #2167