Created
June 3, 2024 11:41
-
-
Save yusukebe/14e91db4ecd4b7e667041dac8ad7695d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { defineConfig } from 'vite' | |
import glob from 'glob' | |
import { terser } from 'rollup-plugin-terser' | |
const entryPoints = glob.sync('./src/**/*.ts', { | |
ignore: ['./src/**/*.test.ts', './src/test-utils/**/*.ts', './src/deno/**/*.ts'], | |
}) | |
export default defineConfig({ | |
build: { | |
target: 'es2022', | |
lib: { | |
entry: entryPoints, | |
}, | |
minify: false, | |
rollupOptions: { | |
plugins: [ | |
terser({ | |
compress: false, // 圧縮を無効にする | |
mangle: false, // 名前の難読化を無効にする | |
format: { | |
comments: false, | |
}, | |
}), | |
], | |
output: [ | |
{ | |
preserveModules: true, | |
exports: 'named', | |
dir: './dist/cjs', | |
format: 'cjs', | |
}, | |
{ | |
preserveModules: true, | |
exports: 'named', | |
dir: './dist', | |
format: 'es', | |
}, | |
], | |
}, | |
}, | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment