猿问

webpack无法使用相对路径

output: {

    path: './dist',

    filename: 'js/[name].bundle.js'

},

上面这段代码报错:

Hanger:wp3 Hanger$ 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!

文件结构如下:

守候你守候我
浏览 476回答 1
1回答

三国纷争

你试下这var path = require('path')output: {    path: path.resolve(__dirname, './dist'),    filename: 'js/[name].bundle.js'},
随时随地看视频慕课网APP

相关分类

JavaScript
我要回答