Skip to content

Commit 6696dbd

Browse files
authored
Merge pull request #70 from bholmesdev/fix/scope-entrypoint
fix simple-scope entry issue
2 parents 592a748 + 7ff6c6d commit 6696dbd

File tree

4 files changed

+8
-15
lines changed

4 files changed

+8
-15
lines changed

.changeset/fluffy-peas-jump.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"vite-plugin-simple-scope": patch
3+
---
4+
5+
fixes "failed to resolve entry" error on dev server start.

packages/scope/package.json

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"description": "Get a scoped ID for whatever file you're in. Zero client-side JS.",
55
"type": "module",
66
"exports": {
7-
".": "./dist/index.js",
7+
".": "./src/index.ts",
88
"./types": "./ambient.d.ts"
99
},
1010
"files": ["src", "ambient.d.ts"],
@@ -13,10 +13,6 @@
1313
"url": "https://github.com/bholmesdev/simple-stack.git",
1414
"directory": "packages/scope"
1515
},
16-
"scripts": {
17-
"dev": "tsc --watch",
18-
"build": "tsc"
19-
},
2016
"dependencies": {
2117
"typescript": "^5.5.3",
2218
"vite": "^5.0.10"

packages/scope/src/index.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
11
import { createHash } from "node:crypto";
22
import type { AstroConfig } from "astro";
33
import { normalizePath } from "vite";
4+
import "../ambient.d.ts";
45

56
type VitePlugin = Required<AstroConfig["vite"]>["plugins"][number];
67

7-
import "../ambient.d.ts";
8-
98
const virtualMod = "simple:scope";
109

1110
export default function vitePluginSimpleScope(): VitePlugin {

www/src/content/docs/scope.md

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -35,14 +35,7 @@ Simple scope is a vite plugin compatible with any vite-based framework (Astro, N
3535
npm i vite-plugin-simple-scope
3636
```
3737

38-
Then, set up type inferencing for the `simple:scope` module with an `env.d.ts` file. You can create this file at the base of your project, or add to the provided `src/env.d.ts` file for frameworks like Astro:
39-
40-
```ts
41-
// env.d.ts
42-
/// <reference types="vite-plugin-simple-scope/types" />
43-
```
44-
45-
Finally, apply as a vite plugin in your framework of choice:
38+
Then, apply as a vite plugin in your framework of choice:
4639

4740
```js
4841
import simpleScope from 'vite-plugin-simple-scope';

0 commit comments

Comments
 (0)