Skip to content

Commit

Permalink
Use faux ESM instead of native ESM
Browse files Browse the repository at this point in the history
  • Loading branch information
h3poteto committed Oct 9, 2023
1 parent bead244 commit 2b8d395
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 44 deletions.
13 changes: 0 additions & 13 deletions example/browser/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,6 @@ module.exports = {
mode: 'development',
devtool: 'source-map',
resolve: {
extensionAlias: {
'.js': ['.ts', '.js']
},
extensions: ['.ts', '.js'],
fallback: {
net: false,
Expand All @@ -36,16 +33,6 @@ module.exports = {
{
test: /\.ts$/,
loader: 'ts-loader'
},
{
test: /\.m?js$/,
type: 'javascript/auto'
},
{
test: /\.m?js$/,
resolve: {
fullySpecified: false
}
}
]
},
Expand Down
20 changes: 3 additions & 17 deletions megalodon/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,9 @@
"description": "Mastodon API client for node.js and browser",
"main": "./lib/src/index.js",
"typings": "./lib/src/index.d.ts",
"module": "./lib/mjs/src/index.js",
"exports": {
".": {
"import": {
"types": "./lib/mjs/src/index.d.ts",
"default": "./lib/mjs/src/index.js"
},
"require": {
"types": "./lib/src/index.d.ts",
"default": "./lib/src/index.js"
},
"default": "./lib/src/index.js"
}
},
"module": "./lib/esm/src/index.js",
"scripts": {
"build": "tsc -p ./ && tsc -p tsconfig.mjs.json && tsconfig-to-dual-package",
"build": "tsc -p ./ && tsc -p tsconfig.mjs.json",
"lint": "eslint --ext .js,.ts src",
"doc": "typedoc --out ../docs ./src",
"test": "NODE_ENV=test jest -u --maxWorkers=3"
Expand Down Expand Up @@ -79,8 +66,7 @@
"typescript": "5.2.2",
"uuid": "^9.0.1",
"ws": "8.14.2",
"isomorphic-ws": "^5.0.0",
"tsconfig-to-dual-package": "^1.2.0"
"isomorphic-ws": "^5.0.0"
},
"devDependencies": {
"@types/core-js": "^2.5.6",
Expand Down
4 changes: 2 additions & 2 deletions megalodon/tsconfig.mjs.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"extends": "./tsconfig.json",
"compilerOptions": {
"module": "ES2020",
"outDir": "lib/mjs"
"module": "ESNext",
"outDir": "lib/esm"
}
}
12 changes: 0 additions & 12 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4483,11 +4483,6 @@ resolve-from@^5.0.0:
resolved "https://registry.yarnpkg.com/resolve-from/-/resolve-from-5.0.0.tgz#c35225843df8f776df21c57557bc087e9dfdfc69"
integrity sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==

resolve-tsconfig@^1.3.0:
version "1.3.0"
resolved "https://registry.yarnpkg.com/resolve-tsconfig/-/resolve-tsconfig-1.3.0.tgz#1b82e3ae9a47d4ad45a048e55fa6272bab1b1adb"
integrity sha512-Ba5mo3soshb2CnIcNFz75F/80H/2eMVxrlmdgoSDNH7Lr6UAoT3BvxNtc7+VXqKSBlC0SJk2qSXOTcy0/p7cFw==

resolve.exports@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/resolve.exports/-/resolve.exports-2.0.0.tgz#c1a0028c2d166ec2fbf7d0644584927e76e7400e"
Expand Down Expand Up @@ -4976,13 +4971,6 @@ ts-loader@^9.4.4:
micromatch "^4.0.0"
semver "^7.3.4"

tsconfig-to-dual-package@^1.2.0:
version "1.2.0"
resolved "https://registry.yarnpkg.com/tsconfig-to-dual-package/-/tsconfig-to-dual-package-1.2.0.tgz#c20e5950747a468850af301567e9dbb9347fe039"
integrity sha512-UtMinqTLfWr9fX6KidLsEcCJoA/jSLPIS00ohpQybMSxA3LlJCRf2DsGPw4AJJ8AP4FOHfbQJFJ5XgLoL7RoLw==
dependencies:
resolve-tsconfig "^1.3.0"

tslib@^2.5.0, tslib@^2.6.0:
version "2.6.2"
resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.6.2.tgz#703ac29425e7b37cd6fd456e92404d46d1f3e4ae"
Expand Down

0 comments on commit 2b8d395

Please sign in to comment.