mirror of
https://github.com/vitejs/vite.git
synced 2024-11-22 07:09:05 +00:00
21 lines
403 B
JavaScript
21 lines
403 B
JavaScript
import { defineConfig } from 'vite'
|
|
|
|
export default defineConfig({
|
|
plugins: [
|
|
{
|
|
name: 'post-plugin',
|
|
enforce: 'post',
|
|
resolveId(id) {
|
|
if (id.replace(/\?.*$/, '') === 'comma/foo') {
|
|
return id
|
|
}
|
|
},
|
|
load(id) {
|
|
if (id.replace(/\?.*$/, '') === 'comma/foo') {
|
|
return `export const comma = 'hi'`
|
|
}
|
|
},
|
|
},
|
|
],
|
|
})
|