-
-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: add esbuild 0.21 to allowed range (#58)
- Loading branch information
1 parent
c9481b3
commit 0409b3f
Showing
7 changed files
with
428 additions
and
133 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
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 |
---|---|---|
|
@@ -6,3 +6,4 @@ node_modules | |
|
||
# Build artefacts | ||
dist | ||
temp |
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 |
---|---|---|
|
@@ -7,7 +7,8 @@ | |
"typecheck": "tsc --noEmit", | ||
"prebuild": "rimraf ./dist", | ||
"build": "tsc", | ||
"watch": "tsc --watch" | ||
"watch": "tsc --watch", | ||
"test": "node ./test/unit/index.test.mjs" | ||
}, | ||
"repository": "https://github.com/pradel/esbuild-node-externals.git", | ||
"author": "Leo Pradel <[email protected]>", | ||
|
@@ -30,11 +31,11 @@ | |
"tslib": "^2.4.1" | ||
}, | ||
"peerDependencies": { | ||
"esbuild": "0.12 - 0.20" | ||
"esbuild": "0.12 - 0.21" | ||
}, | ||
"devDependencies": { | ||
"@types/node": "^18.15.10", | ||
"esbuild": "^0.20.0", | ||
"esbuild": "^0.21.0", | ||
"rimraf": "^4.4.1", | ||
"typescript": "^4.9.4" | ||
} | ||
|
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 { __extends } from 'tslib' | ||
|
||
console.log(__extends) |
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,7 @@ | ||
{ | ||
"name": "fixture-pkg", | ||
"private": true, | ||
"dependencies": { | ||
"tslib": "*" | ||
} | ||
} |
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,30 @@ | ||
import assert from 'node:assert' | ||
import fs from 'node:fs/promises' | ||
import path from 'node:path' | ||
import { describe, it } from 'node:test' | ||
import { fileURLToPath } from 'node:url' | ||
import { build } from 'esbuild' | ||
import { nodeExternalsPlugin } from 'esbuild-node-externals' | ||
|
||
const __dirname = path.dirname(fileURLToPath(import.meta.url)) | ||
|
||
describe('nodeExternalsPlugin', () => { | ||
it('should exclude node_modules from bundle', async () => { | ||
const plugin = nodeExternalsPlugin() | ||
const config = { | ||
absWorkingDir: path.resolve(__dirname, '../fixtures'), | ||
entryPoints: ['index.mjs'], | ||
outdir: '../temp', | ||
bundle: true, | ||
} | ||
await build(config) | ||
const result1 = await fs.readFile(path.resolve(__dirname, '../temp/index.js'), 'utf8') | ||
assert.ok(result1.includes('node_modules/tslib/tslib.es6.mjs'), true) | ||
|
||
await build({ | ||
...config, | ||
plugins: [plugin] | ||
}) | ||
assert.ok(result1.includes('node_modules/tslib/tslib.es6.mjs'), false) | ||
}) | ||
}) |
Oops, something went wrong.