-
-
Notifications
You must be signed in to change notification settings - Fork 9.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Asset] PathPackage combined with JsonManifestVersionStrategy not sitable with laravel-mix manifest #36234
Comments
Altho I'd like to see a solution from Symfony/Asset side, I've updated on the Mix side to strip prefix from items. Origin: glensc/eventum@6f38e33 const collect = require('collect.js');
/**
* Update manifest to remove leading slash of key => value pairs
* @author Elan Ruusamäe <glen@pld-linux.org>
* @see https://github.com/symfony/symfony/issues/36234
*/
mix.extend('updateManifestPathsRelative', (config) => {
config.plugins.push(new class {
apply(compiler) {
compiler.plugin('done', () => {
const manifest = {};
collect(Mix.manifest.get()).each((value, key) => {
key = this.normalizePath(key);
value = this.normalizePath(value);
manifest[key] = value;
});
Mix.manifest.manifest = manifest;
Mix.manifest.refresh();
});
}
/**
* @param {string} filePath
*/
normalizePath(filePath) {
if (filePath.startsWith('/')) {
filePath = filePath.substring(1);
}
return filePath;
}
})
});
mix.updateManifestPathsRelative(); |
Thank you for this issue. |
Thank you for this issue. |
@carsonbot I don't see anyone from Symfony side triaged this. |
This comment has been minimized.
This comment has been minimized.
The described behavior was intentionally implemented (and fixed) by #22528. The base path is not prepend to asset paths that start with a |
This comment has been minimized.
This comment has been minimized.
Thank you for this issue. |
I don't think any progress have been made here. |
Thank you for this issue. |
No. |
Thank you for this issue. |
Could I get a reply or should I close this? |
Hey, I didn't hear anything so I'm going to close it. Feel free to comment if this is still relevant, I can always reopen! |
Description
Laravel Mix provides a fluent API for defining Webpack build steps for your Laravel application using several common CSS and JavaScript pre-processors.
The mix manifest is created with a leading slash:
This file is compatible with JsonManifestVersionStrategy,
however PathPackage to prepend path expects input to be without leading slash.
Example
The text was updated successfully, but these errors were encountered: