mirror of
https://github.com/solidtime-io/solidtime.git
synced 2026-08-16 04:02:15 +01:00
add support for extension vite plugin loading, add vue setup hook for extensions
This commit is contained in:
@@ -2,33 +2,49 @@ import { defineConfig } from 'vite';
|
||||
import laravel from 'laravel-vite-plugin';
|
||||
import vue from '@vitejs/plugin-vue';
|
||||
import checker from 'vite-plugin-checker';
|
||||
import {
|
||||
collectModuleAssetsPaths,
|
||||
collectModulePlugins,
|
||||
} from './vite-module-loader.js';
|
||||
|
||||
export default defineConfig({
|
||||
plugins: [
|
||||
laravel({
|
||||
input: 'resources/js/app.ts',
|
||||
refresh: true,
|
||||
}),
|
||||
vue({
|
||||
template: {
|
||||
transformAssetUrls: {
|
||||
base: null,
|
||||
includeAbsolute: false,
|
||||
},
|
||||
},
|
||||
}),
|
||||
checker({
|
||||
// e.g. use TypeScript check
|
||||
typescript: true,
|
||||
vueTsc: true,
|
||||
lintCommand: 'eslint "./**/*.{ts,vue}"',
|
||||
}),
|
||||
],
|
||||
server: {
|
||||
host: true,
|
||||
hmr: {
|
||||
host: process.env.VITE_HOST_NAME,
|
||||
clientPort: 80,
|
||||
async function getConfig() {
|
||||
const paths = ['resources/js/app.ts'];
|
||||
const modulePaths = await collectModuleAssetsPaths('extensions');
|
||||
const additionalPlugins = await collectModulePlugins('extensions');
|
||||
|
||||
return defineConfig({
|
||||
build: {
|
||||
sourcemap: true, // Source map generation must be turned on
|
||||
},
|
||||
},
|
||||
});
|
||||
plugins: [
|
||||
laravel({
|
||||
input: [...paths, ...modulePaths],
|
||||
refresh: true,
|
||||
}),
|
||||
vue({
|
||||
template: {
|
||||
transformAssetUrls: {
|
||||
base: null,
|
||||
includeAbsolute: false,
|
||||
},
|
||||
},
|
||||
}),
|
||||
checker({
|
||||
// e.g. use TypeScript check
|
||||
typescript: true,
|
||||
vueTsc: true,
|
||||
lintCommand: 'eslint "./**/*.{ts,vue}"',
|
||||
}),
|
||||
...additionalPlugins,
|
||||
],
|
||||
server: {
|
||||
host: true,
|
||||
hmr: {
|
||||
host: process.env.VITE_HOST_NAME,
|
||||
clientPort: 80,
|
||||
},
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
export default getConfig();
|
||||
|
||||
Reference in New Issue
Block a user