litestar-vite-plugin 0.2.1 → 0.3.1
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/dist/index.cjs +1 -11
- package/dist/index.d.ts +1 -7
- package/dist/index.mjs +1 -11
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -71,7 +71,6 @@ function resolveLitestarPlugin(pluginConfig) {
|
|
|
71
71
|
ensureCommandShouldRunInEnvironment(command, env);
|
|
72
72
|
return {
|
|
73
73
|
base: userConfig.base ?? (command === "build" ? resolveBase(pluginConfig, assetUrl) : pluginConfig.assetUrl),
|
|
74
|
-
root: pluginConfig.rootDirectory,
|
|
75
74
|
publicDir: userConfig.publicDir ?? false,
|
|
76
75
|
build: {
|
|
77
76
|
manifest: userConfig.build?.manifest ?? !ssr,
|
|
@@ -243,14 +242,6 @@ function resolvePluginConfig(config) {
|
|
|
243
242
|
);
|
|
244
243
|
}
|
|
245
244
|
}
|
|
246
|
-
if (typeof config.rootDirectory === "string") {
|
|
247
|
-
config.rootDirectory = config.rootDirectory.trim().replace(/^\/+/, "");
|
|
248
|
-
if (config.rootDirectory === "") {
|
|
249
|
-
throw new Error(
|
|
250
|
-
"litestar-vite-plugin: rootDirectory must be a subdirectory. E.g. '.'."
|
|
251
|
-
);
|
|
252
|
-
}
|
|
253
|
-
}
|
|
254
245
|
if (typeof config.assetDirectory === "string") {
|
|
255
246
|
config.assetDirectory = config.assetDirectory.trim().replace(/^\/+/, "");
|
|
256
247
|
if (config.assetDirectory === "") {
|
|
@@ -275,10 +266,9 @@ function resolvePluginConfig(config) {
|
|
|
275
266
|
}
|
|
276
267
|
return {
|
|
277
268
|
input: config.input,
|
|
278
|
-
rootDirectory: config.rootDirectory ?? process.cwd(),
|
|
279
269
|
assetUrl: config.assetUrl || (config.assetUrl ?? "static"),
|
|
280
270
|
resourceDirectory: config.resourceDirectory ?? "/resources/",
|
|
281
|
-
assetDirectory: config.assetDirectory ?? "assets",
|
|
271
|
+
assetDirectory: config.assetDirectory ?? import_path.default.join(config.resourceDirectory ?? "/resources/", "assets"),
|
|
282
272
|
bundleDirectory: config.bundleDirectory || (config.bundleDirectory ?? "public"),
|
|
283
273
|
ssr: config.ssr ?? config.input,
|
|
284
274
|
ssrOutputDirectory: config.ssrOutputDirectory ?? import_path.default.join(config.resourceDirectory ?? "resources", "bootstrap/ssr"),
|
package/dist/index.d.ts
CHANGED
|
@@ -17,16 +17,10 @@ interface PluginConfig {
|
|
|
17
17
|
* @default 'public/dist'
|
|
18
18
|
*/
|
|
19
19
|
bundleDirectory?: string;
|
|
20
|
-
/**
|
|
21
|
-
* The root directory for your project.
|
|
22
|
-
*
|
|
23
|
-
* @default ''
|
|
24
|
-
*/
|
|
25
|
-
rootDirectory?: string;
|
|
26
20
|
/**
|
|
27
21
|
* Litestar's public assets directory. These are the assets that Vite will serve when developing.
|
|
28
22
|
*
|
|
29
|
-
* @default '
|
|
23
|
+
* @default 'resources'
|
|
30
24
|
*/
|
|
31
25
|
resourceDirectory?: string;
|
|
32
26
|
/**
|
package/dist/index.mjs
CHANGED
|
@@ -42,7 +42,6 @@ function resolveLitestarPlugin(pluginConfig) {
|
|
|
42
42
|
ensureCommandShouldRunInEnvironment(command, env);
|
|
43
43
|
return {
|
|
44
44
|
base: userConfig.base ?? (command === "build" ? resolveBase(pluginConfig, assetUrl) : pluginConfig.assetUrl),
|
|
45
|
-
root: pluginConfig.rootDirectory,
|
|
46
45
|
publicDir: userConfig.publicDir ?? false,
|
|
47
46
|
build: {
|
|
48
47
|
manifest: userConfig.build?.manifest ?? !ssr,
|
|
@@ -214,14 +213,6 @@ function resolvePluginConfig(config) {
|
|
|
214
213
|
);
|
|
215
214
|
}
|
|
216
215
|
}
|
|
217
|
-
if (typeof config.rootDirectory === "string") {
|
|
218
|
-
config.rootDirectory = config.rootDirectory.trim().replace(/^\/+/, "");
|
|
219
|
-
if (config.rootDirectory === "") {
|
|
220
|
-
throw new Error(
|
|
221
|
-
"litestar-vite-plugin: rootDirectory must be a subdirectory. E.g. '.'."
|
|
222
|
-
);
|
|
223
|
-
}
|
|
224
|
-
}
|
|
225
216
|
if (typeof config.assetDirectory === "string") {
|
|
226
217
|
config.assetDirectory = config.assetDirectory.trim().replace(/^\/+/, "");
|
|
227
218
|
if (config.assetDirectory === "") {
|
|
@@ -246,10 +237,9 @@ function resolvePluginConfig(config) {
|
|
|
246
237
|
}
|
|
247
238
|
return {
|
|
248
239
|
input: config.input,
|
|
249
|
-
rootDirectory: config.rootDirectory ?? process.cwd(),
|
|
250
240
|
assetUrl: config.assetUrl || (config.assetUrl ?? "static"),
|
|
251
241
|
resourceDirectory: config.resourceDirectory ?? "/resources/",
|
|
252
|
-
assetDirectory: config.assetDirectory ?? "assets",
|
|
242
|
+
assetDirectory: config.assetDirectory ?? path.join(config.resourceDirectory ?? "/resources/", "assets"),
|
|
253
243
|
bundleDirectory: config.bundleDirectory || (config.bundleDirectory ?? "public"),
|
|
254
244
|
ssr: config.ssr ?? config.input,
|
|
255
245
|
ssrOutputDirectory: config.ssrOutputDirectory ?? path.join(config.resourceDirectory ?? "resources", "bootstrap/ssr"),
|