Invalid configuration object. Webpack has been initialised using a..

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')
}
};

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章