@ryanatkn/gro 0.116.0 → 0.116.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.
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
/// <reference types="svelte" />
|
|
2
2
|
import * as esbuild from 'esbuild';
|
|
3
3
|
import type { Logger } from '@ryanatkn/belt/log.js';
|
|
4
|
-
import type { CompileOptions, PreprocessorGroup } from 'svelte/compiler';
|
|
4
|
+
import type { CompileOptions, PreprocessorGroup, ModuleCompileOptions } from 'svelte/compiler';
|
|
5
5
|
import type { Parsed_Sveltekit_Config } from './sveltekit_config.js';
|
|
6
6
|
export interface Options {
|
|
7
7
|
dev: boolean;
|
|
8
8
|
build_options: esbuild.BuildOptions;
|
|
9
9
|
dir?: string;
|
|
10
10
|
svelte_compile_options?: CompileOptions;
|
|
11
|
+
svelte_compile_module_options?: ModuleCompileOptions;
|
|
11
12
|
svelte_preprocessors?: PreprocessorGroup | PreprocessorGroup[];
|
|
12
13
|
alias?: Record<string, string>;
|
|
13
14
|
base_url?: Parsed_Sveltekit_Config['base_url'];
|
|
@@ -19,4 +20,4 @@ export interface Options {
|
|
|
19
20
|
ambient_env?: Record<string, string>;
|
|
20
21
|
log?: Logger;
|
|
21
22
|
}
|
|
22
|
-
export declare const esbuild_plugin_external_worker: ({ dev, build_options, dir, svelte_compile_options, svelte_preprocessors, alias, base_url, assets_url, public_prefix, private_prefix, env_dir, env_files, ambient_env, log, }: Options) => esbuild.Plugin;
|
|
23
|
+
export declare const esbuild_plugin_external_worker: ({ dev, build_options, dir, svelte_compile_options, svelte_preprocessors, svelte_compile_module_options, alias, base_url, assets_url, public_prefix, private_prefix, env_dir, env_files, ambient_env, log, }: Options) => esbuild.Plugin;
|
|
@@ -8,7 +8,7 @@ import { esbuild_plugin_sveltekit_shim_env } from './esbuild_plugin_sveltekit_sh
|
|
|
8
8
|
import { esbuild_plugin_sveltekit_shim_app } from './esbuild_plugin_sveltekit_shim_app.js';
|
|
9
9
|
import { esbuild_plugin_sveltekit_local_imports } from './esbuild_plugin_sveltekit_local_imports.js';
|
|
10
10
|
import { esbuild_plugin_svelte } from './esbuild_plugin_svelte.js';
|
|
11
|
-
export const esbuild_plugin_external_worker = ({ dev, build_options, dir = cwd(), svelte_compile_options, svelte_preprocessors, alias, base_url, assets_url, public_prefix, private_prefix, env_dir, env_files, ambient_env, log, }) => ({
|
|
11
|
+
export const esbuild_plugin_external_worker = ({ dev, build_options, dir = cwd(), svelte_compile_options, svelte_preprocessors, svelte_compile_module_options, alias, base_url, assets_url, public_prefix, private_prefix, env_dir, env_files, ambient_env, log, }) => ({
|
|
12
12
|
name: 'external_worker',
|
|
13
13
|
setup: (build) => {
|
|
14
14
|
const builds = new Map();
|
|
@@ -28,7 +28,12 @@ export const esbuild_plugin_external_worker = ({ dev, build_options, dir = cwd()
|
|
|
28
28
|
ambient_env,
|
|
29
29
|
}),
|
|
30
30
|
esbuild_plugin_sveltekit_shim_alias({ dir, alias }),
|
|
31
|
-
esbuild_plugin_svelte({
|
|
31
|
+
esbuild_plugin_svelte({
|
|
32
|
+
dir,
|
|
33
|
+
svelte_compile_options,
|
|
34
|
+
svelte_compile_module_options,
|
|
35
|
+
svelte_preprocessors,
|
|
36
|
+
}),
|
|
32
37
|
esbuild_plugin_sveltekit_local_imports(),
|
|
33
38
|
],
|
|
34
39
|
define: to_define_import_meta_env(dev, base_url),
|
|
@@ -32,11 +32,14 @@ export const gro_plugin_server = ({ entry_points = [SERVER_SOURCE_ID], dir = cwd
|
|
|
32
32
|
return {
|
|
33
33
|
name: 'gro_plugin_server',
|
|
34
34
|
setup: async ({ dev, watch, timings, log }) => {
|
|
35
|
-
const { alias, base_url, assets_url, env_dir, private_prefix, public_prefix, svelte_compile_options, svelte_preprocessors, } = await init_sveltekit_config(sveltekit_config ?? dir);
|
|
36
|
-
// TODO
|
|
35
|
+
const { alias, base_url, assets_url, env_dir, private_prefix, public_prefix, svelte_compile_options, svelte_compile_module_options, svelte_preprocessors, } = await init_sveltekit_config(sveltekit_config ?? dir);
|
|
36
|
+
// TODO hacky
|
|
37
37
|
if (svelte_compile_options.generate === undefined) {
|
|
38
38
|
svelte_compile_options.generate = 'server';
|
|
39
39
|
}
|
|
40
|
+
if (svelte_compile_module_options.generate === undefined) {
|
|
41
|
+
svelte_compile_module_options.generate = 'server';
|
|
42
|
+
}
|
|
40
43
|
const { outbase, outdir, outname } = outpaths(dev);
|
|
41
44
|
const server_outpath = join(outdir, outname);
|
|
42
45
|
const timing_to_esbuild_create_context = timings.start('create build context');
|
|
@@ -68,6 +71,7 @@ export const gro_plugin_server = ({ entry_points = [SERVER_SOURCE_ID], dir = cwd
|
|
|
68
71
|
build_options,
|
|
69
72
|
dir,
|
|
70
73
|
svelte_compile_options,
|
|
74
|
+
svelte_compile_module_options,
|
|
71
75
|
svelte_preprocessors,
|
|
72
76
|
alias,
|
|
73
77
|
base_url,
|
|
@@ -78,7 +82,12 @@ export const gro_plugin_server = ({ entry_points = [SERVER_SOURCE_ID], dir = cwd
|
|
|
78
82
|
ambient_env,
|
|
79
83
|
log,
|
|
80
84
|
}),
|
|
81
|
-
esbuild_plugin_svelte({
|
|
85
|
+
esbuild_plugin_svelte({
|
|
86
|
+
dir,
|
|
87
|
+
svelte_compile_options,
|
|
88
|
+
svelte_compile_module_options,
|
|
89
|
+
svelte_preprocessors,
|
|
90
|
+
}),
|
|
82
91
|
esbuild_plugin_sveltekit_local_imports(),
|
|
83
92
|
],
|
|
84
93
|
define: to_define_import_meta_env(dev, base_url),
|
package/dist/package.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// generated by src/lib/package.gen.ts
|
|
2
2
|
export const package_json = {
|
|
3
3
|
name: '@ryanatkn/gro',
|
|
4
|
-
version: '0.116.
|
|
4
|
+
version: '0.116.1',
|
|
5
5
|
description: 'task runner and toolkit extending SvelteKit',
|
|
6
6
|
motto: 'generate, run, optimize',
|
|
7
7
|
icon: '🌰',
|
|
@@ -241,7 +241,7 @@ export const package_json = {
|
|
|
241
241
|
};
|
|
242
242
|
export const src_json = {
|
|
243
243
|
name: '@ryanatkn/gro',
|
|
244
|
-
version: '0.116.
|
|
244
|
+
version: '0.116.1',
|
|
245
245
|
modules: {
|
|
246
246
|
'.': {
|
|
247
247
|
path: 'index.ts',
|