@adonisjs/vite 0.0.1-0 → 0.0.1-10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/configure.d.ts +3 -1
- package/build/configure.js +24 -10
- package/build/index.d.ts +1 -1
- package/build/index.js +9 -0
- package/build/providers/vite_provider.d.ts +14 -4
- package/build/providers/vite_provider.js +82 -36
- package/build/services/vite.d.ts +1 -2
- package/build/services/vite.js +12 -0
- package/build/src/backend/debug.d.ts +3 -0
- package/{src/backend/types/extended.ts → build/src/backend/debug.js} +2 -11
- package/build/src/backend/define_config.d.ts +5 -0
- package/build/src/backend/define_config.js +19 -0
- package/build/src/backend/edge_plugin_vite.d.ts +7 -0
- package/build/src/backend/edge_plugin_vite.js +86 -0
- package/build/src/backend/types/extended.d.ts +8 -1
- package/build/src/backend/types/extended.js +8 -0
- package/build/src/backend/types/main.d.ts +57 -1
- package/build/src/backend/types/main.js +8 -0
- package/build/src/backend/utils.d.ts +7 -1
- package/build/src/backend/utils.js +29 -0
- package/build/src/backend/vite.d.ts +33 -13
- package/build/src/backend/vite.js +206 -113
- package/build/src/{vite_plugin → client}/config.d.ts +7 -2
- package/build/src/{vite_plugin → client}/config.js +28 -2
- package/build/src/{vite_plugin → client}/config_resolver.d.ts +13 -2
- package/build/src/{vite_plugin → client}/config_resolver.js +22 -3
- package/build/src/{vite_plugin → client}/helpers/inertia.d.ts +3 -1
- package/build/src/{vite_plugin → client}/helpers/inertia.js +11 -0
- package/build/src/{vite_plugin → client}/hot_file.d.ts +6 -1
- package/build/src/{vite_plugin → client}/hot_file.js +21 -2
- package/build/src/client/main.d.ts +6 -0
- package/build/src/client/main.js +24 -0
- package/build/src/client/types.d.ts +35 -0
- package/build/src/client/types.js +9 -0
- package/build/src/{vite_plugin → client}/utils.d.ts +7 -2
- package/build/src/{vite_plugin → client}/utils.js +14 -0
- package/build/stubs/client_config.stub +22 -0
- package/build/stubs/config.stub +21 -0
- package/build/stubs/index.d.ts +0 -1
- package/build/stubs/index.js +2 -2
- package/build/stubs/js_entrypoint.stub +4 -0
- package/package.json +74 -81
- package/build/configure.d.ts.map +0 -1
- package/build/index.d.ts.map +0 -1
- package/build/providers/vite_provider.d.ts.map +0 -1
- package/build/services/vite.d.ts.map +0 -1
- package/build/src/backend/types/extended.d.ts.map +0 -1
- package/build/src/backend/types/main.d.ts.map +0 -1
- package/build/src/backend/utils.d.ts.map +0 -1
- package/build/src/backend/vite.d.ts.map +0 -1
- package/build/src/vite_plugin/config.d.ts.map +0 -1
- package/build/src/vite_plugin/config_resolver.d.ts.map +0 -1
- package/build/src/vite_plugin/helpers/inertia.d.ts.map +0 -1
- package/build/src/vite_plugin/hot_file.d.ts.map +0 -1
- package/build/src/vite_plugin/index.d.ts +0 -4
- package/build/src/vite_plugin/index.d.ts.map +0 -1
- package/build/src/vite_plugin/index.js +0 -16
- package/build/src/vite_plugin/types/index.d.ts +0 -10
- package/build/src/vite_plugin/types/index.d.ts.map +0 -1
- package/build/src/vite_plugin/types/index.js +0 -1
- package/build/src/vite_plugin/utils.d.ts.map +0 -1
- package/build/stubs/index.d.ts.map +0 -1
- package/build/stubs/vite/vite_config.stub +0 -14
- package/configure.ts +0 -30
- package/index.ts +0 -15
- package/providers/vite_provider.ts +0 -89
- package/services/vite.ts +0 -23
- package/src/backend/types/main.ts +0 -31
- package/src/backend/utils.ts +0 -19
- package/src/backend/vite.ts +0 -367
- package/src/vite_plugin/config.ts +0 -97
- package/src/vite_plugin/config_resolver.ts +0 -62
- package/src/vite_plugin/helpers/inertia.ts +0 -27
- package/src/vite_plugin/hot_file.ts +0 -59
- package/src/vite_plugin/index.ts +0 -38
- package/src/vite_plugin/types/index.ts +0 -56
- package/src/vite_plugin/utils.ts +0 -40
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* @adonisjs/vite
|
|
3
|
-
*
|
|
4
|
-
* (c) AdonisJS
|
|
5
|
-
*
|
|
6
|
-
* For the full copyright and license information, please view the LICENSE
|
|
7
|
-
* file that was distributed with this source code.
|
|
8
|
-
*/
|
|
9
|
-
|
|
10
|
-
/**
|
|
11
|
-
* Possible plugin options
|
|
12
|
-
*/
|
|
13
|
-
export type PluginOptions = {
|
|
14
|
-
/**
|
|
15
|
-
* Path to the hot file
|
|
16
|
-
*
|
|
17
|
-
* @default public/hot.json
|
|
18
|
-
*/
|
|
19
|
-
hotFile?: string
|
|
20
|
-
|
|
21
|
-
/**
|
|
22
|
-
* Paths to the entrypoints files
|
|
23
|
-
*/
|
|
24
|
-
entrypoints: string[]
|
|
25
|
-
|
|
26
|
-
/**
|
|
27
|
-
* Path to your AdonisJS public directory
|
|
28
|
-
*
|
|
29
|
-
* @default 'public'
|
|
30
|
-
*/
|
|
31
|
-
publicDirectory?: string
|
|
32
|
-
|
|
33
|
-
/**
|
|
34
|
-
* The URL where the assets will be served. This is particularly
|
|
35
|
-
* useful if you are using a CDN to deploy your assets.
|
|
36
|
-
*
|
|
37
|
-
* @default ''
|
|
38
|
-
*/
|
|
39
|
-
assetsUrl?: string
|
|
40
|
-
|
|
41
|
-
/**
|
|
42
|
-
* Public subdirectory where the assets will be compiled.
|
|
43
|
-
*
|
|
44
|
-
* @default 'assets'
|
|
45
|
-
*/
|
|
46
|
-
buildDirectory?: string
|
|
47
|
-
|
|
48
|
-
/**
|
|
49
|
-
* Files that should trigger a page reload when changed.
|
|
50
|
-
*
|
|
51
|
-
* @default ['./resources/views/** /*.edge']
|
|
52
|
-
*/
|
|
53
|
-
reload?: string[]
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
export type PluginFullOptions = Required<PluginOptions>
|
package/src/vite_plugin/utils.ts
DELETED
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* @adonisjs/vite
|
|
3
|
-
*
|
|
4
|
-
* (c) AdonisJS
|
|
5
|
-
*
|
|
6
|
-
* For the full copyright and license information, please view the LICENSE
|
|
7
|
-
* file that was distributed with this source code.
|
|
8
|
-
*/
|
|
9
|
-
|
|
10
|
-
import { AddressInfo } from 'node:net'
|
|
11
|
-
import { ResolvedConfig } from 'vite'
|
|
12
|
-
|
|
13
|
-
/**
|
|
14
|
-
* Resolve the dev server URL from the server address and configuration.
|
|
15
|
-
*/
|
|
16
|
-
export const resolveDevServerUrl = (address: AddressInfo, config: ResolvedConfig) => {
|
|
17
|
-
const configHmrProtocol =
|
|
18
|
-
typeof config.server.hmr === 'object' ? config.server.hmr.protocol : null
|
|
19
|
-
|
|
20
|
-
const clientProtocol = configHmrProtocol ? (configHmrProtocol === 'wss' ? 'https' : 'http') : null
|
|
21
|
-
const serverProtocol = config.server.https ? 'https' : 'http'
|
|
22
|
-
const protocol = clientProtocol ?? serverProtocol
|
|
23
|
-
|
|
24
|
-
const configHmrHost = typeof config.server.hmr === 'object' ? config.server.hmr.host : null
|
|
25
|
-
const configHost = typeof config.server.host === 'string' ? config.server.host : null
|
|
26
|
-
|
|
27
|
-
let host = configHmrHost ?? configHost ?? address.address
|
|
28
|
-
if (host === '::1') {
|
|
29
|
-
host = 'localhost'
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
return `${protocol}://${host}:${address.port}`
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
/**
|
|
36
|
-
* Add a trailing slash if missing
|
|
37
|
-
*/
|
|
38
|
-
export const addTrailingSlash = (url: string) => {
|
|
39
|
-
return url.endsWith('/') ? url : url + '/'
|
|
40
|
-
}
|