照着步骤来执行命令还是失败了,
D:\Work\webpack-demo>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/js" is not an absolute path!
-> The output directory as **absolute path** (required).
const path = require('path'); module.exports = { entry: './src/script/main.js', output: { path: path.resolve(__dirname, './dist/js'), filename: "bundle.js" }, resolve:{ alias:{ '@':path.resolve(__dirname,'.') } }, }
这样写就好了