add alias ~platform and ~material
All checks were successful
/ depoly (push) Successful in 1m19s

This commit is contained in:
thislight 2024-11-22 17:16:56 +08:00
parent ade7df2234
commit 246771e8a0
No known key found for this signature in database
GPG key ID: FCFE5192241CCD4E
30 changed files with 143 additions and 86 deletions

View file

@ -7,6 +7,7 @@ import version from "vite-plugin-package-version";
import manifest from "./manifest.config";
import { GetManualChunk } from "rollup";
import devtools from "solid-devtools/vite";
import { resolve } from "node:path";
/**
* Put all strings (/i18n/{key}.<json|js|ts>) into separated chunks based on the key.
@ -107,6 +108,23 @@ export default defineConfig(({ mode }) => {
}),
version(),
],
resolve: {
alias: {
/* We don't allow directly acessing the source root,
because this encourage cross referencing between different
module and loose the isolation. (Cross referencing is still
possible, we don't stop it in any technical way.)
If the module is so important and is being referencing
everywhere in the app. Consider promoting it to the top
dir.
see docs/devnotes.md#module-isolation for details.
*/
"~platform": resolve(__dirname, "src/platform"),
"~material": resolve(__dirname, "src/material"),
},
},
server: {
https: serverHttpCertBase
? {