Skip to content

0.0.1

Choose a tag to compare

@Colourlessglow Colourlessglow released this 21 May 16:41
· 21 commits to main since this release

preview-serve

npm version
npm downloads
bundle size
install size
license

web打包目录预览服务

安装

# ✨ Auto-detect
npx nypm install preview-serve

# npm
npm install preview-serve

# yarn
yarn add preview-serve

# pnpm
pnpm install preview-serve

# bun
bun install preview-serve

# deno
deno install preview-serve

配置

import { defineConfig } from 'preview-serve'

export default defineConfig({
  /**
   * 服务监听地址
   */
  hostname: '127.0.0.1',
  /**
   * 服务监听端口
   */
  port: 3000,
  /**
   * 服务基础路径
   */
  base: '/',
  /**
   * web 打包目录
   */
  dist: 'dist',
  proxy: {
    /**
     * 代理配置,详见 [httpxy](https://github.com/unjs/httpxy)
     */
    '/gh': {
      target: ' https://ungh.cc',
      changeOrigin: true,
    }
  }
})

命令

preview-serve --dist dist --base /

贡献者

Published under the MIT license.
Made by @Colourlessglow and community 💛






🤖 auto updated with automd