-
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathvite.plugin.js
More file actions
30 lines (28 loc) · 977 Bytes
/
vite.plugin.js
File metadata and controls
30 lines (28 loc) · 977 Bytes
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
import { resolve } from 'path';
export default function AuthPlugin() {
const pluginPath = resolve(__dirname);
return {
name: 'auth-plugin',
config: () => ({
build: {
rollupOptions: {
input: {
'auth': resolve(pluginPath, 'resources/js/app.js'),
},
output: {
entryFileNames: 'js/[name].js',
chunkFileNames: 'js/[name].js',
assetFileNames: (assetInfo) => {
if (assetInfo.name.endsWith('.css')) {
return 'css/[name][extname]';
}
return 'assets/[name][extname]';
},
},
},
outDir: resolve(pluginPath, 'dist'),
emptyOutDir: true,
},
}),
};
}