Invalid configuration object. Webpack has been initialised using a configuration object that does not match the API schema
無效的配置對象。Webpack已使用與API模式不匹配的配置對象初始化。
解決方案一:
npm install webpack-cli -g
#安裝這個
解決方案二:
將你的webpackconfig.js 改成下面這個
var path = require('path');
module.exports = {
entry: './main.ts',
resolve: {
extensions: ['.webpack.js', '.web.js', '.ts', '.js']
},
module: {
rules: [
{ test: /.ts$/, loader: 'ts-loader' }
]
},
output: {
filename: 'bundle.js',
path: path.resolve(__dirname, 'dist')
}
};