mirror of
https://github.com/devcode-it/openstamanager.git
synced 2025-03-13 09:40:18 +01:00
feat: ✨ Aggiunto parsing dei path da tsconfig.json
This commit is contained in:
parent
a92c7ce8b5
commit
d4c40be717
@ -43,7 +43,8 @@
|
||||
"opcodesio/log-viewer": "^2",
|
||||
"outhebox/blade-flags": "^1",
|
||||
"rawilk/laravel-settings": "^2",
|
||||
"tightenco/ziggy": "^1"
|
||||
"tightenco/ziggy": "^1",
|
||||
"openstamanager/attivita.tipi": "dev-main"
|
||||
},
|
||||
"require-dev": {
|
||||
"barryvdh/laravel-debugbar": "^3",
|
||||
@ -65,8 +66,7 @@
|
||||
"rector/rector": "^0",
|
||||
"roave/security-advisories": "dev-latest",
|
||||
"spatie/laravel-ignition": "^2",
|
||||
"thiagocordeiro/laravel-translator": "^1",
|
||||
"openstamanager/attivita.tipi": "dev-main"
|
||||
"thiagocordeiro/laravel-translator": "^1"
|
||||
},
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
|
@ -41,6 +41,7 @@
|
||||
"devDependencies": {
|
||||
"@maicol07/eslint-config": "^2.3.0",
|
||||
"@openstamanager/vite-config": "github:devcode-it/openstamanager-vite-config",
|
||||
"@types/fs-extra": "^11.0.1",
|
||||
"@types/lodash-es": "^4.17.7",
|
||||
"@types/mithril": "^2.0.12",
|
||||
"@types/node": "^20.1.0",
|
||||
@ -48,6 +49,7 @@
|
||||
"chokidar": "^3.5.3",
|
||||
"csstype": "^3.1.2",
|
||||
"fast-glob": "^3.2.12",
|
||||
"fs-extra": "^11.1.1",
|
||||
"inertia-plugin": "^0.6.0",
|
||||
"laravel-vite-plugin": "^0.7.4",
|
||||
"postcss": "^8.4.23",
|
||||
|
28
pnpm-lock.yaml
generated
28
pnpm-lock.yaml
generated
@ -72,6 +72,9 @@ devDependencies:
|
||||
'@openstamanager/vite-config':
|
||||
specifier: github:devcode-it/openstamanager-vite-config
|
||||
version: github.com/devcode-it/openstamanager-vite-config/819ac61e3ad6ef6e22d5b09b411c6f935fa3b1a1(@types/node@20.1.0)(sass@1.62.1)
|
||||
'@types/fs-extra':
|
||||
specifier: ^11.0.1
|
||||
version: 11.0.1
|
||||
'@types/lodash-es':
|
||||
specifier: ^4.17.7
|
||||
version: 4.17.7
|
||||
@ -93,6 +96,9 @@ devDependencies:
|
||||
fast-glob:
|
||||
specifier: ^3.2.12
|
||||
version: 3.2.12
|
||||
fs-extra:
|
||||
specifier: ^11.1.1
|
||||
version: 11.1.1
|
||||
inertia-plugin:
|
||||
specifier: ^0.6.0
|
||||
version: 0.6.0
|
||||
@ -2394,6 +2400,13 @@ packages:
|
||||
resolution: {integrity: sha512-WulqXMDUTYAXCjZnk6JtIHPigp55cVtDgDrO2gHRwhyJto21+1zbVCtOYB2L1F9w4qCQ0rOGWBnBe0FNTiEJIQ==}
|
||||
dev: true
|
||||
|
||||
/@types/fs-extra@11.0.1:
|
||||
resolution: {integrity: sha512-MxObHvNl4A69ofaTRU8DFqvgzzv8s9yRtaPPm5gud9HDNvpB3GPQFvNuTWAI59B9huVGV5jXYJwbCsmBsOGYWA==}
|
||||
dependencies:
|
||||
'@types/jsonfile': 6.1.1
|
||||
'@types/node': 20.1.0
|
||||
dev: true
|
||||
|
||||
/@types/history@4.7.11:
|
||||
resolution: {integrity: sha512-qjDJRrmvBMiTx+jyLxvLfJU7UznFuokDv4f3WRuriHKERccVpFU+8XMQUAbDzoiJCsmexxRExQeMwwCdamSKDA==}
|
||||
dev: true
|
||||
@ -2406,6 +2419,12 @@ packages:
|
||||
resolution: {integrity: sha512-dRLjCWHYg4oaA77cxO64oO+7JwCwnIzkZPdrrC71jQmQtlhM556pwKo5bUzqvZndkVbeFLIIi+9TC40JNF5hNQ==}
|
||||
dev: true
|
||||
|
||||
/@types/jsonfile@6.1.1:
|
||||
resolution: {integrity: sha512-GSgiRCVeapDN+3pqA35IkQwasaCh/0YFH5dEF6S88iDvEn901DjOeH3/QPY+XYP1DFzDZPvIvfeEgk+7br5png==}
|
||||
dependencies:
|
||||
'@types/node': 20.1.0
|
||||
dev: true
|
||||
|
||||
/@types/lodash-es@4.17.7:
|
||||
resolution: {integrity: sha512-z0ptr6UI10VlU6l5MYhGwS4mC8DZyYer2mCoyysZtSF7p26zOX8UpbrV0YpNYLGS8K4PUFIyEr62IMFFjveSiQ==}
|
||||
dependencies:
|
||||
@ -4069,6 +4088,15 @@ packages:
|
||||
resolution: {integrity: sha512-MhLuK+2gUcnZe8ZHlaaINnQLl0xRIGRfcGk2yl8xoQAfHrSsL3rYu6FCmBdkdbhc9EPlwyGHewaRsvwRMJtAlA==}
|
||||
dev: true
|
||||
|
||||
/fs-extra@11.1.1:
|
||||
resolution: {integrity: sha512-MGIE4HOvQCeUCzmlHs0vXpih4ysz4wg9qiSAu6cd42lVwPbTM1TjV7RusoyQqMmk/95gdQZX72u+YW+c3eEpFQ==}
|
||||
engines: {node: '>=14.14'}
|
||||
dependencies:
|
||||
graceful-fs: 4.2.11
|
||||
jsonfile: 6.1.0
|
||||
universalify: 2.0.0
|
||||
dev: true
|
||||
|
||||
/fs-extra@9.1.0:
|
||||
resolution: {integrity: sha512-hcg3ZmepS30/7BSFqRvoo3DOMQu7IjqxO5nCDt+zM9XWjb33Wg7ziNT+Qvqbuc3+gWpzO02JubVyk2G4Zvo1OQ==}
|
||||
engines: {node: '>=10'}
|
||||
|
@ -1,8 +1,15 @@
|
||||
/* eslint-disable import/no-extraneous-dependencies,new-cap */
|
||||
import {resolve} from 'node:path';
|
||||
|
||||
import FastGlob from 'fast-glob';
|
||||
import {readJSON} from 'fs-extra';
|
||||
import Inertia from 'inertia-plugin/vite';
|
||||
import laravel from 'laravel-vite-plugin';
|
||||
import {defineConfig} from 'vite';
|
||||
import type {TsConfigJson} from 'type-fest';
|
||||
import {
|
||||
AliasOptions,
|
||||
defineConfig
|
||||
} from 'vite';
|
||||
import laravelTranslations from 'vite-plugin-laravel-translations';
|
||||
// import progress from 'vite-plugin-progress';
|
||||
import {VitePWA} from 'vite-plugin-pwa';
|
||||
@ -14,6 +21,30 @@ const modules = installedPackages.packages.filter((packageInfo) => packageInfo.t
|
||||
// noinspection JSUnusedGlobalSymbols
|
||||
export default defineConfig(async () => {
|
||||
const bootstrapFiles = await FastGlob('./vendor/*/*/resources/ts/bootstrap.{tsx,ts,jsx,js}');
|
||||
|
||||
// Load module aliases from tsconfig.json
|
||||
const aliases: AliasOptions = {
|
||||
'@osm': '/resources/ts'
|
||||
};
|
||||
|
||||
const mods = modules.map(async (module) => {
|
||||
const modulePath = `./vendor/composer/${module['install-path']!}`;
|
||||
return {
|
||||
modulePath,
|
||||
tsconfig: await readJSON(`${modulePath}/tsconfig.json`, 'utf8') as TsConfigJson
|
||||
};
|
||||
});
|
||||
for await (const module of mods) {
|
||||
const paths = module.tsconfig.compilerOptions?.paths;
|
||||
if (paths) {
|
||||
for (const [alias, path] of Object.entries(paths)) {
|
||||
if (alias !== '@osm/*') {
|
||||
aliases[alias.replace('/*', '')] = resolve(`${module.modulePath}/${path[0]}`);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return {
|
||||
assetsInclude: '**/*.xml',
|
||||
build: {
|
||||
@ -21,9 +52,7 @@ export default defineConfig(async () => {
|
||||
target: 'esnext'
|
||||
},
|
||||
resolve: {
|
||||
alias: {
|
||||
'@osm': '/resources/ts'
|
||||
}
|
||||
alias: aliases
|
||||
},
|
||||
esbuild: {
|
||||
jsx: 'transform',
|
||||
|
Loading…
x
Reference in New Issue
Block a user