UNPKG

ewuit

Version:

an easy web ui inspect tool

50 lines (47 loc) 1.02 kB
const path = require('path'); const typescript = require('@rollup/plugin-typescript'); const { defineConfig } = require('vite'); const libName = 'Ewuit'; const bundlePrefix = 'index'; // 入口 const entry = path.resolve(__dirname, 'src/index.ts'); module.exports = defineConfig({ resolve: { alias: { '@': path.resolve(__dirname, 'src'), }, }, plugins: [ typescript({ target: 'es5', include: ['src/**/*.ts'], esModuleInterop: true, module: 'esnext', }), ], build: { sourcemap: true, outDir: 'dist', minify: process.env.NODE_ENV === 'production', lib: { entry, name: libName, formats: ['umd', 'cjs', 'es'], fileName: (format) => { if (format === 'umd') { return `${bundlePrefix}.min.js`; } return `${bundlePrefix}.${format}.js`; }, }, rollupOptions: { input: entry, output: { exports: 'auto', }, }, }, server: { host: '0.0.0.0', }, });