Skip to content

Colourlessglow/preview-serve

Repository files navigation

preview-serve

npm version npm downloads bundle size install size license

JSR JSR Score JSR Scope

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,
  /**
   * web 打包目录
   */
  dist: 'dist',
  proxy: {
    /**
     * 代理配置,详见 [httpxy](https://github.com/unjs/httpxy)
     */
    '/gh': {
      target: ' https://ungh.cc',
      changeOrigin: true,
    }
  }
})

命令

preview-serve --dist dist

贡献者

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


🤖 auto updated with automd

About

web打包目录预览服务

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published