esbuild-dev-serve
v1.1.3-rc
Published
Use esbuild with a development server that provides statics and api proxy. This should be used for development only.
Downloads
6
Readme
esbuild-dev-serve
esbuild plugin for development html.
Like webpack-dev-server.
Use esbuild with a development server that provides statics and api proxy. This should be used for development only.
Install
# npm
npm install esbuild-dev-serve -D
# yarn
yarn add esbuild-dev-serve -D
Usage
Simple Setting
esbuild dev.settings.js
import esbuild from 'esbuild';
import DevServe from 'esbuild-dev-serve'
const esbuild_settings = {
... your basic esbuild settings ...
};
const serve = {
port: 3005,
servedir: 'public',
proxy: {
'/serve-api-prefix1': 'http://xxx.xxx.x.xxx:xxxx',
'/serve-api-prefix2': {
target: 'http://xxx.xxx.x.xxx:xxxx',
stream: ['/serve-api-prefix2', '/rewrite-string'],
},
}
};
DevServe(esbuild, serve, esbuild_settings);
dev-server working info logs.
proxy: {
'/serve-api-prefix1': 'http://xxx.xxx.x.xxx:xxxx',
'/serve-api-prefix2': {
target: 'http://xxx.xxx.x.xxx:xxxx',
stream: ['/serve-api-prefix2', '/rewrite-string'],
},
}
powered by Zonebond of Oneteams studio F2D (F2D is "front-end design and development" team)
author [email protected]
知乎 https://www.zhihu.com/people/zonebond/posts