one 1.1.310 → 1.1.312
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/cjs/Root.cjs +2 -1
- package/dist/cjs/Root.cjs.map +1 -1
- package/dist/cjs/Root.native.js +2 -2
- package/dist/cjs/Root.native.js.map +2 -2
- package/dist/cjs/cleanUrl.cjs +3 -8
- package/dist/cjs/cleanUrl.cjs.map +2 -2
- package/dist/cjs/cleanUrl.native.js +5 -8
- package/dist/cjs/cleanUrl.native.js.map +2 -2
- package/dist/cjs/cli.cjs +0 -2
- package/dist/cjs/cli.cjs.map +1 -1
- package/dist/cjs/cli.native.js +1 -2
- package/dist/cjs/cli.native.js.map +2 -2
- package/dist/cjs/config.cjs +1 -1
- package/dist/cjs/config.native.js +1 -1
- package/dist/cjs/config.native.js.map +1 -1
- package/dist/cjs/constants.cjs +9 -1
- package/dist/cjs/constants.cjs.map +1 -1
- package/dist/cjs/constants.native.js +9 -1
- package/dist/cjs/constants.native.js.map +2 -2
- package/dist/cjs/createApp.native.cjs +1 -1
- package/dist/cjs/createApp.native.js +1 -1
- package/dist/cjs/createApp.native.js.map +1 -1
- package/dist/cjs/createHandleRequest.cjs +3 -1
- package/dist/cjs/createHandleRequest.cjs.map +1 -1
- package/dist/cjs/createHandleRequest.native.js +3 -2
- package/dist/cjs/createHandleRequest.native.js.map +2 -2
- package/dist/cjs/getURL.cjs +1 -1
- package/dist/cjs/matchers.cjs +1 -1
- package/dist/cjs/matchers.cjs.map +1 -1
- package/dist/cjs/matchers.native.js +1 -1
- package/dist/cjs/matchers.native.js.map +1 -1
- package/dist/cjs/serve.cjs +3 -3
- package/dist/cjs/serve.cjs.map +1 -1
- package/dist/cjs/serve.native.js +2 -2
- package/dist/cjs/serve.native.js.map +2 -2
- package/dist/cjs/useLoader.cjs +1 -1
- package/dist/cjs/useLoader.native.js +1 -1
- package/dist/cjs/vite/build.cjs +2 -2
- package/dist/cjs/vite/build.cjs.map +1 -1
- package/dist/cjs/vite/build.native.js +1 -1
- package/dist/cjs/vite/build.native.js.map +1 -1
- package/dist/cjs/vite/clientTreeShakePlugin.cjs +1 -1
- package/dist/cjs/vite/clientTreeShakePlugin.native.js +1 -1
- package/dist/cjs/vite/createFileSystemRouter.cjs +1 -1
- package/dist/cjs/vite/createFileSystemRouter.native.js +1 -1
- package/dist/cjs/vite/one.cjs +43 -14
- package/dist/cjs/vite/one.cjs.map +1 -1
- package/dist/cjs/vite/one.native.js +39 -12
- package/dist/cjs/vite/one.native.js.map +2 -2
- package/dist/cjs/vite/virtualEntryPlugin.cjs +5 -5
- package/dist/cjs/vite/virtualEntryPlugin.native.js +5 -5
- package/dist/cjs/vite/virtualEntryPlugin.native.js.map +1 -1
- package/dist/cjs/vite/vitePluginSsrCss.cjs +1 -1
- package/dist/cjs/vite/vitePluginSsrCss.native.js +1 -1
- package/dist/esm/Root.js +2 -1
- package/dist/esm/Root.js.map +1 -1
- package/dist/esm/Root.mjs +2 -1
- package/dist/esm/Root.mjs.map +1 -1
- package/dist/esm/Root.native.js +2 -1
- package/dist/esm/Root.native.js.map +2 -2
- package/dist/esm/cleanUrl.js +10 -9
- package/dist/esm/cleanUrl.js.map +1 -1
- package/dist/esm/cleanUrl.mjs +4 -9
- package/dist/esm/cleanUrl.mjs.map +1 -1
- package/dist/esm/cleanUrl.native.js +5 -9
- package/dist/esm/cleanUrl.native.js.map +2 -2
- package/dist/esm/cli.js +0 -2
- package/dist/esm/cli.js.map +1 -1
- package/dist/esm/cli.mjs +0 -2
- package/dist/esm/cli.mjs.map +1 -1
- package/dist/esm/cli.native.js +0 -2
- package/dist/esm/cli.native.js.map +2 -2
- package/dist/esm/config.js +1 -1
- package/dist/esm/config.mjs +1 -1
- package/dist/esm/config.mjs.map +1 -1
- package/dist/esm/config.native.js +1 -1
- package/dist/esm/config.native.js.map +1 -1
- package/dist/esm/constants.js +5 -1
- package/dist/esm/constants.js.map +1 -1
- package/dist/esm/constants.mjs +6 -2
- package/dist/esm/constants.mjs.map +1 -1
- package/dist/esm/constants.native.js +5 -1
- package/dist/esm/constants.native.js.map +2 -2
- package/dist/esm/createApp.native.js +1 -1
- package/dist/esm/createApp.native.js.map +1 -1
- package/dist/esm/createHandleRequest.js +3 -1
- package/dist/esm/createHandleRequest.js.map +1 -1
- package/dist/esm/createHandleRequest.mjs +3 -1
- package/dist/esm/createHandleRequest.mjs.map +1 -1
- package/dist/esm/createHandleRequest.native.js +3 -1
- package/dist/esm/createHandleRequest.native.js.map +2 -2
- package/dist/esm/getURL.js +1 -1
- package/dist/esm/getURL.mjs +1 -1
- package/dist/esm/matchers.js +1 -1
- package/dist/esm/matchers.js.map +1 -1
- package/dist/esm/matchers.mjs +1 -1
- package/dist/esm/matchers.mjs.map +1 -1
- package/dist/esm/matchers.native.js +1 -1
- package/dist/esm/matchers.native.js.map +1 -1
- package/dist/esm/serve.js +4 -4
- package/dist/esm/serve.js.map +1 -1
- package/dist/esm/serve.mjs +4 -4
- package/dist/esm/serve.mjs.map +1 -1
- package/dist/esm/serve.native.js +4 -4
- package/dist/esm/serve.native.js.map +2 -2
- package/dist/esm/useLoader.js +1 -1
- package/dist/esm/useLoader.mjs +1 -1
- package/dist/esm/useLoader.native.js +1 -1
- package/dist/esm/vite/build.js +1 -1
- package/dist/esm/vite/build.js.map +1 -1
- package/dist/esm/vite/build.mjs +1 -1
- package/dist/esm/vite/build.mjs.map +1 -1
- package/dist/esm/vite/build.native.js +1 -1
- package/dist/esm/vite/build.native.js.map +2 -2
- package/dist/esm/vite/clientTreeShakePlugin.js +1 -1
- package/dist/esm/vite/clientTreeShakePlugin.mjs +1 -1
- package/dist/esm/vite/clientTreeShakePlugin.native.js +1 -1
- package/dist/esm/vite/createFileSystemRouter.js +1 -1
- package/dist/esm/vite/createFileSystemRouter.mjs +1 -1
- package/dist/esm/vite/createFileSystemRouter.native.js +1 -1
- package/dist/esm/vite/one.js +43 -14
- package/dist/esm/vite/one.js.map +1 -1
- package/dist/esm/vite/one.mjs +43 -14
- package/dist/esm/vite/one.mjs.map +1 -1
- package/dist/esm/vite/one.native.js +41 -14
- package/dist/esm/vite/one.native.js.map +2 -2
- package/dist/esm/vite/virtualEntryPlugin.js +5 -5
- package/dist/esm/vite/virtualEntryPlugin.mjs +5 -5
- package/dist/esm/vite/virtualEntryPlugin.mjs.map +1 -1
- package/dist/esm/vite/virtualEntryPlugin.native.js +5 -5
- package/dist/esm/vite/virtualEntryPlugin.native.js.map +1 -1
- package/dist/esm/vite/vitePluginSsrCss.js +1 -1
- package/dist/esm/vite/vitePluginSsrCss.mjs +1 -1
- package/dist/esm/vite/vitePluginSsrCss.native.js +1 -1
- package/package.json +8 -8
- package/src/Root.tsx +2 -1
- package/src/cleanUrl.ts +10 -14
- package/src/cli.ts +0 -3
- package/src/config.ts +1 -1
- package/src/constants.ts +6 -0
- package/src/createApp.native.tsx +2 -2
- package/src/createHandleRequest.ts +7 -1
- package/src/getURL.ts +1 -1
- package/src/matchers.ts +1 -1
- package/src/serve.ts +5 -3
- package/src/useLoader.ts +1 -1
- package/src/vite/build.ts +2 -1
- package/src/vite/clientTreeShakePlugin.ts +1 -1
- package/src/vite/createFileSystemRouter.tsx +1 -1
- package/src/vite/one.ts +44 -11
- package/src/vite/virtualEntryPlugin.ts +5 -5
- package/src/vite/vitePluginSsrCss.ts +1 -1
- package/types/Root.d.ts.map +1 -1
- package/types/cleanUrl.d.ts.map +1 -1
- package/types/constants.d.ts +4 -0
- package/types/constants.d.ts.map +1 -1
- package/types/createHandleRequest.d.ts.map +1 -1
- package/types/serve.d.ts.map +1 -1
- package/types/vite/build.d.ts.map +1 -1
- package/types/vite/one.d.ts.map +1 -1
- package/dist/cjs/router/constants.cjs +0 -26
- package/dist/cjs/router/constants.cjs.map +0 -6
- package/dist/cjs/router/constants.native.js +0 -26
- package/dist/cjs/router/constants.native.js.map +0 -6
- package/dist/cjs/vite/loadEnv.cjs +0 -47
- package/dist/cjs/vite/loadEnv.cjs.map +0 -6
- package/dist/cjs/vite/loadEnv.native.js +0 -44
- package/dist/cjs/vite/loadEnv.native.js.map +0 -6
- package/dist/esm/router/constants.js +0 -5
- package/dist/esm/router/constants.js.map +0 -6
- package/dist/esm/router/constants.mjs +0 -3
- package/dist/esm/router/constants.mjs.map +0 -1
- package/dist/esm/router/constants.native.js +0 -5
- package/dist/esm/router/constants.native.js.map +0 -6
- package/dist/esm/vite/loadEnv.js +0 -13
- package/dist/esm/vite/loadEnv.js.map +0 -6
- package/dist/esm/vite/loadEnv.mjs +0 -13
- package/dist/esm/vite/loadEnv.mjs.map +0 -1
- package/dist/esm/vite/loadEnv.native.js +0 -16
- package/dist/esm/vite/loadEnv.native.js.map +0 -6
- package/src/router/constants.ts +0 -4
- package/src/vite/loadEnv.ts +0 -11
- package/types/router/constants.d.ts +0 -2
- package/types/router/constants.d.ts.map +0 -1
- package/types/vite/loadEnv.d.ts +0 -2
- package/types/vite/loadEnv.d.ts.map +0 -1
package/src/vite/build.ts
CHANGED
@@ -13,13 +13,13 @@ import {
|
|
13
13
|
type ClientManifestEntry,
|
14
14
|
} from 'vxrn'
|
15
15
|
import { getLoaderPath, getPreloadPath } from '../cleanUrl'
|
16
|
+
import { labelProcess } from '../cli/label-process'
|
16
17
|
import type { RouteInfo } from '../server/createRoutesManifest'
|
17
18
|
import type { LoaderProps, RenderApp } from '../types'
|
18
19
|
import { getManifest } from './getManifest'
|
19
20
|
import { loadUserOneOptions } from './one'
|
20
21
|
import { replaceLoader } from './replaceLoader'
|
21
22
|
import type { One } from './types'
|
22
|
-
import { labelProcess } from '../cli/label-process'
|
23
23
|
|
24
24
|
const { ensureDir, readFile, outputFile } = FSExtra
|
25
25
|
|
@@ -32,6 +32,7 @@ export async function build(args: {
|
|
32
32
|
only?: string
|
33
33
|
}) {
|
34
34
|
labelProcess('build')
|
35
|
+
|
35
36
|
const userOptions = await loadUserOneOptions('build')
|
36
37
|
const serverOutputFormat = userOptions.build?.server?.outputFormat ?? 'esm'
|
37
38
|
|
package/src/vite/one.ts
CHANGED
@@ -1,17 +1,17 @@
|
|
1
|
+
import { resolvePath } from '@vxrn/resolve'
|
1
2
|
import events from 'node:events'
|
2
3
|
import path, { dirname, resolve } from 'node:path'
|
3
4
|
import { type Plugin, type PluginOption, type UserConfig, loadConfigFromFile } from 'vite'
|
4
5
|
import tsconfigPaths from 'vite-tsconfig-paths'
|
5
|
-
import { getOptimizeDeps, getOptionsFilled, isWebEnvironment } from 'vxrn'
|
6
|
+
import { getOptimizeDeps, getOptionsFilled, isWebEnvironment, loadEnv } from 'vxrn'
|
7
|
+
import { CACHE_KEY } from '../constants'
|
6
8
|
import '../polyfills-server'
|
7
9
|
import { existsAsync } from '../utils/existsAsync'
|
8
|
-
import { resolvePath } from '@vxrn/resolve'
|
9
10
|
import { clientTreeShakePlugin } from './clientTreeShakePlugin'
|
10
11
|
import { createFileSystemRouter } from './createFileSystemRouter'
|
11
12
|
import { ensureTSConfig } from './ensureTsConfig'
|
12
13
|
import { fixDependenciesPlugin } from './fixDependenciesPlugin'
|
13
14
|
import { generateTypesForRoutes } from './generateTypesForRoutes'
|
14
|
-
import { loadEnv } from './loadEnv'
|
15
15
|
import type { One } from './types'
|
16
16
|
import { createVirtualEntry, virtualEntryId } from './virtualEntryPlugin'
|
17
17
|
import { vitePluginSsrCss } from './vitePluginSsrCss'
|
@@ -24,8 +24,6 @@ globalThis.__vxrnEnableNativeEnv = true
|
|
24
24
|
export function one(options: One.PluginOptions = {}): PluginOption {
|
25
25
|
oneOptions = options
|
26
26
|
|
27
|
-
void loadEnv(process.cwd())
|
28
|
-
|
29
27
|
// ensure tsconfig
|
30
28
|
if (options.config?.ensureTSConfig !== false) {
|
31
29
|
void ensureTSConfig()
|
@@ -46,7 +44,18 @@ export function one(options: One.PluginOptions = {}): PluginOption {
|
|
46
44
|
|
47
45
|
const vxrnOptions = getOptionsFilled()
|
48
46
|
|
47
|
+
const { clientEnvDefine } = loadEnv(vxrnOptions?.mode ?? 'development')
|
48
|
+
|
49
49
|
const devAndProdPlugins = [
|
50
|
+
{
|
51
|
+
name: 'one-define-env',
|
52
|
+
config() {
|
53
|
+
return {
|
54
|
+
define: clientEnvDefine,
|
55
|
+
}
|
56
|
+
},
|
57
|
+
},
|
58
|
+
|
50
59
|
// proxy because you cant add a plugin inside a plugin
|
51
60
|
new Proxy(
|
52
61
|
{
|
@@ -126,16 +135,20 @@ export function one(options: One.PluginOptions = {}): PluginOption {
|
|
126
135
|
return {
|
127
136
|
define: {
|
128
137
|
...(options.web?.defaultRenderMode && {
|
129
|
-
'process.env.
|
138
|
+
'process.env.ONE_DEFAULT_RENDER_MODE': JSON.stringify(options.web.defaultRenderMode),
|
139
|
+
'import.meta.env.ONE_DEFAULT_RENDER_MODE': JSON.stringify(
|
140
|
+
options.web.defaultRenderMode
|
141
|
+
),
|
130
142
|
}),
|
131
143
|
|
132
144
|
...(options.setupFile && {
|
133
|
-
'process.env.
|
145
|
+
'process.env.ONE_SETUP_FILE': JSON.stringify(options.setupFile),
|
134
146
|
}),
|
135
147
|
|
136
148
|
...(process.env.NODE_ENV !== 'production' &&
|
137
149
|
vxrnOptions && {
|
138
150
|
'process.env.ONE_SERVER_URL': JSON.stringify(vxrnOptions.server.url),
|
151
|
+
'import.meta.env.ONE_SERVER_URL': JSON.stringify(vxrnOptions.server.url),
|
139
152
|
}),
|
140
153
|
},
|
141
154
|
|
@@ -143,12 +156,28 @@ export function one(options: One.PluginOptions = {}): PluginOption {
|
|
143
156
|
client: {
|
144
157
|
define: {
|
145
158
|
'process.env.VITE_ENVIRONMENT': '"client"',
|
159
|
+
'import.meta.env.VITE_ENVIRONMENT': '"client"',
|
146
160
|
},
|
147
161
|
},
|
148
162
|
|
149
163
|
ssr: {
|
150
164
|
define: {
|
151
165
|
'process.env.VITE_ENVIRONMENT': '"ssr"',
|
166
|
+
'import.meta.env.VITE_ENVIRONMENT': '"ssr"',
|
167
|
+
},
|
168
|
+
},
|
169
|
+
|
170
|
+
ios: {
|
171
|
+
define: {
|
172
|
+
'process.env.VITE_ENVIRONMENT': '"ios"',
|
173
|
+
'import.meta.env.VITE_ENVIRONMENT': '"ios"',
|
174
|
+
},
|
175
|
+
},
|
176
|
+
|
177
|
+
android: {
|
178
|
+
define: {
|
179
|
+
'process.env.VITE_ENVIRONMENT': '"android"',
|
180
|
+
'import.meta.env.VITE_ENVIRONMENT': '"android"',
|
152
181
|
},
|
153
182
|
},
|
154
183
|
},
|
@@ -232,7 +261,7 @@ export function one(options: One.PluginOptions = {}): PluginOption {
|
|
232
261
|
}),
|
233
262
|
|
234
263
|
{
|
235
|
-
name: 'define-
|
264
|
+
name: 'one-define-environment',
|
236
265
|
config() {
|
237
266
|
if (!options.app?.key) {
|
238
267
|
return
|
@@ -240,14 +269,18 @@ export function one(options: One.PluginOptions = {}): PluginOption {
|
|
240
269
|
|
241
270
|
return {
|
242
271
|
define: {
|
243
|
-
'process.env.
|
272
|
+
'process.env.ONE_APP_NAME': JSON.stringify(options.app.key),
|
273
|
+
'import.meta.env.ONE_APP_NAME': JSON.stringify(options.app.key),
|
274
|
+
|
275
|
+
'process.env.ONE_CACHE_KEY': JSON.stringify(CACHE_KEY),
|
276
|
+
'import.meta.env.ONE_CACHE_KEY': JSON.stringify(CACHE_KEY),
|
244
277
|
},
|
245
278
|
}
|
246
279
|
},
|
247
280
|
} satisfies Plugin,
|
248
281
|
|
249
282
|
{
|
250
|
-
name: 'use-react-18-for-native',
|
283
|
+
name: 'one-use-react-18-for-native',
|
251
284
|
enforce: 'pre',
|
252
285
|
|
253
286
|
async config() {
|
@@ -275,7 +308,7 @@ export function one(options: One.PluginOptions = {}): PluginOption {
|
|
275
308
|
} satisfies Plugin,
|
276
309
|
|
277
310
|
{
|
278
|
-
name: 'optimize-deps-load-web-extensions',
|
311
|
+
name: 'one-optimize-deps-load-web-extensions',
|
279
312
|
enforce: 'pre',
|
280
313
|
|
281
314
|
applyToEnvironment(environment) {
|
@@ -10,9 +10,9 @@ const virtualEntryIdNativeName = `${virtualEntryIdName}-native`
|
|
10
10
|
export const virtualEntryIdNative = `virtual:${virtualEntryIdNativeName}`
|
11
11
|
const resolvedVirtualEntryIdNative = '\0' + virtualEntryIdNativeName
|
12
12
|
|
13
|
-
const
|
14
|
-
if (process.env.
|
15
|
-
import(/* @vite-ignore */ process.env.
|
13
|
+
const USE_ONE_SETUP_FILE = `
|
14
|
+
if (process.env.ONE_SETUP_FILE) {
|
15
|
+
import(/* @vite-ignore */ process.env.ONE_SETUP_FILE)
|
16
16
|
}
|
17
17
|
`
|
18
18
|
|
@@ -36,7 +36,7 @@ export function createVirtualEntry(options: { root: string }): Plugin {
|
|
36
36
|
if (id === resolvedVirtualEntryId) {
|
37
37
|
const prependCode = isNativeEnvironment(this.environment)
|
38
38
|
? '' /* `import()` will not work on native */
|
39
|
-
:
|
39
|
+
: USE_ONE_SETUP_FILE
|
40
40
|
return `
|
41
41
|
${prependCode}
|
42
42
|
|
@@ -52,7 +52,7 @@ export default createApp({
|
|
52
52
|
if (id === resolvedVirtualEntryIdNative) {
|
53
53
|
const prependCode = isNativeEnvironment(this.environment)
|
54
54
|
? '' /* `import()` will not work on native */
|
55
|
-
:
|
55
|
+
: USE_ONE_SETUP_FILE
|
56
56
|
return `
|
57
57
|
${prependCode}
|
58
58
|
|
@@ -12,7 +12,7 @@ export function vitePluginSsrCss(pluginOpts: { entries: string[] }): Plugin {
|
|
12
12
|
const virtualHref = '/@id/__x00__' + VIRTUAL_ENTRY
|
13
13
|
|
14
14
|
return {
|
15
|
-
name: `
|
15
|
+
name: `one-plugin-ssr-css`,
|
16
16
|
apply: 'serve',
|
17
17
|
configureServer(server_) {
|
18
18
|
server = server_
|
package/types/Root.d.ts.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"Root.d.ts","sourceRoot":"","sources":["../src/Root.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAiC,KAAK,iBAAiB,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAA;AAC7F,OAAO,KAAK,EAAE,mBAAmB,EAAE,cAAc,EAAE,MAAM,SAAS,CAAA;AAIlE,OAAO,EAIL,KAAK,wBAAwB,EAC9B,MAAM,0BAA0B,CAAA;AAQjC,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,cAAc,CAAA;
|
1
|
+
{"version":3,"file":"Root.d.ts","sourceRoot":"","sources":["../src/Root.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAiC,KAAK,iBAAiB,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAA;AAC7F,OAAO,KAAK,EAAE,mBAAmB,EAAE,cAAc,EAAE,MAAM,SAAS,CAAA;AAIlE,OAAO,EAIL,KAAK,wBAAwB,EAC9B,MAAM,0BAA0B,CAAA;AAQjC,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,cAAc,CAAA;AAUvC,KAAK,SAAS,GAAG,cAAc,GAC7B,IAAI,CAAC,UAAU,EAAE,SAAS,CAAC,GAAG;IAC5B,IAAI,CAAC,EAAE,GAAG,CAAC,eAAe,CAAA;IAC1B,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,MAAM,EAAE,mBAAmB,CAAA;IAC3B,YAAY,CAAC,EAAE,GAAG,CAAC,YAAY,CAAA;CAChC,CAAA;AAEH,KAAK,UAAU,GAAG;IAChB,OAAO,EAAE,GAAG,CAAC,YAAY,CAAA;IACzB,QAAQ,CAAC,EAAE,GAAG,CAAA;IACd,OAAO,CAAC,EAAE,iBAAiB,CAAC;QAAE,QAAQ,EAAE,SAAS,CAAA;KAAE,CAAC,CAAA;IACpD,wBAAwB,CAAC,EAAE,wBAAwB,GAAG;QACpD,KAAK,CAAC,EAAE;YACN,IAAI,EAAE,OAAO,CAAA;YACb,MAAM,EAAE;gBACN,OAAO,EAAE,MAAM,CAAA;gBACf,UAAU,EAAE,MAAM,CAAA;gBAClB,IAAI,EAAE,MAAM,CAAA;gBACZ,IAAI,EAAE,MAAM,CAAA;gBACZ,MAAM,EAAE,MAAM,CAAA;gBACd,YAAY,EAAE,MAAM,CAAA;aACrB,CAAA;SACF,CAAA;KACF,CAAA;CACF,CAAA;AAED,wBAAgB,IAAI,CAAC,KAAK,EAAE,SAAS,kDAmEpC"}
|
package/types/cleanUrl.d.ts.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"cleanUrl.d.ts","sourceRoot":"","sources":["../src/cleanUrl.ts"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"cleanUrl.d.ts","sourceRoot":"","sources":["../src/cleanUrl.ts"],"names":[],"mappings":"AAqBA,wBAAgB,cAAc,CAAC,WAAW,EAAE,MAAM,UAEjD;AAED,wBAAgB,aAAa,CAC3B,WAAW,EAAE,MAAM,EAEnB,UAAU,UAAW,UAWtB;AAED,wBAAgB,qBAAqB,CAAC,UAAU,EAAE,MAAM,UAMvD"}
|
package/types/constants.d.ts
CHANGED
@@ -1,4 +1,8 @@
|
|
1
1
|
export declare const isWebClient: boolean;
|
2
2
|
export declare const isWebServer: boolean;
|
3
3
|
export declare const isNative: boolean;
|
4
|
+
export declare const CACHE_KEY: string;
|
5
|
+
export declare const LOADER_JS_POSTFIX_UNCACHED = "_vxrn_loader.js";
|
6
|
+
export declare const LOADER_JS_POSTFIX: string;
|
7
|
+
export declare const PRELOAD_JS_POSTFIX: string;
|
4
8
|
//# sourceMappingURL=constants.d.ts.map
|
package/types/constants.d.ts.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,WAAW,SAA2E,CAAA;AACnG,eAAO,MAAM,WAAW,SAA2E,CAAA;AACnG,eAAO,MAAM,QAAQ,SAA0C,CAAA"}
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,WAAW,SAA2E,CAAA;AACnG,eAAO,MAAM,WAAW,SAA2E,CAAA;AACnG,eAAO,MAAM,QAAQ,SAA0C,CAAA;AAE/D,eAAO,MAAM,SAAS,QAA4E,CAAA;AAElG,eAAO,MAAM,0BAA0B,oBAAoB,CAAA;AAC3D,eAAO,MAAM,iBAAiB,QAA+C,CAAA;AAC7E,eAAO,MAAM,kBAAkB,QAA6B,CAAA"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"createHandleRequest.d.ts","sourceRoot":"","sources":["../src/createHandleRequest.ts"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"createHandleRequest.d.ts","sourceRoot":"","sources":["../src/createHandleRequest.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,+BAA+B,CAAA;AAI9D,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,cAAc,CAAA;AAEvC,KAAK,mBAAmB,CAAC,eAAe,SAAS,MAAM,GAAG,EAAE,IAAI;IAC9D,OAAO,EAAE,OAAO,CAAA;IAChB,KAAK,EAAE,SAAS,CAAC,MAAM,CAAC,GAAG,eAAe,CAAA;IAC1C,GAAG,EAAE,GAAG,CAAA;IACR,WAAW,CAAC,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;KAAE,CAAA;CAC5D,CAAA;AAED,KAAK,sBAAsB,GAAG,IAAI,GAAG,MAAM,GAAG,QAAQ,CAAA;AAEtD,wBAAgB,mBAAmB,CACjC,OAAO,EAAE,GAAG,CAAC,aAAa,EAC1B,QAAQ,EAAE;IACR,SAAS,CAAC,EAAE,CAAC,KAAK,EAAE,mBAAmB,KAAK,OAAO,CAAC,GAAG,CAAC,CAAA;IACxD,YAAY,CAAC,EAAE,CAAC,KAAK,EAAE,mBAAmB,KAAK,OAAO,CAAC,GAAG,CAAC,CAAA;IAC3D,SAAS,CAAC,EAAE,CAAC,KAAK,EAAE,mBAAmB,KAAK,OAAO,CAAC,GAAG,CAAC,CAAA;CACzD;;uBA4BgD,OAAO,KAAG,OAAO,CAAC,sBAAsB,CAAC;EAsJ3F"}
|
package/types/serve.d.ts.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"serve.d.ts","sourceRoot":"","sources":["../src/serve.ts"],"names":[],"mappings":"AAAA,OAAO,oBAAoB,CAAA;AAK3B,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,MAAM,CAAA;AAgBvC,wBAAsB,KAAK,CAAC,IAAI,GAAE,WAAW,CAAC,QAAQ,CAAM;mDAfJ,
|
1
|
+
{"version":3,"file":"serve.d.ts","sourceRoot":"","sources":["../src/serve.ts"],"names":[],"mappings":"AAAA,OAAO,oBAAoB,CAAA;AAK3B,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,MAAM,CAAA;AAgBvC,wBAAsB,KAAK,CAAC,IAAI,GAAE,WAAW,CAAC,QAAQ,CAAM;mDAfJ,YACvD;+CAC+C,YAChD;gDAEK,YAAY;iDAEV,YAAY;+CAEX,YAAY;mDAGkB,YAAY;GA+BjD"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"build.d.ts","sourceRoot":"","sources":["../../src/vite/build.ts"],"names":[],"mappings":"AA6BA,wBAAsB,KAAK,CAAC,IAAI,EAAE;IAChC,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,IAAI,CAAC,EAAE,MAAM,CAAA;CACd,
|
1
|
+
{"version":3,"file":"build.d.ts","sourceRoot":"","sources":["../../src/vite/build.ts"],"names":[],"mappings":"AA6BA,wBAAsB,KAAK,CAAC,IAAI,EAAE;IAChC,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,IAAI,CAAC,EAAE,MAAM,CAAA;CACd,iBAugBA"}
|
package/types/vite/one.d.ts.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"one.d.ts","sourceRoot":"","sources":["../../src/vite/one.ts"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"one.d.ts","sourceRoot":"","sources":["../../src/vite/one.ts"],"names":[],"mappings":"AAGA,OAAO,EAAe,KAAK,YAAY,EAAuC,MAAM,MAAM,CAAA;AAI1F,OAAO,qBAAqB,CAAA;AAO5B,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,SAAS,CAAA;AASlC,wBAAgB,GAAG,CAAC,OAAO,GAAE,GAAG,CAAC,aAAkB,GAAG,YAAY,CAgUjE;AAeD,wBAAsB,kBAAkB,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,8BAalE"}
|
@@ -1,26 +0,0 @@
|
|
1
|
-
var __defProp = Object.defineProperty;
|
2
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
3
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
4
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
5
|
-
var __export = (target, all) => {
|
6
|
-
for (var name in all) __defProp(target, name, {
|
7
|
-
get: all[name],
|
8
|
-
enumerable: !0
|
9
|
-
});
|
10
|
-
},
|
11
|
-
__copyProps = (to, from, except, desc) => {
|
12
|
-
if (from && typeof from == "object" || typeof from == "function") for (let key of __getOwnPropNames(from)) !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, {
|
13
|
-
get: () => from[key],
|
14
|
-
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
15
|
-
});
|
16
|
-
return to;
|
17
|
-
};
|
18
|
-
var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
|
19
|
-
value: !0
|
20
|
-
}), mod);
|
21
|
-
var constants_exports = {};
|
22
|
-
__export(constants_exports, {
|
23
|
-
CACHE_KEY: () => CACHE_KEY
|
24
|
-
});
|
25
|
-
module.exports = __toCommonJS(constants_exports);
|
26
|
-
const CACHE_KEY = `${Math.random()}`.slice(3);
|
@@ -1,26 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
var __defProp = Object.defineProperty;
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
6
|
-
var __export = (target, all) => {
|
7
|
-
for (var name in all)
|
8
|
-
__defProp(target, name, { get: all[name], enumerable: !0 });
|
9
|
-
}, __copyProps = (to, from, except, desc) => {
|
10
|
-
if (from && typeof from == "object" || typeof from == "function")
|
11
|
-
for (let key of __getOwnPropNames(from))
|
12
|
-
!__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
13
|
-
return to;
|
14
|
-
};
|
15
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
|
16
|
-
var constants_exports = {};
|
17
|
-
__export(constants_exports, {
|
18
|
-
CACHE_KEY: () => CACHE_KEY
|
19
|
-
});
|
20
|
-
module.exports = __toCommonJS(constants_exports);
|
21
|
-
var CACHE_KEY = `${Math.random()}`.slice(3);
|
22
|
-
// Annotate the CommonJS export names for ESM import in node:
|
23
|
-
0 && (module.exports = {
|
24
|
-
CACHE_KEY
|
25
|
-
});
|
26
|
-
//# sourceMappingURL=constants.js.map
|
@@ -1,47 +0,0 @@
|
|
1
|
-
var __create = Object.create;
|
2
|
-
var __defProp = Object.defineProperty;
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
5
|
-
var __getProtoOf = Object.getPrototypeOf,
|
6
|
-
__hasOwnProp = Object.prototype.hasOwnProperty;
|
7
|
-
var __export = (target, all) => {
|
8
|
-
for (var name in all) __defProp(target, name, {
|
9
|
-
get: all[name],
|
10
|
-
enumerable: !0
|
11
|
-
});
|
12
|
-
},
|
13
|
-
__copyProps = (to, from, except, desc) => {
|
14
|
-
if (from && typeof from == "object" || typeof from == "function") for (let key of __getOwnPropNames(from)) !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, {
|
15
|
-
get: () => from[key],
|
16
|
-
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
17
|
-
});
|
18
|
-
return to;
|
19
|
-
};
|
20
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
21
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
22
|
-
// file that has been converted to a CommonJS file using a Babel-
|
23
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
24
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
25
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
|
26
|
-
value: mod,
|
27
|
-
enumerable: !0
|
28
|
-
}) : target, mod)),
|
29
|
-
__toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
|
30
|
-
value: !0
|
31
|
-
}), mod);
|
32
|
-
var loadEnv_exports = {};
|
33
|
-
__export(loadEnv_exports, {
|
34
|
-
loadEnv: () => loadEnv
|
35
|
-
});
|
36
|
-
module.exports = __toCommonJS(loadEnv_exports);
|
37
|
-
var import_node_fs = __toESM(require("node:fs"), 1),
|
38
|
-
import_node_path = __toESM(require("node:path"), 1);
|
39
|
-
async function loadEnv(root) {
|
40
|
-
const envPath = import_node_path.default.join(root, ".env");
|
41
|
-
if (!import_node_fs.default.existsSync(envPath)) return;
|
42
|
-
const result = (await import("dotenv")).config({
|
43
|
-
path: envPath
|
44
|
-
});
|
45
|
-
if (result.error) throw result.error;
|
46
|
-
return !0;
|
47
|
-
}
|
@@ -1,6 +0,0 @@
|
|
1
|
-
{
|
2
|
-
"version": 3,
|
3
|
-
"sources": ["../../../src/vite/loadEnv.ts"],
|
4
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,qBAAe,gCACf,mBAAiB;AAEjB,eAAsB,QAAQ,MAAc;AAC1C,QAAM,UAAU,iBAAAA,QAAK,KAAK,MAAM,MAAM;AACtC,MAAI,CAAC,eAAAC,QAAG,WAAW,OAAO,EAAG;AAE7B,QAAM,UADS,MAAM,OAAO,QAAQ,GACd,OAAO,EAAE,MAAM,QAAQ,CAAC;AAC9C,MAAI,OAAO,MAAO,OAAM,OAAO;AAC/B,SAAO;AACT;",
|
5
|
-
"names": ["path", "fs"]
|
6
|
-
}
|
@@ -1,44 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
var __create = Object.create;
|
3
|
-
var __defProp = Object.defineProperty;
|
4
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
5
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
6
|
-
var __getProtoOf = Object.getPrototypeOf, __hasOwnProp = Object.prototype.hasOwnProperty;
|
7
|
-
var __export = (target, all) => {
|
8
|
-
for (var name in all)
|
9
|
-
__defProp(target, name, { get: all[name], enumerable: !0 });
|
10
|
-
}, __copyProps = (to, from, except, desc) => {
|
11
|
-
if (from && typeof from == "object" || typeof from == "function")
|
12
|
-
for (let key of __getOwnPropNames(from))
|
13
|
-
!__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
14
|
-
return to;
|
15
|
-
};
|
16
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
17
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
18
|
-
// file that has been converted to a CommonJS file using a Babel-
|
19
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
20
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
21
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: !0 }) : target,
|
22
|
-
mod
|
23
|
-
)), __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
|
24
|
-
var loadEnv_exports = {};
|
25
|
-
__export(loadEnv_exports, {
|
26
|
-
loadEnv: () => loadEnv
|
27
|
-
});
|
28
|
-
module.exports = __toCommonJS(loadEnv_exports);
|
29
|
-
var import_node_fs = __toESM(require("node:fs"), 1), import_node_path = __toESM(require("node:path"), 1);
|
30
|
-
async function loadEnv(root) {
|
31
|
-
var envPath = import_node_path.default.join(root, ".env");
|
32
|
-
if (import_node_fs.default.existsSync(envPath)) {
|
33
|
-
var dotenv = await import("dotenv"), result = dotenv.config({
|
34
|
-
path: envPath
|
35
|
-
});
|
36
|
-
if (result.error) throw result.error;
|
37
|
-
return !0;
|
38
|
-
}
|
39
|
-
}
|
40
|
-
// Annotate the CommonJS export names for ESM import in node:
|
41
|
-
0 && (module.exports = {
|
42
|
-
loadEnv
|
43
|
-
});
|
44
|
-
//# sourceMappingURL=loadEnv.js.map
|
@@ -1,6 +0,0 @@
|
|
1
|
-
{
|
2
|
-
"version": 3,
|
3
|
-
"sources": ["../../../src/vite/Users/n8/one/packages/one/src/vite/loadEnv.ts"],
|
4
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;qBAAe,gCACf,mBAAiB;AAEjB,eAAsBA,QAAQC,MAAY;AACxC,MAAMC,UAAUC,iBAAAA,QAAKC,KAAKH,MAAM,MAAA;AAChC,MAAKI,eAAAA,QAAGC,WAAWJ,OAAAA,GACnB;QAAMK,SAAS,MAAM,OAAO,QAAA,GACtBC,SAASD,OAAOE,OAAO;MAAEN,MAAMD;IAAQ,CAAA;AAC7C,QAAIM,OAAOE,MAAO,OAAMF,OAAOE;AAC/B,WAAO;;AACT;",
|
5
|
-
"names": ["loadEnv", "root", "envPath", "path", "join", "fs", "existsSync", "dotenv", "result", "config", "error"]
|
6
|
-
}
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"names":["CACHE_KEY","Math","random","slice"],"sources":["../../../src/router/constants.ts"],"sourcesContent":[null],"mappings":"AAGO,MAAMA,SAAA,GAAY,GAAGC,IAAA,CAAKC,MAAA,CAAO,CAAC,GAAGC,KAAA,CAAM,CAAC","ignoreList":[]}
|
package/dist/esm/vite/loadEnv.js
DELETED
@@ -1,13 +0,0 @@
|
|
1
|
-
import fs from "node:fs";
|
2
|
-
import path from "node:path";
|
3
|
-
async function loadEnv(root) {
|
4
|
-
const envPath = path.join(root, ".env");
|
5
|
-
if (!fs.existsSync(envPath)) return;
|
6
|
-
const result = (await import("dotenv")).config({ path: envPath });
|
7
|
-
if (result.error) throw result.error;
|
8
|
-
return !0;
|
9
|
-
}
|
10
|
-
export {
|
11
|
-
loadEnv
|
12
|
-
};
|
13
|
-
//# sourceMappingURL=loadEnv.js.map
|
@@ -1,6 +0,0 @@
|
|
1
|
-
{
|
2
|
-
"version": 3,
|
3
|
-
"sources": ["../../../src/vite/loadEnv.ts"],
|
4
|
-
"mappings": "AAAA,OAAO,QAAQ;AACf,OAAO,UAAU;AAEjB,eAAsB,QAAQ,MAAc;AAC1C,QAAM,UAAU,KAAK,KAAK,MAAM,MAAM;AACtC,MAAI,CAAC,GAAG,WAAW,OAAO,EAAG;AAE7B,QAAM,UADS,MAAM,OAAO,QAAQ,GACd,OAAO,EAAE,MAAM,QAAQ,CAAC;AAC9C,MAAI,OAAO,MAAO,OAAM,OAAO;AAC/B,SAAO;AACT;",
|
5
|
-
"names": []
|
6
|
-
}
|
@@ -1,13 +0,0 @@
|
|
1
|
-
import fs from "node:fs";
|
2
|
-
import path from "node:path";
|
3
|
-
async function loadEnv(root) {
|
4
|
-
const envPath = path.join(root, ".env");
|
5
|
-
if (!fs.existsSync(envPath)) return;
|
6
|
-
const result = (await import("dotenv")).config({
|
7
|
-
path: envPath
|
8
|
-
});
|
9
|
-
if (result.error) throw result.error;
|
10
|
-
return !0;
|
11
|
-
}
|
12
|
-
export { loadEnv };
|
13
|
-
//# sourceMappingURL=loadEnv.mjs.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"names":["fs","path","loadEnv","root","envPath","join","existsSync","result","config","error"],"sources":["../../../src/vite/loadEnv.ts"],"sourcesContent":[null],"mappings":"AAAA,OAAOA,EAAA,MAAQ;AACf,OAAOC,IAAA,MAAU;AAEjB,eAAsBC,QAAQC,IAAA,EAAc;EAC1C,MAAMC,OAAA,GAAUH,IAAA,CAAKI,IAAA,CAAKF,IAAA,EAAM,MAAM;EACtC,IAAI,CAACH,EAAA,CAAGM,UAAA,CAAWF,OAAO,GAAG;EAE7B,MAAMG,MAAA,IADS,MAAM,OAAO,QAAQ,GACdC,MAAA,CAAO;IAAEP,IAAA,EAAMG;EAAQ,CAAC;EAC9C,IAAIG,MAAA,CAAOE,KAAA,EAAO,MAAMF,MAAA,CAAOE,KAAA;EAC/B,OAAO;AACT","ignoreList":[]}
|
@@ -1,16 +0,0 @@
|
|
1
|
-
import fs from "node:fs";
|
2
|
-
import path from "node:path";
|
3
|
-
async function loadEnv(root) {
|
4
|
-
var envPath = path.join(root, ".env");
|
5
|
-
if (fs.existsSync(envPath)) {
|
6
|
-
var dotenv = await import("dotenv"), result = dotenv.config({
|
7
|
-
path: envPath
|
8
|
-
});
|
9
|
-
if (result.error) throw result.error;
|
10
|
-
return !0;
|
11
|
-
}
|
12
|
-
}
|
13
|
-
export {
|
14
|
-
loadEnv
|
15
|
-
};
|
16
|
-
//# sourceMappingURL=loadEnv.js.map
|
@@ -1,6 +0,0 @@
|
|
1
|
-
{
|
2
|
-
"version": 3,
|
3
|
-
"sources": ["../../../src/vite/Users/n8/one/packages/one/src/vite/loadEnv.ts"],
|
4
|
-
"mappings": "AAAA,OAAOA,QAAQ;AACf,OAAOC,UAAU;AAEjB,eAAsBC,QAAQC,MAAY;AACxC,MAAMC,UAAUH,KAAKI,KAAKF,MAAM,MAAA;AAChC,MAAKH,GAAGM,WAAWF,OAAAA,GACnB;QAAMG,SAAS,MAAM,OAAO,QAAA,GACtBC,SAASD,OAAOE,OAAO;MAAER,MAAMG;IAAQ,CAAA;AAC7C,QAAII,OAAOE,MAAO,OAAMF,OAAOE;AAC/B,WAAO;;AACT;",
|
5
|
-
"names": ["fs", "path", "loadEnv", "root", "envPath", "join", "existsSync", "dotenv", "result", "config", "error"]
|
6
|
-
}
|
package/src/router/constants.ts
DELETED
package/src/vite/loadEnv.ts
DELETED
@@ -1,11 +0,0 @@
|
|
1
|
-
import fs from 'node:fs'
|
2
|
-
import path from 'node:path'
|
3
|
-
|
4
|
-
export async function loadEnv(root: string) {
|
5
|
-
const envPath = path.join(root, '.env')
|
6
|
-
if (!fs.existsSync(envPath)) return
|
7
|
-
const dotenv = await import('dotenv')
|
8
|
-
const result = dotenv.config({ path: envPath })
|
9
|
-
if (result.error) throw result.error
|
10
|
-
return true
|
11
|
-
}
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../src/router/constants.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,SAAS,QAA8B,CAAA"}
|
package/types/vite/loadEnv.d.ts
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"loadEnv.d.ts","sourceRoot":"","sources":["../../src/vite/loadEnv.ts"],"names":[],"mappings":"AAGA,wBAAsB,OAAO,CAAC,IAAI,EAAE,MAAM,6BAOzC"}
|