Webpack jade-html-loader

问题描述:

使用webpack的我想使用它,目前我使用的是使用jade-html-laoder,但是当我运行webpack watch命令时,HTML文件的结果带有所有javascript代码嵌入式。Webpack jade-html-loader

这是我webpack.config.js

var webpack = require('webpack'), 
    BrowserSyncPlugin = require('browser-sync-webpack-plugin'), 
    html = require('jade-html-loader'), 
    path = require('path'); 
    require('es6-promise').polyfill(); 



module.exports = { 

    entry: ['./js/scripts.js', 'file?name=index.html!jade-html!./index.jade'], 
    output: {filename: './js/bundle.js'}, 
    module: { 
     loaders: [{ 
      test: /\.js?/, 
      loader: 'babel-loader', 
      exclude: /node_modules/ 
     }, 
    { 
     test: /\.jade$/, 
     loader: 'jade' 
    }, 
     { 
      test: /\.css$/, 
      loader: "style!css" 
     }, 
     { 
      test: /\.scss$/, 
      loaders: ["style", "css", "sass"] 
     }] 
    }, 


    plugins: [ 
     new BrowserSyncPlugin({ 
      host: 'localhost', 
      port: 3000, 
      server: {baseDir: './'}, 
      reload: true, 
      files: "*.html" 
     }) 
     ] 
    }; 

您是否尝试过使用一个新的版本? 玉现在叫帕格。

WHIS为我工作:

module: { 
    loaders: [ 
     { 
     test: /\.jade$/, 
     loader: 'pug-html-loader' 
     } 
    ] 
}