live-server 使用
1.全局安装 :npm i live-server -g
2.进入项目:npm run build 进行打包
3.进入dist文件:cd dist
4.运行:live-server --entry-file=/
rollup-plugin-copy 插件使用
1.安装:npm i rollup-plugin-copy
2.进入vite.config.js文件中引入:
import copy from 'rollup-plugin-copy'
plugins: [
copy({
targets: [
{ src: './node_modules/@easydarwin/easyplayer/dist/component/EasyPlayer.swf', dest: './libs/EasyPlayer/' },
{ src: './node_modules/@easydarwin/easyplayer/dist/component/crossdomain.xml', dest: './libs/EasyPlayer/' },
{
src: './node_modules/@easydarwin/easyplayer/dist/component/EasyPlayer-lib.min.js',
dest: './libs/EasyPlayer/'
}
]
})
]
提示:src中是来源地址,dest是copy到那个位置