@sveltejs/vite-plugin-svelte 1.3.0 → 1.4.0
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 +497 -381
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +6 -13
- package/dist/index.js +490 -375
- package/dist/index.js.map +1 -1
- package/dist/preprocess.cjs +127 -0
- package/dist/preprocess.cjs.map +1 -0
- package/dist/preprocess.d.ts +9 -0
- package/dist/preprocess.js +96 -0
- package/dist/preprocess.js.map +1 -0
- package/package.json +6 -16
- package/src/handle-hot-update.ts +24 -24
- package/src/index.ts +23 -24
- package/src/preprocess.ts +114 -0
- package/src/utils/compile.ts +71 -23
- package/src/utils/id.ts +55 -3
- package/src/utils/load-raw.ts +132 -0
- package/src/utils/options.ts +16 -9
- package/src/utils/preprocess.ts +9 -150
- package/src/utils/vite-plugin-svelte-stats.ts +50 -39
- package/src/utils/__tests__/sourcemap.spec.ts +0 -25
- package/src/utils/sourcemap.ts +0 -58
package/dist/index.d.ts
CHANGED
|
@@ -3,8 +3,9 @@ import { CompileOptions, Warning } from 'svelte/types/compiler/interfaces';
|
|
|
3
3
|
export { CompileOptions, Warning } from 'svelte/types/compiler/interfaces';
|
|
4
4
|
import { PreprocessorGroup } from 'svelte/types/compiler/preprocess';
|
|
5
5
|
export { MarkupPreprocessor, Preprocessor, PreprocessorGroup, Processed } from 'svelte/types/compiler/preprocess';
|
|
6
|
+
export { vitePreprocess } from './preprocess.js';
|
|
6
7
|
|
|
7
|
-
|
|
8
|
+
type Options = Omit<SvelteOptions, 'vitePlugin'> & PluginOptionsInline;
|
|
8
9
|
interface PluginOptionsInline extends PluginOptions {
|
|
9
10
|
/**
|
|
10
11
|
* Path to a svelte config file, either absolute or relative to Vite root
|
|
@@ -132,14 +133,6 @@ interface ExperimentalOptions {
|
|
|
132
133
|
* @default false
|
|
133
134
|
*/
|
|
134
135
|
useVitePreprocess?: boolean;
|
|
135
|
-
/**
|
|
136
|
-
* If a preprocessor does not provide a sourcemap, a best-effort fallback sourcemap will be provided.
|
|
137
|
-
* This option requires `diff-match-patch` to be installed as a peer dependency.
|
|
138
|
-
*
|
|
139
|
-
* @see https://github.com/google/diff-match-patch
|
|
140
|
-
* @default false
|
|
141
|
-
*/
|
|
142
|
-
generateMissingPreprocessorSourcemaps?: boolean;
|
|
143
136
|
/**
|
|
144
137
|
* A function to update `compilerOptions` before compilation
|
|
145
138
|
*
|
|
@@ -248,13 +241,13 @@ interface InspectorOptions {
|
|
|
248
241
|
*/
|
|
249
242
|
appendTo?: string;
|
|
250
243
|
}
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
244
|
+
type ModuleFormat = NonNullable<CompileOptions['format']>;
|
|
245
|
+
type CssHashGetter = NonNullable<CompileOptions['cssHash']>;
|
|
246
|
+
type Arrayable<T> = T | T[];
|
|
254
247
|
|
|
255
248
|
declare function loadSvelteConfig(viteConfig?: UserConfig, inlineOptions?: Partial<Options>): Promise<Partial<SvelteOptions> | undefined>;
|
|
256
249
|
|
|
257
|
-
|
|
250
|
+
type SvelteWarningsMessage = {
|
|
258
251
|
id: string;
|
|
259
252
|
filename: string;
|
|
260
253
|
normalizedFilename: string;
|