Closed korsmakolnikov closed 7 years ago
Is it possible to resolve path relation with publicPath
parameter?
The problem with your approach is that if we use ExtractTextPlugin, then for each entry point we need to control extracted part in twig templates. And its a headache if we have many entry points or separate frontend team.
edit
I feel stupid. I found the problem. Have to prepend a slash in publicPath parameter. By the way, for "manifest" parameter you cannot prepend a slash. So... My parameters is like:
webpack.manifest: assets/webpack-manifest.json
webpack.publicPath: /assets/
I fix it and make you a pull request.
old reply You already use publicPath and it has no benefit. Symfony always try to search the bundle in the wrong route. We could try to extract absolute url instead of relative and came back to master... Then we could cycle all the entry with a single command like you want. What you think?
See other pull https://github.com/fullpipe/twig-webpack-extension/pull/2
When I've try to use your bundle to load javascript bundle, token is parsed with controllers context route (like route/edit/bundle.js for example) instead of producing relative path from web/, resulting in a 404. Parsing only the hashed file name and put it in href attribute is more familiar use (see asset function) and works perfectly.