-
Notifications
You must be signed in to change notification settings - Fork 119
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
Template includes not working coupled with apply-loader #105
Comments
We've caught same issue. |
For people who find this issue. You can nicely work around this by using mixins. |
I think you may need to exclude the pug files you reference with |
I solved using module.exports = {
module: {
rules: [
{
test: /\.pug$/,
exclude: path.resolve(__dirname, 'src/pug/includes'),
use: ['apply-loader', 'pug-loader']
},
{
test: /\.pug$/,
exclude: path.resolve(__dirname, 'src/pug/pages'),
loader: 'pug-loader'
}
]
},
plugins: [
new HtmlWebpackPlugin({
template: '!!pug-loader!./src/pug/_template.pug',
filename: '../../index.html'
// other options
})
]
}; |
I had this same issue after updating to Angular 7. The error message was a bit different: I solved the issue by adding .include.pug to all filenames that where used with the include statement in our .pug files. |
Is this still an issue? We recently upgraded from to Angular 8 and I would have expected to see this error. I have NOT renamed any Just guessing, but, could something have been changed in |
Try to use alternative pug-loader. This loader has 3 methods:
|
When I try to use
include
of another file inside a template it's now working, throwing:TypeError: __webpack_require__(...).call is not a function
... because the template is already applied by theapply-loader
and yields a string, so webpack can't call it as a function.Here is a minimal reproduction of the bug: https://github.com/gizm0bill/pug-loader-include-bug-demo (just build it, run a server over ./dist and check console)
This thing used to work before, about 3 months ago. Do you have any idea what's going on there, maybe something on webpack's side? I see you didn't change the require part recently
The text was updated successfully, but these errors were encountered: