build
This commit is contained in:
parent
b6aa427d6f
commit
5d15e740fc
@ -3,7 +3,15 @@ import react from '@vitejs/plugin-react';
|
|||||||
import fs from 'node:fs';
|
import fs from 'node:fs';
|
||||||
|
|
||||||
export default defineConfig(({mode}) => ({
|
export default defineConfig(({mode}) => ({
|
||||||
plugins: [react()],
|
plugins: [
|
||||||
|
react(),
|
||||||
|
mode === 'production' && {
|
||||||
|
name: 'copy-html-root',
|
||||||
|
closeBundle() {
|
||||||
|
fs.copyFileSync('dist/src/template.html', 'dist/auto_cart.html');
|
||||||
|
},
|
||||||
|
},
|
||||||
|
],
|
||||||
...(mode != 'production' && {
|
...(mode != 'production' && {
|
||||||
server: {
|
server: {
|
||||||
host: 'local.hvatilo.ru',
|
host: 'local.hvatilo.ru',
|
||||||
@ -20,5 +28,12 @@ export default defineConfig(({mode}) => ({
|
|||||||
},
|
},
|
||||||
build: {
|
build: {
|
||||||
outDir: 'dist',
|
outDir: 'dist',
|
||||||
|
rolldownOptions: {
|
||||||
|
output: {
|
||||||
|
entryFileNames: 'autocart.js',
|
||||||
|
chunkFileNames: 'chunk.js',
|
||||||
|
assetFileNames: 'plugin.css',
|
||||||
|
},
|
||||||
|
}
|
||||||
},
|
},
|
||||||
}));
|
}));
|
||||||
Loading…
Reference in New Issue
Block a user