Open karthikdeva opened 7 years ago
Hi @karthikdeva , have you solved this issue?
Not sure if this is the original issue, but for me my test for /\.html/
was also picking my index.html
file from my html-webpack-plugin. Putting an exclude: /index.html/
did it for me. You may have to adjust the exclude if you have other files names index.html
, but the basic gist is:
module.exports = {
...
module: {
rules: [
{
exclude: /index\.html/,
test: /\.html$/,
use: [
{
loader: 'ngtemplate-loader',
options: {
relativeTo: './src'
}
},
{ loader: 'html-loader' }
]
}
]
},
...
}
This seems to be a problem with the combination of this loader and HtmlWebpackPlugin. The index file used by HtmlWebpackPlugin throws errors unless it is excluded, as @nickbreaton pointed out. However, excluding index.html means that any references in that file will not be required.
@nickbreaton It worked for me, thanks!
Is this maybe only windows problem?
No, I have linux and experiencing same issue.
I'm new into webpack and trying move gulp to webpack. facing issue in "ngtemplate-loader". Below is my webpack config.
const path = require('path'); const webpack = require("webpack"); const optimize = webpack.optimize; const htmlWebpackPlugin = require('html-webpack-plugin'); const ExtractTextPlugin = require('extract-text-webpack-plugin'); const CopyWebpackPlugin = require('copy-webpack-plugin'); const config = require('./webpack/config');
var webpackConfig = {
} module.exports = webpackConfig;