Skip to content
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

nesting templates using ejs #443

Closed
lonelydatum opened this issue Sep 26, 2016 · 3 comments
Closed

nesting templates using ejs #443

lonelydatum opened this issue Sep 26, 2016 · 3 comments

Comments

@lonelydatum
Copy link

Here is my code:

webpack.config.js
new htmlWebpackPlugin({ template: 'template.ejs' })

template.ejs
`
<% include head %>

`

This is the error I'm getting. Do I need to do something with lodash?

Html Webpack Plugin:
Error: Child compilation failed:
Module build failed: SyntaxError: Unexpected identifier

  • index.js:10809
    [banner-boiler]/[ejs-loader]/[lodash]/index.js:10809:16
  • index.js:11082
    [banner-boiler]/[ejs-loader]/[lodash]/index.js:11082:21
  • index.js:8152
    [banner-boiler]/[ejs-loader]/[lodash]/index.js:8152:31
  • index.js:10808 Function.template
    [banner-boiler]/[ejs-loader]/[lodash]/index.js:10808:
@jantimon
Copy link
Owner

The fallback loader does not support include - please use a custom loader e.g.

new htmlWebpackPlugin({ template: '!!ejs-compiled-loader!template.ejs' })

https://github.com/bazilio91/ejs-compiled-loader

(don't know how well ejs-compiled-loader works but I hope you get the idea)

@lonelydatum
Copy link
Author

works like a charm :) Thank you so much!

@lock
Copy link

lock bot commented May 31, 2018

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked as resolved and limited conversation to collaborators May 31, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants