Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: fixed missing type file in package.json file entry #31

Merged
merged 1 commit into from
May 23, 2024

Conversation

iceprosurface
Copy link
Contributor

No description provided.

@chenxch
Copy link
Owner

chenxch commented May 15, 2024

@iceprosurface Maybe we can add a types, WDYT?

@iceprosurface
Copy link
Contributor Author

I don't know why put index.d.ts outside, in my opinion, a better way would be to treat it as a type.ts and put it directly in src.
Then add "type": "dist/index.d.ts", to package.json

diff --git a/src/core/transform.ts b/src/core/transform.ts
index 7ba74ea..fd3f064 100644
--- a/src/core/transform.ts
+++ b/src/core/transform.ts
@@ -1,4 +1,4 @@
-import type {TransformOptions, TransformIndexHtmlConfig} from '../../index'
+import type {TransformOptions, TransformIndexHtmlConfig} from '../types'
 import {parse} from 'node-html-parser'
 import {replace, replaceImport, replaceInStringLiteral, replaceInTemplateElement, replaceSrc} from './utils'
 import {StringAsBytes, collectMatchingStrings, parseCode} from "./ast";
diff --git a/src/index.ts b/src/index.ts
index 41c31b6..7ed46f3 100644
--- a/src/index.ts
+++ b/src/index.ts
@@ -1,5 +1,5 @@
 import type { Plugin } from 'vite'
-import type { Options, TransformOptions } from '../index'
+import type { Options, TransformOptions } from './types'
 import { transformChunk, transformAsset, transformLegacyHtml, transformHtml } from './core/transform'
 
 export function dynamicBase(options?: Options): Plugin {
diff --git a/index.d.ts b/src/types.ts
similarity index 100%
rename from index.d.ts
rename to src/types.ts

@chenxch
Copy link
Owner

chenxch commented May 20, 2024

Agree, if you don't mind you can go ahead and do it.

@iceprosurface
Copy link
Contributor Author

The update has been completed.

Copy link
Owner

@chenxch chenxch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

@chenxch chenxch merged commit d1cb4ed into chenxch:main May 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants