shellscape / webpack-manifest-plugin

webpack plugin for generating asset manifests
MIT License
1.44k stars 184 forks source link

Option to map entries or normalize paths on both Windows and OSX/Linux #60

Closed mikegleasonjr closed 6 years ago

mikegleasonjr commented 7 years ago

Hi,

The keys of the manifest on Windows are: "path\\file.ext"

Whereas on Linux/OSX it is: "path/file.ext"

Making it difficult to reference a resource by its key in the manifest.

Can we have a callback function to transform the manifest elements prior to insertion or have both paths use slashes (/)?

mastilver commented 7 years ago

Can we have a callback function to transform the manifest elements prior to insertion or have both paths use slashes (/)?

This is what I'm planning to do on #55

weaverryan commented 7 years ago

+1 - this is the 1 other hack that we're maintaining in our fork. I really like #55 ;)

a-x- commented 7 years ago

I have two points:

mastilver commented 7 years ago

@a-x- you are making a good point here

We should stick to the linux path even on windows so it's consistent if you relly on the key during your build process

weaverryan commented 7 years ago

Yep, our hack is exactly to make sure that the keys are always the same, regardless of platform. +1 for it being the default behavior.

mastilver commented 7 years ago

@mikegleasonjr @weaverryan Would you mind giving me an example of webpack.config.js where this issue occurs, that will help me writing the tests (as I don't have access to a windows machine...)

mastilver commented 7 years ago

ping @mikegleasonjr @weaverryan

mikegleasonjr commented 7 years ago

@mastilver https://github.com/danethurber/webpack-manifest-plugin#usage

mastilver commented 7 years ago

@mikegleasonjr Good point ;)

{
  context: __dirname,
  entry: {
    'test\\one': './fixtures/file.js',
    two: './fixtures/file-two.js'
  },
  plugins: [
    new ManifestPlugin()
  ]
}
mikegleasonjr commented 6 years ago

Thanks @mastilver !