Open robinvdvleuten opened 8 years ago
I'm not sure it's possible right now but in the near future, you will be able to use puli.js (it will be put in the Puli organization as soon as it's ready) :) .
@webmozart is it currently possible with the PHP implementation?
This issue is not related solely to webpack. The output of the url generator does not take path mappings into account.
$ mkdir -p res/public
$ touch res/public/app_12345.js
$ puli map /res res
$ puli map /res/public/app.js res/public/app_12345.js
$ mkdir web
$ puli server --add localhost web
$ puli publish /res/public localhost
$ puli publish --install
$ tree
├── res
│ └── public
│ └── app_12345.js
└── web
└── app_12345.js --> ../res/public/app_12345.js
$repository->get('/res/public/app.js')->getFilesystemPath();
// returns "/path/to/res/public/app_12345.js"
$urlGenerator->generateUrl('/res/public/app.js');
// returns "/app.js" instead of "/app_12345.js"
This is currently not possible, as you found out. We should add a possibility to maintain the original file name when installing assets.
We're using Puli to have some sort of asset mapping of assets produced by Webpack, it looks like this;
Now I would like to generate an url for the assets in our twig templates like this;
But the generated url is
http://localhost:8888/js/scripts.js
where I expectedhttp://localhost:8888/js/scripts-4ea3c5271307e0573488.min.js
.Is such setup possible with Puli?