forked from ruralinnovation/amplify-react-frontend
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathvite.config.js
More file actions
48 lines (46 loc) · 1.57 KB
/
Copy pathvite.config.js
File metadata and controls
48 lines (46 loc) · 1.57 KB
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
import { defineConfig } from 'vite';
import copy from '@guanghechen/rollup-plugin-copy';
import react from '@vitejs/plugin-react';
// https://vitejs.dev/config/
export default defineConfig({
build: {
rollupOptions: {
plugins: [
// Copy outputs to templates and www dirs
copy({
hook: 'writeBundle',
targets: [
{ src: [ './dist/index.html' ], dest: 'src/templates' },
{ src: [ './dist/assets' ], dest: 'src/www/' },
{ src: [ './public/*' ], dest: 'src/www/' }
]
})
]
}
},
external: [
'@aws-amplify/analytics', '@aws-amplify/api', '@aws-amplify/auth', '@aws-amplify/core', '@aws-amplify/interactions', '@aws-amplify/storage', '@aws-amplify/ui', '@aws-amplify/xr',
'aws_amplify', 'aws_amplify_react', 'aws_amplify_core',
'Buffer', 'CustomEvent', 'HTMLWidgets', 'react', 'Shiny', 'shiny', 'shinyjs'
],
plugins: [
// // Run before react() or svelte()
// copy({
// hook: 'buildStart',
// targets: [
// { src: [ './node_modules/aws-amplify/dist/aws-*' ], dest: 'public/' }
// ]
// }),
react()
],
resolve: {
alias: [
// {
// find: '@', replacement: resolve(__dirname, './src'),
// },
{
find: './runtimeConfig', replacement: './runtimeConfig.browser',
}
]
}
});