您的位置:首页 > 产品设计 > UI/UE

mac电脑 webpack - configuration.output.path: The provided value "./dist/" is not an absolute path!

2017-08-11 15:22 567 查看
在mac 电脑上配置webpack.json.js 中的路径时出现如下错误:

- configuration.output.path: The provided value "./dist/" is not an absolute path!



//enter入口文件也就是要打包的文件,output输出文件也就是打包成什么文件

module.exports = {

      entry:"./js/blow.js",

             

        output:{

                path:"./dist/",

                filename:"bundle.js"

        },

        module:{

                loaders:[

                        { test:/\.css$/,loader:'style-loader'},

                        { test:/\.css$/,loader:'css-loader'}

                ]

        }

}


window中这样配置是没有问题的,但是mac中就会出错了,因为mac中需要获取当前文件的路径

[b]entry:__dirname+ "/js/blow.js",添加一个——dirname或者写成blow.js的绝对路径。[/b]





内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  vue学习 webpack
相关文章推荐