Skip to content

feat: publicPath output#5434

Open
adubrouski wants to merge 2 commits intowebpack:mainfrom
adubrouski:publicPath-output
Open

feat: publicPath output#5434
adubrouski wants to merge 2 commits intowebpack:mainfrom
adubrouski:publicPath-output

Conversation

@adubrouski
Copy link

  • This is a bugfix
  • This is a feature
  • This is a code refactor
  • This is a test update
  • This is a docs update
  • This is a metadata update

For Bugs and Features; did you add new tests?

Yes

Motivation / Use-Case

Some applications use public paths (to avoid strong differences between dev and prod builds). I set it via output.publicPath, and it seems a bit inconvenient to me that the urls in the terminal are obtained without taking publicPath into account. These can be simple applications without routing, and you have to go to / and then manually add publicPath. I suggest outputting the url with publicPath if it is set statically, if it is determined on the fly - output without it.

Now, with config like this:

output: { publicPath: "/my-public-path/", }

We getting this:

<i> [webpack-dev-server] Project is running at: <i> [webpack-dev-server] Loopback: http://localhost:8080/, http://[::1]:8080/ <i> [webpack-dev-server] On Your Network (IPv4): http://10.252.1.16:8080/ <i> [webpack-dev-server] Content not from webpack is served from '/home/user/Project/src' directory <i> [webpack-dev-server] 404s will fallback to '/index.html' 

My proposal is:

<i> [webpack-dev-server] Project is running at: <i> [webpack-dev-server] Loopback: http://localhost:8080/my-public-path/, http://[::1]:8080/my-public-path/ <i> [webpack-dev-server] On Your Network (IPv4): http://10.252.1.16:8080/my-public-path/ <i> [webpack-dev-server] Content not from webpack is served from '/home/user/Project/src' directory <i> [webpack-dev-server] 404s will fallback to '/index.html' 

Breaking Changes

No

Additional Info

No

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants