webpack.config.js配置文件出错提示:Invalid configuration object.

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/page" is not an absolu
te path!

   -> The output directory as **absolute path** (required).


以上提示的意思是:输出路径必须是绝对路径

这是原配置文件中的代码:

var webpack = require("webpack");

module.exports = {
"entry": {
        index : './js/demo01.js'
    },
    //入口文件输出配置
    "output": {
        path: 'dist/js/page',//此处应该修改为 path: __dirname+'/dist/js/page'
        filename: '[name].js'
    },
"module": {
        rules: [
            {
                test: /\.scss$/,
                loader:'style-loader!css-loader!sass-loader'
            }
        ]
   }
}

猜你喜欢

转载自blog.csdn.net/jiang7701037/article/details/80682386