dc7290 / template-ejs-loader

ejs-loader with webpack5 support. Chain it to html-loader and use it with html-webpack-plugin.
MIT License
24 stars 3 forks source link

htmlWebpackPluginTemplateCustomizer :: Always got an error "Module not found: Error: Can't resolve '/examples/webpack-ejs-starter/undefined" #18

Closed florent-cdl closed 2 years ago

florent-cdl commented 2 years ago

Describe the bug I can't get the new htmlWebpackPluginTemplateCustomizer to work. Always the same message "module not found"

To Reproduce I've created a repository to test https://github.com/florent-cdl/ejs-webpack-sample

Expected behavior I wanyt to be able to use the new htmlWebpackPluginTemplateCustomizer to pass individual variables to the ejs template

Version

webpack5

dc7290 commented 2 years ago

https://github.com/florent-cdl/ejs-webpack-sample/pull/1

You can get it working with PR here. In the case of your sample, the option name passed to htmlWebpackPluginTemplateCustomizer was wrong, and the value passed to data was missing.