Skip to content

Commit

Permalink
Remove fromEntryFile option
Browse files Browse the repository at this point in the history
  • Loading branch information
EMH333 committed Oct 20, 2024
1 parent d14e202 commit 25000d6
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 66 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
- Bump svelte minimum version to `4.2.1`
- Bump esbuild minimum version to `0.17.0`
- Remove `overzealous` cache option (was unusable)
- Remove `fromEntryFile` option (was unusable)

## 0.8.2

Expand Down
5 changes: 0 additions & 5 deletions dist/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,6 @@ interface esbuildSvelteOptions {
*
*/
cache?: boolean;
/**
* Should esbuild-svelte create a binding to an html element for components given in the entryPoints list
* Defaults to `false` for now until support is added
*/
fromEntryFile?: boolean;
/**
* The regex filter to use when filtering files to compile
* Defaults to `/\.svelte$/`
Expand Down
32 changes: 0 additions & 32 deletions index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,6 @@ interface esbuildSvelteOptions {
*/
cache?: boolean;

/**
* Should esbuild-svelte create a binding to an html element for components given in the entryPoints list
* Defaults to `false` for now until support is added
*/
fromEntryFile?: boolean;

/**
* The regex filter to use when filtering files to compile
* Defaults to `/\.svelte$/`
Expand Down Expand Up @@ -114,11 +108,6 @@ export default function sveltePlugin(options?: esbuildSvelteOptions): Plugin {
options.cache = true;
}

// disable entry file generation by default
if (options.fromEntryFile == undefined) {
options.fromEntryFile = false;
}

// by default all warnings are enabled
if (options.filterWarnings == undefined) {
options.filterWarnings = () => true;
Expand All @@ -128,27 +117,6 @@ export default function sveltePlugin(options?: esbuildSvelteOptions): Plugin {
const cssCode = new Map<string, string>();
const fileCache = new Map<string, CacheData>();

//check and see if trying to load svelte files directly
build.onResolve({ filter: svelteFilter }, ({ path, kind }) => {
if (kind === "entry-point" && options?.fromEntryFile) {
return { path, namespace: "esbuild-svelte-direct-import" };
}
});

//main loader
build.onLoad(
{ filter: svelteFilter, namespace: "esbuild-svelte-direct-import" },
async (args) => {
return {
errors: [
{
text: "esbuild-svelte does not support creating entry files yet",
},
],
};
},
);

//main loader
build.onLoad({ filter: svelteFilter }, async (args) => {
let cachedFile = null;
Expand Down
29 changes: 0 additions & 29 deletions test/directImportTest.mjs

This file was deleted.

0 comments on commit 25000d6

Please sign in to comment.