我写了一个简单的模板如何要求上的WebPack
的test.html
<div>raw text with content</div>
所有我想要做的就是要求原始文件,不修改
像
require('./test.html'); // should return "<div>raw text with content</div>"
我已经尝试使用额外的文本插件加载html,但它不起作用
var ExtractTextPlugin = require('extract-text-webpack-plugin');
module.exports =
{
module:
{
loaders:
[
{ test: /\.html$/, loader: 'html' }
]
},
plugins: [
new ExtractTextPlugin("[name].html")
]
};
不要使用的WebPack作为构建系统 - **它不是**。 Webpack是JS的模块打包器,以及您在其中使用**的静态资产。 – Kreozot
顺便说一句 - webpack完美地与gulp/grunt一起工作。 – Kreozot