webpack-dev-server icon indicating copy to clipboard operation
webpack-dev-server copied to clipboard

fix: enable magic HTML routes for `module` output

Open snitin315 opened this issue 4 years ago • 8 comments

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

For Bugs and Features; did you add new tests?

Yes

Motivation / Use-Case

enable magic HTML routes for .mjs output.

Breaking Changes

None

Additional Info

No

snitin315 avatar Sep 01 '21 11:09 snitin315

Codecov Report

Merging #3773 (512a3d7) into master (db24b16) will decrease coverage by 0.06%. The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #3773      +/-   ##
==========================================
- Coverage   92.78%   92.72%   -0.07%     
==========================================
  Files          14       14              
  Lines        1345     1360      +15     
  Branches      467      470       +3     
==========================================
+ Hits         1248     1261      +13     
- Misses         90       92       +2     
  Partials        7        7              
Impacted Files Coverage Δ
lib/Server.js 93.69% <100.00%> (+0.09%) :arrow_up:
lib/servers/WebsocketServer.js 91.42% <0.00%> (-5.72%) :arrow_down:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update db24b16...512a3d7. Read the comment docs.

codecov[bot] avatar Sep 02 '21 10:09 codecov[bot]

Something wrong with Node 12 and MacOS, looking into it.

snitin315 avatar Sep 07 '21 11:09 snitin315

@snitin315 let's finish

alexander-akait avatar Sep 13 '21 12:09 alexander-akait

It seems https://github.com/webpack/webpack-dev-server/pull/3840 broke the magic HTML feature for multi-compiler mode.

/cc @alexander-akait

snitin315 avatar Sep 16 '21 10:09 snitin315

Can you provide example?

alexander-akait avatar Sep 16 '21 11:09 alexander-akait

  • cd examples/magic-html
  • update webpack.config.js as
- module.exports = setup({
+ module.exports = [setup({
  context: __dirname,
  entry: "./app.js",
  devServer: {
    magicHtml: true,
  },
- });
+ })];
  • npx webpack serve --open
  • go to localhost:8080/main -> Can't get main

snitin315 avatar Sep 16 '21 11:09 snitin315

I think it is specific to this PR only, I am looking into it.

snitin315 avatar Sep 16 '21 11:09 snitin315

Please add test for publicPath

output.publicPath or static.publicPath. Also, what should be the expected behavior?

snitin315 avatar Sep 25 '21 10:09 snitin315

removed in v5

snitin315 avatar May 30 '23 03:05 snitin315