sagold / handlebars-webpack-plugin

Renders your html-template at build time
161 stars 45 forks source link

Output path is no longer used as of 1.3.1 #25

Closed omelhoro closed 6 years ago

omelhoro commented 6 years ago

I saw the issue #22 that 2 files were created and it was solved with 1.3.1, however with this release the output path is passed to this.registerGeneratedFile where the path gets stripped by path.basename(filepath). So the files are written to the webpack folder and not to the given output folder.

sagold commented 6 years ago

Thank you for catching this. I patched the plugin, fixing this issue with 04d30463cfe7e339c78d7826be4b37140f1e526b.

Do you rely on using a different output-folder for the templates than the webpacks default output destination? Since i cannot emit files via webpack to different root folders i am considering to make a breaking change, removing this feature.

Thanks for help.

omelhoro commented 6 years ago

Thanks for the fast fix! I was using the output feature for 2 things: Firstly, to render a structure like this wwwroot/ index.html (which was compiled from index.hbs) dist/ ...webpack files: JS and CSS

And secondly, in a .NET project to copy the compiled index.html to '../Backend/wwwroot' and to serve the webpack dist from a the web live reload server.

However, maybe I can use CopyWebpackPlugin or something like that or just pin the version if the feature gets removed.

sagold commented 6 years ago

Thanks for your reply. Now i know the feature is being used and i will leave it as it is for now. Please note that a path outside of webpacks output folder might not work with webpack-dev-server.