TypeError:Object(...)不是第一个webpack运行的函数

a.k*_*nko 5 javascript webpack webpack-3

我尝试基于webpack运行我的应用程序,并在第一次运行时出现错误.

Uncaught TypeError: Object(...) is not a function
at Object.<anonymous> (main.js:75)
at __webpack_require__ (main.js:20)
at Object.defineProperty.value (main.js:63)
at main.js:66
(anonymous) @ main.js:75
__webpack_require__ @ main.js:20
Object.defineProperty.value @ main.js:63
(anonymous) @ main.js:66
Run Code Online (Sandbox Code Playgroud)

我理解原因但无法理解如何解决它.我在网络中发现了许多类似的问题,其中很多都是和插件的原因.我只安装了一个,但找不到他的解决方案.请帮忙.

先感谢您.

命令我运行的:

npm install --save-dev webpack
yarn add html-webpack-plugin -D
yarn run start
yarn add node-static -D
yarn run dev
Run Code Online (Sandbox Code Playgroud)

我的webpack.config.file:

const path = require('path');
const HtmlWebpackPlugin = require('html-webpack-plugin');

const PATHS = {
    source: path.join(__dirname, 'src'),
    build: path.join(__dirname, 'build')
};

module.exports = {
    entry: PATHS.source + '/index.js',
    output: {
        path: PATHS.build,
        filename: '[name].js'
    },
    plugins: [
        new HtmlWebpackPlugin({
            title: 'Webpack app'
        })
    ]
}
;
Run Code Online (Sandbox Code Playgroud)

的package.json:

{
  "name": "webpack-app",
  "version": "1.0.0",
  "description": "",
  "main": "index.js",
  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1",
    "start": "webpack",
    "dev": "static build"
  },
  "keywords": [],
  "author": "",
  "license": "ISC",
  "devDependencies": {
    "html-webpack-plugin": "^2.30.1",
    "node-static": "^0.7.9",
    "webpack": "^3.5.5"
  }
}
Run Code Online (Sandbox Code Playgroud)

我理解原因但无法理解如何解决它.我在网络中发现了许多类似的问题,其中很多都是和插件的原因.我只安装了一个,但找不到他的解决方案.请帮忙.

先感谢您.