设置vue打包资源路径vue-cli2

修改config/index.js,设置build选项,具体如下:


build: {
    // 设置打包后index.html的位置
    index: path.resolve(__dirname, '目标路径(相对于build/build.js)/dist/index.html'),

    // 设置打包后dist文件夹位置
    assetsRoot: path.resolve(__dirname, '目标路径(相对于build/build.js)/dist'),
    
    ...
}

 

你可能感兴趣的:(vue)