-
Notifications
You must be signed in to change notification settings - Fork 47
/
Copy pathvite.config.ts
32 lines (30 loc) · 848 Bytes
/
vite.config.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
import fg from 'fast-glob'
import { defineConfig } from 'vite'
export default defineConfig(({ command, mode }) => ({
build: {
outDir: 'shopify/assets',
assetsDir: '.',
emptyOutDir: false,
rollupOptions: {
input: ['src/entries/*.{tsx,ts,jsx,js}'],
output: {
dir: 'shopify/assets',
entryFileNames: '[name].bundle.js',
chunkFileNames: '[name].chunk.js',
assetFileNames: '[name].min.[ext]',
},
plugins: [
{
name: 'glob-input',
options(options) {
const inputs = typeof options.input === 'string' ? [options.input] : options.input
return Array.isArray(inputs)
? { ...options, input: inputs.flatMap((input) => fg.sync(input)) }
: null
},
},
],
},
},
plugins: [],
}))