yarn add type tslib rollup rollup-plugin-livereload rollup-plugin-serve rollup-plugin-terser rollup-plugin-visualizer @rollup/plugin-babel @rollup/plugin-commonjs @rollup/plugin-json @rollup/plugin-node-resolve @rollup/plugin-type @babel/core @babel/plugin-transform-runtime @babel/preset-env rimraf...
importservefrom'rollup-plugin-serve' exportdefault{ input:'src/main.js', output:{ file:'dist/bundle.js', format:... }, plugins:[ serve('dist') ] } Options By default it serves the current project folder. Change it by passing a string: ...
1、使用 rollup-plugin-serve 搭建服务 sh npm install rollup-plugin-serve -D 12、当文件发生变化时,自动刷新浏览器 sh npm install rollup-plugin-livereload -D 13、启动时,开启文件监听 sh npx rollup -c -w 1 环境区分 1、在 package.json 中创建一个开发和构建的脚本:2...
// rollup.config.jsimportservefrom'rollup-plugin-serve'exportdefault{input:'src/main.js',output:{file:'dist/bundle.js',format: ...},plugins:[serve('dist')]} Options By default it serves the current project folder. Change it by passing a string: ...
// rollup.config.jsimportservefrom'rollup-plugin-serve'exportdefault{input:'src/main.js',output:{file:'dist/bundle.js',format: ...},plugins:[serve('dist')]} Options By default it serves the current project folder. Change it by passing a string: ...
function testServeConfig(configDirname) {//实际上,下面(1)(2)两种情况是特殊的http请求,剩下的http请求都是直接向本机发送url var array = ['/app','/oauth','/status'];//(1)跨域代理:开发过程中,以这些item开始的url,将向后台服务器发送以item开始的url。这种情况主要用于获取动态数据。