Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/373.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript HtmlWebpackPlugin擦除模板div_Javascript_Reactjs_Webpack_Html Webpack Plugin - Fatal编程技术网

Javascript HtmlWebpackPlugin擦除模板div

Javascript HtmlWebpackPlugin擦除模板div,javascript,reactjs,webpack,html-webpack-plugin,Javascript,Reactjs,Webpack,Html Webpack Plugin,我按照这个示例()启动一个reactj应用程序,因此这是我的 webpack.config.js var HtmlWebpackPlugin = require('html-webpack-plugin'); var HtmlWebpackPluginConfig = new HtmlWebpackPlugin({ tempalte : __dirname + '/app/index.html', filename : 'index.html', inject : 'body' })

我按照这个示例()启动一个reactj应用程序,因此这是我的 webpack.config.js

var HtmlWebpackPlugin = require('html-webpack-plugin');
var HtmlWebpackPluginConfig = new HtmlWebpackPlugin({
  tempalte : __dirname + '/app/index.html',
  filename : 'index.html',
  inject : 'body'
})
module.exports = {
  entry: [
    './app/index.js'
  ],
  output: {
    path : __dirname + '/dist',
    filename : "index_bundle.js"
  },
  module : {
    loaders :[
      {test: /\.js$/, include: __dirname + '/app', loader: "babel-loader"}
    ]
  },
  plugins : [HtmlWebpackPluginConfig]
}
这是我的index.html模板:

<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title> teste</title>
</head>
<body>
  <div id="app"></div>
</body>
</html>
我怎样才能不删除我的div? 我使用 “巴别塔核心”:“^6.7.6”, “巴别塔加载器”:“^6.2.4”, “巴别塔预设反应”:“^6.5.0”, “html网页包插件”:“^2.15.0”, “网页包”:“^1.13.0”, 网页包开发服务器“^1.14.1”


tks

配置中
模板
键的输入错误意味着它使用的是默认模板,而不是您试图包含的模板。默认行为使此错误难以发现

tempalte:uu dirname+'/app/index.html'
应该是
template:\uu dirname+'/app/index.html'
配置中的
template
键输入错误意味着它使用的是默认模板,而不是您试图包含的模板。默认行为使此错误难以发现

tempalte:uu dirname+'/app/index.html'
应该是
template:\uu dirname+'/app/index.html'

捕捉得好,只是让差异变得更明显一点。谢谢,对不起。。我的坏:)抓得好,只是把差别弄得更明显一点。。我的错:)
<!DOCTYPE html>
<html>
  <head>
    <meta charset="UTF-8">
    <title>Webpack App</title>
  </head>
  <body>
  <script src="index_bundle.js"></script></body>
</html>
Uncaught Invariant Violation: _registerComponent(...): Target container is not a DOM element.