Skip to content

Some paths in webpack configs aren't matched on Windows #453

@jgierer12

Description

@jgierer12

Do you want to request a feature or report a bug?
Bug

What is the current behavior?
I discovered this bug because routes are named *.chunk.*.js instead of route-*.js in the build output. This happens because Windows' backslash-delimited file paths (e.g. C:\Users\me\dev\project\src\routes\home\index.js aren't matched by these strings and regexes:

https://github.com/developit/preact-cli/blob/9eb46228922b05ecf88c0803a64f8fa5f04b2ab7/src/lib/webpack/webpack-client-config.js#L55-L58

There are probably more occurences of this throughout the webpack configs.

If the current behavior is a bug, please provide the steps to reproduce.

  1. preact create default test on Windows
  2. cd test, npm install
  3. npm run build
  4. In the build folder, route chunks aren't prefixed with route-

What is the expected behavior?
In this specific case, routes should be prefixed with route-, like on UNIX systems.
Generally, both / and \-delimited paths should be matched in webpack configs.

Please mention other relevant information.

  • node version 8.9.1
  • npm version 5.6.0
  • Operating system Windows 10 1709

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions