Skip to content

Conversation

@aardvarkk
Copy link
Contributor

  • nested files would be given incorrect names in the webpack manifest
  • for instance, a file like images/icons/a.svg would end up at
    icons/a.svg instead of images/icons/a.svg, but a file like images/b.svg would end up at
    images/b.svg (correctly)
  • webpacker.yml config files generally follow a POSIX path naming
    convention (so source_path might be something like 'app/javascript')
  • the webpacker file loader config checks to see if a given file is in
    the source path by calling includes and passing the source path
  • on Windows, the file names resolve to strings with backslashes as
    separators, but the source path has a forward slash
  • the issue could be fixed by just changing the .yml file to have a
    backslash for the source path, but it would then break on POSIX
    systems
  • instead, we check that the normalized source path is contained
    within the file, which fixes the issue

- nested files would be given incorrect names in the webpack manifest
- for instance, a file like `images/icons/a.svg` would end up at
  `icons/a.svg`, but a file like `images/b.svg` would end up at
  `images/b.svg` (correctly)
- webpacker.yml config files generally follow a POSIX path naming
  convention (so source_path might be something like 'app/javascript')
- the webpacker file loader config checks to see if a given file is in
  the source path by calling `includes` and passing the source path
- on Windows, the file names resolve to strings with backslashes as
  separators, but the source path has a forward slash
- the issue *could* be fixed by just changing the .yml file to have a
  backslash for the source path, but it would then break on POSIX
  systems
- instead, we check that the *normalized* source path is contained
  within the file, which fixes the issue
@SleeplessByte
Copy link

@aardvarkk this is a different issue that I also experience. I just stopped nested files to not be bothered by this :D

@gauravtiwari gauravtiwari merged commit 38d2039 into rails:master Sep 22, 2020
@gauravtiwari
Copy link
Member

thank you 🙏

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.

3 participants