我尝试编译" .ts" to" .js"使用webpack但是出现此错误,我该如何解决这个问题?
Invalid configuration object. Webpack has been initialised using a configuration object that does not match the API schema.
- configuration.output.path: The provided value "./dist" is not an absolute path!"
答案 0 :(得分:32)
output.path
需要一个绝对路径,但是你给它一个相对路径./dist
。您需要将其转换为绝对路径,例如使用path.resolve
:
const path = require('path');
module.exports = {
output: {
path: path.resolve(__dirname, 'dist'),
// Your other output options
},
// Rest of your config
};