-
Notifications
You must be signed in to change notification settings - Fork 73
/
vite.config.js
58 lines (57 loc) · 1.87 KB
/
vite.config.js
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
49
50
51
52
53
54
55
56
57
58
import { defineConfig, loadEnv } from 'vite';
import laravel from 'laravel-vite-plugin';
import vue from '@vitejs/plugin-vue2';
import * as path from 'path';
import ignoreImport from 'rollup-plugin-ignore-import';
import { splitVendorChunkPlugin } from 'vite';
export default defineConfig(({ mode, command }) => {
const env = loadEnv(mode, path.join(process.cwd(), '/demo'), '');
return {
base: (command === "build" ? '/vendor/sharp' : ""),
envDir: path.join(process.cwd(), '/demo'),
build: {
outDir: 'resources/assets/dist',
commonjsOptions: {
requireReturnsDefault: 'preferred'
},
},
resolve: {
alias: {
'vue': 'vue/dist/vue.esm.js',
}
},
plugins: [
splitVendorChunkPlugin(),
laravel({
input: [
'resources/assets/js/sharp.js',
'resources/assets/js/client-api.js',
'resources/assets/sass/app.scss',
'resources/assets/sass/vendors.scss',
],
publicDirectory: 'resources/assets/dist',
refresh: true,
detectTls: env.APP_URL?.startsWith('https')
? env.APP_URL.replace('https://', '')
: null,
}),
vue({
template: {
transformAssetUrls: {
base: null,
includeAbsolute: false,
},
},
}),
ignoreImport({
include: [
/moment\/locale\/(?!fr\.js$).*\.js$/,
/bootstrap-vue\/esm\/(icons\/icons)/,
],
// exclude: [
//
// ],
}),
],
}
});