1.在vue.config.js文件中引入copy-webpack-plugin插件
const CopyWebpackPlugin = require(''copy-webpack-plugin'');
2.在module.exports中配置方法
plugins: [ new CopyWebpackPlugin([ { from: path.join(__dirname, ''src/root/logo.ico''), to: path.join(__dirname, ''./dist'') }, { from: path.join(__dirname, ''src/root/robots.txt''), to: path.join(__dirname, ''./dist'') } ]) ]
其中的参数: