Open DeepenLau opened 7 years ago
... module: { rules: [ { test: /\.(njk|nunjucks)$/, use: ['compile-nunjucks-loader'] } ] } ...
// plugins new HtmlWebpackPlugin({ filename: 'index.html', template: 'compile-nunjucks-loader!' + path.resolve(__dirname, './views/index.njk'), inject: true, minify: { removeComments: true, collapseWhitespace: true, minifyJS: true } })
You may need an appropriate loader to handle this file type. | <!DOCTYPE html> | <html lang="en"> | <head>
我用法有问题吗?还是不兼容 webpack2 ?
你的模板是怎样写的?我估计你应该还需要加上html-loader处理html,nunjunks-loader只是处理了nunjucks的编译
确实加了 html-loader 就好了,感谢!
不谢,可加微信:facemagic2014,可随时交流
好的,已加~
我看html-webpack-plugin依赖里已经有html-loader,不是默认调用处理的?还要手动配置文件里写明吗
要写
我用法有问题吗?还是不兼容 webpack2 ?