-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: main/module/exports in package.json
- Loading branch information
Showing
4 changed files
with
16 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
import { default as m } from "../dist/index.js"; | ||
export default m.default; | ||
export default typeof m === "function" ? m : m.default; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
module.exports = require("../dist/index"); | ||
module.exports = require("../dist/index").default; | ||
module.exports.default = require("../dist/index").default; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
import type _default from "../dist/index.d.ts"; | ||
declare const _export: typeof _default & { default: typeof _default }; | ||
export = _export; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,11 +2,17 @@ | |
"name": "vite-plugin-top-level-await", | ||
"version": "1.4.0", | ||
"description": "Transform code to support top-level await in normal browsers for Vite.", | ||
"main": "dist/index.js", | ||
"main": "./exports/require.cjs", | ||
"module": "./exports/import.mjs", | ||
"exports": { | ||
"types": "./dist/index.d.ts", | ||
"import": "./exports/import.mjs", | ||
"require": "./exports/require.cjs" | ||
"import": { | ||
"types": "./dist/index.d.ts", | ||
"default": "./exports/import.mjs" | ||
}, | ||
"require": { | ||
"types": "./exports/require.d.cts", | ||
"default": "./exports/require.cjs" | ||
} | ||
}, | ||
"repository": "https://github.com/Menci/vite-plugin-top-level-await", | ||
"author": "Menci <[email protected]>", | ||
|