Closed Vitenok closed 6 years ago
index-webpack.html
was not excluded because exclude needs to be not inside options. This part is not covered in documentation at all which is kinda sad @WearyMonkey, probably it is good idea to write somethind about this in docs. My config partial now looks like this:
{
test: /\.html$/,
exclude: [ path.resolve(__dirname, './node_modules'), path.resolve(__dirname, './app/index-webpack.html')],
use: [
{
loader: 'ngtemplate-loader',
options: {
relativeTo: path.resolve(__dirname + '/app/views'),
}
},
{
loader: 'html-loader',
options: {
root: path.resolve(__dirname, './app/images'),
attrs: ['img:src', 'link:href']
}
},
]
},
I also had to remove '?relativeTo=' + __dirname + '/app/views' part from loader definition as it was causing errors. I beleive this syntax does not work in Webpak 3.
Hi, I'm trying to switch my Angular 1.5.3 app to use Webpack 3.10.0 for bundling and using ngtemplate-loader to make angular templates work. Would appreciate any help since I'm stuck with this for quite a long time.
The problem I'm getting now is strange text which wraps
<html></html>
tags in generated html file :Generated wdist/index.html:
Project structure
webpack.config.js
Templates are injected in two manners: Either with ng-include
<div ng-include="require('../views/header.html')"></div>
, or like this:Generated
main.bundle.js
seems to have srtingified templates:So page looks like this when webpack-server is started: :
Please help to get it work
P.S.
After changing order of loaders (ngtemplate-loader first and html-loader after) I'm getting error:
As mentioned in this issue #41 exclude needs to be addded to config. This is confusing to me coz I already have it:
Any thoughts?