mirror of
https://github.com/vitejs/vite.git
synced 2024-11-21 22:59:10 +00:00
29 lines
686 B
JavaScript
29 lines
686 B
JavaScript
import path from 'node:path'
|
|
import legacy from '@vitejs/plugin-legacy'
|
|
import { defineConfig } from 'vite'
|
|
|
|
export default defineConfig(({ isPreview }) => ({
|
|
base: !isPreview ? './' : '/no-polyfills-no-systemjs/',
|
|
plugins: [
|
|
legacy({
|
|
renderModernChunks: false,
|
|
polyfills: false,
|
|
externalSystemJS: true,
|
|
}),
|
|
{
|
|
name: 'remove crossorigin attribute',
|
|
transformIndexHtml: (html) => html.replaceAll('crossorigin', ''),
|
|
enforce: 'post',
|
|
},
|
|
],
|
|
|
|
build: {
|
|
outDir: 'dist/no-polyfills-no-systemjs',
|
|
rollupOptions: {
|
|
input: {
|
|
index: path.resolve(__dirname, 'no-polyfills-no-systemjs.html'),
|
|
},
|
|
},
|
|
},
|
|
}))
|