-
Notifications
You must be signed in to change notification settings - Fork 17
/
vite.config.ts
31 lines (29 loc) · 976 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
import { sveltekit } from '@sveltejs/kit/vite';
import { defineConfig } from 'vite';
import path from 'path';
import fs from 'fs';
const copyFile = function (options) {
return function () {
const targetDir = path.dirname(options.target);
if (!fs.existsSync(targetDir)){
fs.mkdirSync(targetDir);
}
fs.writeFileSync(options.target, fs.readFileSync(options.source));
console.info(` > Copied ${options.source} to ${options.target}.`);
};
}
/** @type {import('vite').UserConfig} */
export default defineConfig({
hmr: false,
plugins: [
copyFile({
source: './node_modules/bootstrap/dist/js/bootstrap.bundle.min.js',
target: './static/bootstrap.bundle.min.js',
}),
copyFile({
source: './node_modules/bootstrap/dist/js/bootstrap.bundle.min.js.map',
target: './static/bootstrap.bundle.min.js.map',
}),
sveltekit(),
],
});