Showing preview only (8,865K chars total). Download the full file or copy to clipboard to get everything.
Repository: evanw/esbuild
Branch: main
Commit: f9c9012cdb05
Files: 326
Total size: 8.4 MB
Directory structure:
gitextract_8wuhqmhk/
├── .editorconfig
├── .github/
│ ├── ISSUE_TEMPLATE/
│ │ └── new-issue.md
│ └── workflows/
│ ├── ci.yml
│ ├── e2e.yml
│ ├── publish.yml
│ └── validate.yml
├── .gitignore
├── CHANGELOG-2020.md
├── CHANGELOG-2021.md
├── CHANGELOG-2022.md
├── CHANGELOG-2023.md
├── CHANGELOG-2024.md
├── CHANGELOG.md
├── LICENSE.md
├── Makefile
├── README.md
├── RUNBOOK.md
├── cmd/
│ └── esbuild/
│ ├── main.go
│ ├── main_other.go
│ ├── main_wasm.go
│ ├── service.go
│ ├── stdio_protocol.go
│ └── version.go
├── compat-table/
│ ├── .gitignore
│ ├── README.md
│ ├── package.json
│ ├── src/
│ │ ├── caniuse.ts
│ │ ├── compat-table.ts
│ │ ├── css_table.ts
│ │ ├── index.ts
│ │ ├── js_table.ts
│ │ ├── mdn.ts
│ │ └── types.d.ts
│ └── tsconfig.json
├── dl.sh
├── docs/
│ ├── architecture.md
│ └── development.md
├── go.mod
├── go.sum
├── go.version
├── internal/
│ ├── api_helpers/
│ │ └── use_timer.go
│ ├── ast/
│ │ └── ast.go
│ ├── bundler/
│ │ └── bundler.go
│ ├── bundler_tests/
│ │ ├── bundler_css_test.go
│ │ ├── bundler_dce_test.go
│ │ ├── bundler_default_test.go
│ │ ├── bundler_glob_test.go
│ │ ├── bundler_importphase_test.go
│ │ ├── bundler_importstar_test.go
│ │ ├── bundler_importstar_ts_test.go
│ │ ├── bundler_loader_test.go
│ │ ├── bundler_lower_test.go
│ │ ├── bundler_packagejson_test.go
│ │ ├── bundler_splitting_test.go
│ │ ├── bundler_test.go
│ │ ├── bundler_ts_test.go
│ │ ├── bundler_tsconfig_test.go
│ │ ├── bundler_yarnpnp_test.go
│ │ └── snapshots/
│ │ ├── snapshots_css.txt
│ │ ├── snapshots_dce.txt
│ │ ├── snapshots_default.txt
│ │ ├── snapshots_glob.txt
│ │ ├── snapshots_importphase.txt
│ │ ├── snapshots_importstar.txt
│ │ ├── snapshots_importstar_ts.txt
│ │ ├── snapshots_loader.txt
│ │ ├── snapshots_lower.txt
│ │ ├── snapshots_packagejson.txt
│ │ ├── snapshots_splitting.txt
│ │ ├── snapshots_ts.txt
│ │ ├── snapshots_tsconfig.txt
│ │ └── snapshots_yarnpnp.txt
│ ├── cache/
│ │ ├── cache.go
│ │ ├── cache_ast.go
│ │ └── cache_fs.go
│ ├── cli_helpers/
│ │ └── cli_helpers.go
│ ├── compat/
│ │ ├── compat.go
│ │ ├── compat_test.go
│ │ ├── css_table.go
│ │ └── js_table.go
│ ├── config/
│ │ ├── config.go
│ │ └── globals.go
│ ├── css_ast/
│ │ ├── css_ast.go
│ │ └── css_decl_table.go
│ ├── css_lexer/
│ │ ├── css_lexer.go
│ │ └── css_lexer_test.go
│ ├── css_parser/
│ │ ├── css_color_spaces.go
│ │ ├── css_decls.go
│ │ ├── css_decls_animation.go
│ │ ├── css_decls_border_radius.go
│ │ ├── css_decls_box.go
│ │ ├── css_decls_box_shadow.go
│ │ ├── css_decls_color.go
│ │ ├── css_decls_composes.go
│ │ ├── css_decls_container.go
│ │ ├── css_decls_font.go
│ │ ├── css_decls_font_family.go
│ │ ├── css_decls_font_weight.go
│ │ ├── css_decls_gradient.go
│ │ ├── css_decls_list_style.go
│ │ ├── css_decls_transform.go
│ │ ├── css_nesting.go
│ │ ├── css_parser.go
│ │ ├── css_parser_media.go
│ │ ├── css_parser_selector.go
│ │ ├── css_parser_test.go
│ │ └── css_reduce_calc.go
│ ├── css_printer/
│ │ ├── css_printer.go
│ │ └── css_printer_test.go
│ ├── fs/
│ │ ├── error_other.go
│ │ ├── error_wasm+windows.go
│ │ ├── filepath.go
│ │ ├── fs.go
│ │ ├── fs_mock.go
│ │ ├── fs_mock_test.go
│ │ ├── fs_real.go
│ │ ├── fs_zip.go
│ │ ├── iswin_other.go
│ │ ├── iswin_wasm.go
│ │ ├── iswin_windows.go
│ │ ├── modkey_other.go
│ │ └── modkey_unix.go
│ ├── graph/
│ │ ├── graph.go
│ │ ├── input.go
│ │ └── meta.go
│ ├── helpers/
│ │ ├── bitset.go
│ │ ├── comment.go
│ │ ├── dataurl.go
│ │ ├── dataurl_test.go
│ │ ├── float.go
│ │ ├── glob.go
│ │ ├── hash.go
│ │ ├── joiner.go
│ │ ├── mime.go
│ │ ├── path.go
│ │ ├── quote.go
│ │ ├── serializer.go
│ │ ├── stack.go
│ │ ├── strings.go
│ │ ├── timer.go
│ │ ├── typos.go
│ │ ├── utf.go
│ │ └── waitgroup.go
│ ├── js_ast/
│ │ ├── js_ast.go
│ │ ├── js_ast_helpers.go
│ │ ├── js_ast_test.go
│ │ ├── js_ident.go
│ │ └── unicode.go
│ ├── js_lexer/
│ │ ├── js_lexer.go
│ │ ├── js_lexer_test.go
│ │ └── tables.go
│ ├── js_parser/
│ │ ├── global_name_parser.go
│ │ ├── js_parser.go
│ │ ├── js_parser_lower.go
│ │ ├── js_parser_lower_class.go
│ │ ├── js_parser_lower_test.go
│ │ ├── js_parser_test.go
│ │ ├── json_parser.go
│ │ ├── json_parser_test.go
│ │ ├── sourcemap_parser.go
│ │ ├── ts_parser.go
│ │ └── ts_parser_test.go
│ ├── js_printer/
│ │ ├── js_printer.go
│ │ └── js_printer_test.go
│ ├── linker/
│ │ ├── debug.go
│ │ └── linker.go
│ ├── logger/
│ │ ├── logger.go
│ │ ├── logger_darwin.go
│ │ ├── logger_linux.go
│ │ ├── logger_other.go
│ │ ├── logger_test.go
│ │ ├── logger_windows.go
│ │ └── msg_ids.go
│ ├── renamer/
│ │ └── renamer.go
│ ├── resolver/
│ │ ├── dataurl.go
│ │ ├── package_json.go
│ │ ├── resolver.go
│ │ ├── testExpectations.json
│ │ ├── tsconfig_json.go
│ │ ├── yarnpnp.go
│ │ └── yarnpnp_test.go
│ ├── runtime/
│ │ ├── runtime.go
│ │ └── runtime_test.go
│ ├── sourcemap/
│ │ └── sourcemap.go
│ ├── test/
│ │ ├── diff.go
│ │ └── util.go
│ └── xxhash/
│ ├── LICENSE.txt
│ ├── README.md
│ ├── xxhash.go
│ └── xxhash_other.go
├── lib/
│ ├── README.md
│ ├── deno/
│ │ ├── external.d.ts
│ │ ├── mod.ts
│ │ └── wasm.ts
│ ├── npm/
│ │ ├── browser.ts
│ │ ├── node-install.ts
│ │ ├── node-platform.ts
│ │ ├── node-shim.ts
│ │ └── node.ts
│ ├── package.json
│ ├── shared/
│ │ ├── common.ts
│ │ ├── stdio_protocol.ts
│ │ ├── types.ts
│ │ ├── uint8array_json_parser.ts
│ │ └── worker.ts
│ ├── tsconfig-deno.json
│ ├── tsconfig-nolib.json
│ └── tsconfig.json
├── npm/
│ ├── @esbuild/
│ │ ├── aix-ppc64/
│ │ │ ├── README.md
│ │ │ └── package.json
│ │ ├── android-arm/
│ │ │ ├── README.md
│ │ │ └── package.json
│ │ ├── android-arm64/
│ │ │ ├── README.md
│ │ │ └── package.json
│ │ ├── android-x64/
│ │ │ ├── README.md
│ │ │ └── package.json
│ │ ├── darwin-arm64/
│ │ │ ├── README.md
│ │ │ └── package.json
│ │ ├── darwin-x64/
│ │ │ ├── README.md
│ │ │ └── package.json
│ │ ├── freebsd-arm64/
│ │ │ ├── README.md
│ │ │ └── package.json
│ │ ├── freebsd-x64/
│ │ │ ├── README.md
│ │ │ └── package.json
│ │ ├── linux-arm/
│ │ │ ├── README.md
│ │ │ └── package.json
│ │ ├── linux-arm64/
│ │ │ ├── README.md
│ │ │ └── package.json
│ │ ├── linux-ia32/
│ │ │ ├── README.md
│ │ │ └── package.json
│ │ ├── linux-loong64/
│ │ │ ├── README.md
│ │ │ └── package.json
│ │ ├── linux-mips64el/
│ │ │ ├── README.md
│ │ │ └── package.json
│ │ ├── linux-ppc64/
│ │ │ ├── README.md
│ │ │ └── package.json
│ │ ├── linux-riscv64/
│ │ │ ├── README.md
│ │ │ └── package.json
│ │ ├── linux-s390x/
│ │ │ ├── README.md
│ │ │ └── package.json
│ │ ├── linux-x64/
│ │ │ ├── README.md
│ │ │ └── package.json
│ │ ├── netbsd-arm64/
│ │ │ ├── README.md
│ │ │ └── package.json
│ │ ├── netbsd-x64/
│ │ │ ├── README.md
│ │ │ └── package.json
│ │ ├── openbsd-arm64/
│ │ │ ├── README.md
│ │ │ └── package.json
│ │ ├── openbsd-x64/
│ │ │ ├── README.md
│ │ │ └── package.json
│ │ ├── openharmony-arm64/
│ │ │ ├── README.md
│ │ │ └── package.json
│ │ ├── sunos-x64/
│ │ │ ├── README.md
│ │ │ └── package.json
│ │ ├── wasi-preview1/
│ │ │ ├── README.md
│ │ │ └── package.json
│ │ ├── win32-arm64/
│ │ │ ├── README.md
│ │ │ └── package.json
│ │ ├── win32-ia32/
│ │ │ ├── README.md
│ │ │ └── package.json
│ │ └── win32-x64/
│ │ ├── README.md
│ │ └── package.json
│ ├── esbuild/
│ │ ├── LICENSE.md
│ │ ├── README.md
│ │ └── package.json
│ └── esbuild-wasm/
│ ├── LICENSE.md
│ ├── README.md
│ └── package.json
├── pkg/
│ ├── api/
│ │ ├── api.go
│ │ ├── api_impl.go
│ │ ├── api_impl_test.go
│ │ ├── api_js_table.go
│ │ ├── api_test.go
│ │ ├── favicon.go
│ │ ├── serve_other.go
│ │ ├── serve_wasm.go
│ │ └── watcher.go
│ └── cli/
│ ├── cli.go
│ ├── cli_impl.go
│ ├── cli_js_table.go
│ └── mangle_cache.go
├── require/
│ ├── old-ts/
│ │ ├── README.md
│ │ └── package.json
│ ├── parcel2/
│ │ ├── .terserrc
│ │ └── package.json
│ ├── rollup/
│ │ └── package.json
│ ├── webpack5/
│ │ └── package.json
│ └── yarnpnp/
│ ├── .gitignore
│ ├── bar/
│ │ └── index.js
│ ├── foo/
│ │ ├── index.js
│ │ └── package.json
│ ├── in.mjs
│ ├── package.json
│ └── tsconfig.json
├── scripts/
│ ├── browser/
│ │ ├── browser-tests.js
│ │ ├── index.html
│ │ └── package.json
│ ├── dataurl-escapes.html
│ ├── decorator-tests.js
│ ├── decorator-tests.ts
│ ├── deno-tests.js
│ ├── destructuring-fuzzer.js
│ ├── end-to-end-tests.js
│ ├── esbuild.js
│ ├── gen-unicode-table.js
│ ├── gradient-tests.css
│ ├── gradient-tests.html
│ ├── graph-debugger.html
│ ├── js-api-tests.js
│ ├── node-unref-tests.js
│ ├── package.json
│ ├── parse-ts-files.js
│ ├── plugin-tests.js
│ ├── register-test.js
│ ├── terser-tests.js
│ ├── test-yarnpnp.js
│ ├── test262-async.js
│ ├── test262.js
│ ├── try.html
│ ├── ts-type-tests.js
│ ├── tsconfig.json
│ ├── uglify-tests.js
│ ├── verify-source-map.js
│ └── wasm-tests.js
├── staticcheck.conf
└── version.txt
================================================
FILE CONTENTS
================================================
================================================
FILE: .editorconfig
================================================
[*]
indent_style = tab
indent_size = 2
[*.{js,json,ts}]
indent_style = space
indent_size = 2
================================================
FILE: .github/ISSUE_TEMPLATE/new-issue.md
================================================
---
name: New issue
about: This is the template for new issues.
title: ''
labels: ''
assignees: ''
---
<!--
When reporting a bug or requesting a feature, please do the following:
* Describe what esbuild is doing incorrectly and what it should be doing instead.
* Provide a way to reproduce the issue. The best way to do this is to demonstrate the issue on the playground (https://esbuild.github.io/try/) and paste the URL here. A link to a minimal code sample with instructions for how to reproduce the issue may also work. Issues without a way to reproduce them may be closed.
-->
================================================
FILE: .github/workflows/ci.yml
================================================
name: CI
on:
push:
branches: ['*']
pull_request:
branches: ['*']
workflow_dispatch:
permissions:
contents: read # to fetch code (actions/checkout)
jobs:
esbuild-platforms:
# Split this out into its own runner because it's slow
name: esbuild CI (All Platforms)
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Read go.version
run: |
echo "GO_VERSION=$(cat go.version)" >> $GITHUB_ENV
- name: Set up Go 1.x
uses: actions/setup-go@v3
with:
go-version: ${{ env.GO_VERSION }}
id: go
- name: Setup Node.js environment
uses: actions/setup-node@v3
with:
node-version: 18
- name: Ensure all platforms can be built
run: make platform-all
# Plan 9 is not a supported platform, but someone wanted esbuild to be able to build for it anyway...
- name: Ensure esbuild can be built for Plan 9
run: |
GOOS=plan9 GOARCH=386 go build ./cmd/esbuild
GOOS=plan9 GOARCH=amd64 go build ./cmd/esbuild
GOOS=plan9 GOARCH=arm go build ./cmd/esbuild
esbuild-slow:
# Split these out into their own runner because they're very slow
name: esbuild CI (Slow Tests)
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Read go.version
run: |
echo "GO_VERSION=$(cat go.version)" >> $GITHUB_ENV
- name: Set up Go 1.x
uses: actions/setup-go@v3
with:
go-version: ${{ env.GO_VERSION }}
id: go
- name: Setup Node.js environment
uses: actions/setup-node@v3
with:
node-version: 16
# Note: These tests break with node version 18. Something about WebAssembly.
- name: Rollup Tests
run: make test-rollup
- name: Uglify Tests
run: CI=1 make uglify
- name: Type check tsc using tsc
run: make test-tsc
esbuild:
name: esbuild CI
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Read go.version (non-Windows)
if: matrix.os != 'windows-latest'
run: |
echo "GO_VERSION=$(cat go.version)" >> $GITHUB_ENV
- name: Read go.version (Windows)
if: matrix.os == 'windows-latest'
run: |
echo "GO_VERSION=$(cat go.version)" >> $Env:GITHUB_ENV
- name: Set up Go 1.x
uses: actions/setup-go@v3
with:
go-version: ${{ env.GO_VERSION }}
id: go
- name: Setup Node.js environment
uses: actions/setup-node@v3
with:
node-version: 18
- name: Setup Deno 1.40.0
uses: denoland/setup-deno@main
with:
deno-version: v1.40.0
- name: go test
run: go test -race ./internal/...
- name: go vet
run: go vet ./cmd/... ./internal/... ./pkg/...
- name: Deno Tests (non-Windows)
if: matrix.os != 'windows-latest'
run: make test-deno
- name: Deno Tests (Windows)
if: matrix.os == 'windows-latest'
run: make test-deno-windows
- name: Test for path/filepath
if: matrix.os == 'ubuntu-latest'
run: make no-filepath
- name: Make sure "check-go-version" works (non-Windows)
if: matrix.os != 'windows-latest'
run: make check-go-version
- name: go fmt
if: matrix.os == 'macos-latest'
run: make fmt-go
- name: npm ci
run: cd scripts && npm ci
- name: Register Test (ESBUILD_WORKER_THREADS=0, non-Windows)
if: matrix.os != 'windows-latest'
run: ESBUILD_WORKER_THREADS=0 node scripts/register-test.js
- name: Register Test
run: node scripts/register-test.js
- name: Verify Source Map
run: node scripts/verify-source-map.js
- name: E2E Tests
run: node scripts/end-to-end-tests.js
- name: JS API Tests (ESBUILD_WORKER_THREADS=0, non-Windows)
if: matrix.os != 'windows-latest'
run: ESBUILD_WORKER_THREADS=0 node scripts/js-api-tests.js
- name: JS API Tests
run: node scripts/js-api-tests.js
- name: NodeJS Unref Tests
run: node scripts/node-unref-tests.js
- name: Plugin Tests
run: node scripts/plugin-tests.js
- name: TypeScript Type Definition Tests
if: matrix.os == 'ubuntu-latest'
run: node scripts/ts-type-tests.js
- name: JS API Type Check
if: matrix.os == 'ubuntu-latest'
run: make lib-typecheck
- name: Decorator Tests
if: matrix.os == 'ubuntu-latest'
run: make decorator-tests
- name: WebAssembly API Tests (browser)
if: matrix.os == 'ubuntu-latest'
run: make test-wasm-browser
- name: WebAssembly API Tests (node, Linux)
if: matrix.os == 'ubuntu-latest'
run: make test-wasm-node
- name: WebAssembly API Tests (node, non-Linux)
if: matrix.os != 'ubuntu-latest'
run: node scripts/wasm-tests.js
- name: Sucrase Tests
if: matrix.os == 'ubuntu-latest'
run: make test-sucrase
- name: Esprima Tests
if: matrix.os == 'ubuntu-latest'
run: make test-esprima
- name: Preact Splitting Tests
if: matrix.os == 'ubuntu-latest'
run: make test-preact-splitting
- name: Check the unicode table generator
if: matrix.os == 'ubuntu-latest'
run: cd scripts && node gen-unicode-table.js
- name: Yarn PnP tests
run: |
# Note that Yarn recently deliberately broke "npm install -g yarn".
# They say you now have to run "corepack enable" to fix it. They have
# written about this here: https://yarnpkg.com/corepack
corepack enable
make test-yarnpnp
esbuild-old-go-version:
name: esbuild CI (old Go version)
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Set up Go 1.13 (the minimum required Go version for esbuild)
uses: actions/setup-go@v3
with:
go-version: 1.13
id: go
- name: go build
run: go build ./cmd/esbuild
- name: go test
run: go test ./internal/...
- name: make test-old-ts
run: make test-old-ts
esbuild-old-deno-version:
name: esbuild CI (old Deno version)
runs-on: ${{ matrix.os }}
strategy:
matrix:
# Note: I'm excluding "macos-latest" here because GitHub recently
# changed their macOS CI VMs from x86_64 to aarch64 (i.e. from Intel
# to ARM) and it looks like old Deno versions have WASM bugs on ARM.
# Specifically, this test now crashes like this when run on macOS:
#
# #
# # Fatal error in , line 0
# # Check failed: RwxMemoryWriteScope::IsAllowed().
# #
# #
# #
# #FailureMessage Object: 0x16f282368
# ==== C stack trace ===============================
#
# 0 deno 0x0000000101bb8e78 v8::base::debug::StackTrace::StackTrace() + 24
# 1 deno 0x0000000101bbda84 v8::platform::(anonymous namespace)::PrintStackTrace() + 24
# 2 deno 0x0000000101bb6230 V8_Fatal(char const*, ...) + 268
# 3 deno 0x000000010227e468 v8::internal::wasm::WasmCodeManager::MemoryProtectionKeysEnabled() const + 0
# 4 deno 0x0000000102299994 v8::internal::wasm::WasmEngine::InitializeOncePerProcess() + 44
# 5 deno 0x0000000101e78fd0 v8::internal::V8::Initialize() + 1576
# 6 deno 0x0000000101c3b7d8 v8::V8::Initialize(int) + 32
# 7 deno 0x00000001011833dc _ZN3std4sync4once4Once9call_once28_$u7b$$u7b$closure$u7d$$u7d$17h2bbe74d315ab3e84E + 488
# 8 deno 0x00000001017f8854 std::sync::once::Once::call_inner::h70fbdd48fe002a01 + 724
# 9 deno 0x000000010115ca80 deno_core::runtime::JsRuntime::new::h9c5f1a9c910f1eed + 192
# 10 deno 0x00000001014d3b50 deno_runtime::worker::MainWorker::bootstrap_from_options::h91a0eaac48dfc18e + 4260
# 11 deno 0x0000000100ee692c deno::create_main_worker::h0d1622755821ae7f + 1608
# 12 deno 0x0000000100f6c688 _ZN97_$LT$core..future..from_generator..GenFuture$LT$T$GT$$u20$as$u20$core..future..future..Future$GT$4poll17h87ddfac9566887c8E + 492
# 13 deno 0x0000000100f6ba18 tokio::runtime::task::raw::poll::h7d51f1a7d5a61c15 + 1396
# 14 deno 0x0000000101917b98 std::sys_common::backtrace::__rust_begin_short_backtrace::hd384935dcffe6f2d + 332
# 15 deno 0x0000000101917954 _ZN4core3ops8function6FnOnce40call_once$u7b$$u7b$vtable.shim$u7d$$u7d$17he2755732d5d29cf0E + 124
# 16 deno 0x0000000101829684 std::sys::unix::thread::Thread::new::thread_start::h432bc30153e41f60 + 48
# 17 libsystem_pthread.dylib 0x000000018a436f94 _pthread_start + 136
# 18 libsystem_pthread.dylib 0x000000018a431d34 thread_start + 8
#
# Hopefully running this old Deno version on Linux is sufficiently
# close to running it on macOS. For reference, I believe this is the
# change that GitHub made which broke this test:
# https://github.blog/changelog/2023-10-02-github-actions-apple-silicon-m1-macos-runners-are-now-available-in-public-beta/
os: [ubuntu-latest, windows-latest]
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Read go.version (non-Windows)
if: matrix.os != 'windows-latest'
run: |
echo "GO_VERSION=$(cat go.version)" >> $GITHUB_ENV
- name: Read go.version (Windows)
if: matrix.os == 'windows-latest'
run: |
echo "GO_VERSION=$(cat go.version)" >> $Env:GITHUB_ENV
- name: Set up Go 1.x
uses: actions/setup-go@v3
with:
go-version: ${{ env.GO_VERSION }}
id: go
# Make sure esbuild works with old versions of Deno. Note: It's important
# to test a version before 1.31.0, which introduced the "Deno.Command" API.
- name: Setup Deno 1.24.0
uses: denoland/setup-deno@main
with:
deno-version: v1.24.0
- name: Setup Node.js environment
uses: actions/setup-node@v3
with:
node-version: 18
- name: Deno Tests (non-Windows)
if: matrix.os != 'windows-latest'
run: make test-deno
- name: Deno Tests (Windows)
if: matrix.os == 'windows-latest'
run: make test-deno-windows
================================================
FILE: .github/workflows/e2e.yml
================================================
name: End-to-end install tests
on:
schedule:
- cron: '0 */6 * * *'
workflow_dispatch:
permissions:
contents: read # to fetch code (actions/checkout)
jobs:
validate:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Setup Node.js environment
uses: actions/setup-node@v3
with:
node-version: 18
# The version of Deno is pinned because version 1.25.1 was causing test
# flakes due to random segfaults.
- name: Setup Deno 1.24.0
uses: denoland/setup-deno@main
with:
deno-version: v1.24.0
- name: Test npm
run: |
npm i -g npm@next-7
time make test-e2e-npm
- name: Test pnpm
run: |
npm i -g pnpm@next-7
time make test-e2e-pnpm
- name: Test yarn (classic)
run: |
npm i -g yarn@latest
time make test-e2e-yarn
- name: Test yarn (berry)
run: |
npm i -g yarn@latest
time make test-e2e-yarn-berry
- name: Test deno
run: |
time make test-e2e-deno
================================================
FILE: .github/workflows/publish.yml
================================================
name: Publish
permissions:
id-token: write
contents: write
on:
push:
branches:
- main
paths:
- version.txt
jobs:
publish:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Read version info
run: |
echo "GO_VERSION=$(cat go.version)" >> $GITHUB_ENV
echo "ESBUILD_VERSION=$(cat version.txt)" >> $GITHUB_ENV
# This is here to fail quickly if the release already exists
- name: Try to create the "v${{ env.ESBUILD_VERSION }}" tag
run: |
git fetch --tags
git tag "v$ESBUILD_VERSION"
- name: Extract the release notes
run: |
CHANGELOG=$(awk -v "ver=$ESBUILD_VERSION" '/^## / { if (p) { exit }; if ($2 == ver) { p=1; next} } p' CHANGELOG.md)
echo "CHANGELOG<<EOF" >> $GITHUB_ENV
echo "$CHANGELOG" >> $GITHUB_ENV
echo "EOF" >> $GITHUB_ENV
# Make sure we'll be able to generate release notes later on below
- name: Release notes must not be empty
run: |
test -n "$CHANGELOG"
- name: Set up Go ${{ env.GO_VERSION }}
uses: actions/setup-go@v3
with:
go-version: ${{ env.GO_VERSION }}
- name: Setup Node.js environment
uses: actions/setup-node@v3
with:
node-version: 24
# This updates the version in all "package.json" files
- name: Build for all platforms
run: |
make platform-all
# All "package.json" files should have been updated already by running "make platform-all" and committing the results
- name: Reject uncommitted/untracked changes
run: |
git status --porcelain
test -z "$(git status --porcelain)"
# Trusted publishing requires this specific version of npm
- name: Install npm
run: |
npm install -g npm@11.5.1
- name: Publish packages
run: |
make publish-all
- name: Push the tag to GitHub
run: |
git push origin tag "v$ESBUILD_VERSION"
# Only do this after publishing was successful
- name: Create a GitHub Release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: v${{ env.ESBUILD_VERSION }}
release_name: v${{ env.ESBUILD_VERSION }}
body: ${{ env.CHANGELOG }}
draft: false
prerelease: false
================================================
FILE: .github/workflows/validate.yml
================================================
name: Validate release builds
on:
push:
tags: ['v*']
workflow_dispatch:
permissions:
contents: read # to fetch code (actions/checkout)
jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Read go.version
run: |
echo "GO_VERSION=$(cat go.version)" >> $GITHUB_ENV
- name: Set up Go 1.x
uses: actions/setup-go@v3
with:
go-version: ${{ env.GO_VERSION }}
id: go
- name: Validation checks
run: |
make validate-builds
================================================
FILE: .gitignore
================================================
.DS_Store
.idea/
.vscode/
/bench/
/demo/
/deno/
/esbuild
/github/
/go/
/lib/deno/lib.deno.d.ts
/npm/@esbuild/android-arm/esbuild.wasm
/npm/@esbuild/android-arm/wasm_exec_node.js
/npm/@esbuild/android-arm/wasm_exec.js
/npm/@esbuild/android-x64/esbuild.wasm
/npm/@esbuild/android-x64/wasm_exec_node.js
/npm/@esbuild/android-x64/wasm_exec.js
/npm/@esbuild/openharmony-arm64/esbuild.wasm
/npm/@esbuild/openharmony-arm64/wasm_exec_node.js
/npm/@esbuild/openharmony-arm64/wasm_exec.js
/npm/@esbuild/wasi-preview1/esbuild.wasm
/npm/esbuild-wasm/browser.js
/npm/esbuild-wasm/esbuild.wasm
/npm/esbuild-wasm/esm/
/npm/esbuild-wasm/lib/
/npm/esbuild-wasm/wasm_exec_node.js
/npm/esbuild-wasm/wasm_exec.js
/npm/esbuild/install.js
/npm/esbuild/lib/
/require/*/bench/
/require/*/demo/
/scripts/.*/
/validate/
/www
bin
esbuild.exe
node_modules/
================================================
FILE: CHANGELOG-2020.md
================================================
# Changelog: 2020
This changelog documents all esbuild versions published in the year 2020 (versions 0.3.0 through 0.8.28).
## 0.8.28
* Add a `--summary` flag that prints helpful information after a build ([#631](https://github.com/evanw/esbuild/issues/631))
Normally esbuild's CLI doesn't print anything after doing a build if nothing went wrong. This allows esbuild to be used as part of a more complex chain of tools without the output cluttering the terminal. However, sometimes it is nice to have a quick overview in your terminal of what the build just did. You can now add the `--summary` flag when using the CLI and esbuild will print a summary of what the build generated. It looks something like this:
```
$ ./esbuild --summary --bundle src/Three.js --outfile=build/three.js --sourcemap
build/three.js 1.0mb ⚠️
build/three.js.map 1.8mb
⚡ Done in 43ms
```
* Keep unused imports in TypeScript code in one specific case ([#604](https://github.com/evanw/esbuild/issues/604))
The official TypeScript compiler always removes imported symbols that aren't used as values when converting TypeScript to JavaScript. This is because these symbols could be types and not removing them could result in a run-time module instantiation failure because of missing exports. This even happens when the `tsconfig.json` setting `"importsNotUsedAsValues"` is set to `"preserve"`. Doing this just keeps the import statement itself but confusingly still removes the imports that aren't used as values.
Previously esbuild always exactly matched the behavior of the official TypeScript compiler regarding import removal. However, that is problematic when trying to use esbuild to compile a partial module such as when converting TypeScript to JavaScript inside a file written in the [Svelte](https://svelte.dev/) programming language. Here is an example:
```html
<script lang="ts">
import Counter from './Counter.svelte';
export let name: string = 'world';
</script>
<main>
<h1>Hello {name}!</h1>
<Counter />
</main>
```
The current Svelte compiler plugin for TypeScript only provides esbuild with the contents of the `<script>` tag so to esbuild, the import `Counter` appears to be unused and is removed.
In this release, esbuild deliberately deviates from the behavior of the official TypeScript compiler if all of these conditions are met:
* The `"importsNotUsedAsValues"` field in `tsconfig.json` must be present and must not be set to `"remove"`. This is necessary because this is the only case where esbuild can assume that all imports are values instead of types. Any imports that are types will cause a type error when the code is run through the TypeScript type checker. To import types when the `importsNotUsedAsValues` setting is active, you must use the TypeScript-specific `import type` syntax instead.
* You must not be using esbuild as a bundler. When bundling, esbuild needs to assume that it's not seeing a partial file because the bundling process requires renaming symbols to avoid cross-file name collisions.
* You must not have identifier minification enabled. It's useless to preserve unused imports in this case because referencing them by name won't work anyway. And keeping the unused imports would be counter-productive to minification since they would be extra unnecessary data in the output file.
This should hopefully allow esbuild to be used as a TypeScript-to-JavaScript converter for programming languages such as Svelte, at least in many cases. The build pipeline in esbuild wasn't designed for compiling partial modules and this still won't be a fully robust solution (e.g. some variables may be renamed to avoid name collisions in rare cases). But it's possible that these cases are very unlikely to come up in practice. Basically this change to keep unused imports in this case should be useful at best and harmless at worst.
## 0.8.27
* Mark `import.meta` as supported in node 10.4+ ([#626](https://github.com/evanw/esbuild/issues/626))
It was previously marked as unsupported due to a typo in esbuild's compatibility table, which meant esbuild generated a shim for `import.meta` even when it's not necessary. It should now be marked as supported in node 10.4 and above so the shim will no longer be included when using a sufficiently new target environment such as `--target=node10.4`.
* Fix for when the working directory ends with `/` ([#627](https://github.com/evanw/esbuild/issues/627))
If the working directory ended in `/`, the last path component would be incorrectly duplicated. This was the case when running esbuild with Yarn 2 (but not Yarn 1) and is problematic because some externally-facing directories reference the current working directory in plugins and in output files. The problem has now been fixed and the last path component is no longer duplicated in this case. This fix was contributed by [@remorses](https://github.com/remorses).
* Add an option to omit `sourcesContent` from generated source maps ([#624](https://github.com/evanw/esbuild/issues/624))
You can now pass `--sources-content=false` to omit the `sourcesContent` field from generated source maps. The field embeds the original source code inline in the source map and is the largest part of the source map. This is useful if you don't need the original source code and would like a smaller source map (e.g. you only care about stack traces and don't need the source code for debugging).
* Fix exports from ESM files converted to CJS during code splitting ([#617](https://github.com/evanw/esbuild/issues/617))
This release fixes an edge case where files in ECMAScript module format that are converted to CommonJS format during bundling can generate exports to non-top-level symbols when code splitting is active. These files must be converted to CommonJS format if they are referenced by a `require()` call. When that happens, the symbols in that file are placed inside the CommonJS wrapper closure and are no longer top-level symbols. This means they should no longer be considered exportable for cross-chunk export generation due to code splitting. The result of this fix is that these cases no longer generate output files with module instantiation errors.
* Allow `--define` with array and object literals ([#581](https://github.com/evanw/esbuild/issues/581))
The `--define` feature allows you to replace identifiers such as `DEBUG` with literal expressions such as `false`. This is valuable because the substitution can then participate in constant folding and dead code elimination. For example, `if (DEBUG) { ... }` could become `if (false) { ... }` which would then be completely removed in minified builds. However, doing this with compound literal expressions such as array and object literals is an anti-pattern because it could easily result in many copies of the same object in the output file.
This release adds support for array and object literals with `--define` anyway, but they work differently than other `--define` expressions. In this case a separate virtual file is created and configured to be injected into all files similar to how the `--inject` feature works. This means there is only at most one copy of the value in a given output file. However, these values do not participate in constant folding and dead code elimination, since the object can now potentially be mutated at run-time.
## 0.8.26
* Ensure the current working directory remains unique per `startService()` call
The change in version 0.8.24 to share service instances caused problems for code that calls `process.chdir()` before calling `startService()` to be able to get a service with a different working directory. With this release, calls to `startService()` no longer share the service instance if the working directory was different at the time of creation.
* Consider import references to be side-effect free ([#613](https://github.com/evanw/esbuild/issues/613))
This change improves tree shaking for code containing top-level references to imported symbols such as the following code:
```js
import {Base} from './base'
export class Derived extends Base {}
```
Identifier references are considered side-effect free if they are locally-defined, but esbuild special-cases identifier references to imported symbols in its AST (the identifier `Base` in this example). This meant they did not trigger this check and so were not considered locally-defined and therefore side-effect free. That meant that `Derived` in this example would never be tree-shaken.
The reason for this is that the side-effect determination is made during parsing and during parsing it's not yet known if `./base` is a CommonJS module or not. If it is, then `Base` would be a dynamic run-time property access on `exports.Base` which could hypothetically be a property with a getter that has side effects. Therefore it could be considered incorrect to remove this code due to tree-shaking because there is technically a side effect.
However, this is a very unlikely edge case and not tree-shaking this code violates developer expectations. So with this release, esbuild will always consider references to imported symbols as being side-effect free. This also aligns with ECMAScript module semantics because with ECMAScript modules, it's impossible to have a user-defined getter for an imported symbol. This means esbuild will now tree-shake unused code in cases like this.
* Warn about calling an import namespace object
The following code is an invalid use of an import statement:
```js
import * as express from "express"
express()
```
The `express` symbol here is an import namespace object, not a function, so calling it will fail at run-time. This code should have been written like this instead:
```js
import express from "express"
express()
```
This comes up because for legacy reasons, the TypeScript compiler defaults to a compilation mode where the `import * as` statement is converted to `const express = require("express")` which means you can actually call `express()` successfully. Doing this is incompatible with standard ECMAScript module environments such as the browser, node, and esbuild because an import namespace object is never a function. The TypeScript compiler has a setting to disable this behavior called `esModuleInterop` and they highly recommend applying it both to new and existing projects to avoid these compatibility problems. See [the TypeScript documentation](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-2-7.html#support-for-import-d-from-cjs-from-commonjs-modules-with---esmoduleinterop) for more information.
With this release, esbuild will now issue a warning when you do this. The warning indicates that your code will crash when run and that your code should be fixed.
## 0.8.25
* Fix a performance regression from version 0.8.4 specific to Yarn 2
Code using esbuild's `transformSync` function via Yarn 2 experienced a dramatic slowdown in esbuild version 0.8.4 and above. This version added a wrapper script to fix Yarn 2's incompatibility with binary packages. Some code that tries to avoid unnecessarily calling into the wrapper script contained a bug that caused it to fail, which meant that using `transformSync` with Yarn 2 called into the wrapper script unnecessarily. This launched an extra node process every time the esbuild executable was invoked which can be over 6x slower than just invoking the esbuild executable directly. This release should now invoke the esbuild executable directly without going through the wrapper script, which fixes the performance regression.
* Fix a size regression from version 0.7.9 with certain source maps ([#611](https://github.com/evanw/esbuild/issues/611))
Version 0.7.9 added a new behavior to esbuild where in certain cases a JavaScript file may be split into multiple pieces during bundling. Pieces of the same input file may potentially end up in multiple discontiguous regions in the output file. This was necessary to fix an import ordering bug with CommonJS modules. However, it had the side effect of duplicating that file's information in the resulting source map. This didn't affect source map correctness but it made source maps unnecessarily large. This release corrects the problem by ensuring that a given file's information is only ever represented once in the corresponding source map.
## 0.8.24
* Share reference-counted service instances internally ([#600](https://github.com/evanw/esbuild/issues/600))
Now calling `startService()` multiple times will share the underlying esbuild child process as long as the lifetimes of the service objects overlap (i.e. the time from `startService()` to `service.stop()`). This is just an internal change; there is no change to the public API. It should result in a faster implementation that uses less memory if your code calls `startService()` multiple times. Previously each call to `startService()` generated a separate esbuild child process.
* Fix re-exports of a side-effect free CommonJS module ([#605](https://github.com/evanw/esbuild/issues/605))
This release fixes a regression introduced in version 0.8.19 in which an `import` of an `export {...} from` re-export of a CommonJS module does not include the CommonJS module if it has been marked as `"sideEffects": false` in its `package.json` file. This was the case with the [Ramda](https://ramdajs.com/) library, and was due to an unhandled case in the linker.
* Optionally take binary executable path from environment variable ([#592](https://github.com/evanw/esbuild/issues/592))
You can now set the `ESBUILD_BINARY_PATH` environment variable to cause the JavaScript API to use a different binary executable path. This is useful if you want to substitute a modified version of the `esbuild` binary that contains some extra debugging information. This feature was contributed by [@remorses](https://github.com/remorses).
## 0.8.23
* Fix non-string objects being passed to `transformSync` ([#596](https://github.com/evanw/esbuild/issues/596))
The transform function is only supposed to take a string. The type definitions also specify that the input must be a string. However, it happened to convert non-string inputs to a string and some code relied on that behavior. A change in 0.8.22 broke that behavior for `transformSync` specifically for `Uint8Array` objects, which became an array of numbers instead of a string. This release ensures that the conversion to a string is done up front to avoid something unexpected happening in the implementation. Future releases will likely enforce that the input is a string and throw an error otherwise.
* Revert the speedup to `transformSync` and `buildSync` ([#595](https://github.com/evanw/esbuild/issues/595))
This speedup relies on the `worker_threads` module in node. However, when esbuild is used via `node -r` as in `node -r esbuild-register file.ts`, the worker thread created by esbuild somehow ends up being completely detached from the main thread. This may be a bug in node itself. Regardless, the approach esbuild was using to improve speed doesn't work in all cases so it has been reverted. It's unclear if it's possible to work around this issue. This approach for improving the speed of synchronous APIs may be a dead end.
## 0.8.22
* Escape fewer characters in virtual module paths ([#588](https://github.com/evanw/esbuild/issues/588))
If a module's path is not in the `file` namespace (i.e. it was created by a plugin), esbuild doesn't assume it's a file system path. The meaning of these paths is entirely up to the plugin. It could be anything including a HTTP URL, a string of code, or randomly-generated characters.
Currently esbuild generates a file name for these virtual modules using an internal "human-friendly identifier" that can also be used as a valid JavaScript identifier, which is sometimes used to for example derive the name of the default export of a bundled module. But that means virtual module paths which _do_ happen to represent file system paths could cause more characters to be escaped than necessary. For example, esbuild escapes `-` to `_` because `-` is not valid in a JavaScript identifier.
This release separates the file names derived from virtual module paths from the internal "human-friendly identifier" concept. Characters in the virtual module path that are valid in file paths are no longer escaped.
In the future the output file name of a virtual module will likely be completely customizable with a plugin, so it will be possible to have different behavior for this if desired. But that isn't possible quite yet.
* Speed up the JavaScript `buildSync` and `transformSync` APIs ([#590](https://github.com/evanw/esbuild/issues/590))
Previously the `buildSync` and `transformSync` API calls created a new child esbuild process on every call because communicating with a long-lived child process is asynchronous in node. However, there's a trick that can work around this limitation: esbuild can communicate with the long-lived child process from a child thread using node's [`worker_threads`](https://nodejs.org/api/worker_threads.html) module and block the main thread using JavaScript's new [Atomics API](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Atomics/wait). This was a tip from [@cspotcode](https://github.com/cspotcode).
This approach has now been implemented. A quick benchmark shows that `transformSync` is now **1.5x to 15x faster** than it used to be. The speedup depends on the size of the input (smaller inputs get a bigger speedup). The worker thread and child process should automatically be terminated when there are no more event handlers registered on the main thread, so there is no explicit `stop()` call like there is with a service object.
* Distribute a 32-bit Linux ARM binary executable via npm ([#528](https://github.com/evanw/esbuild/issues/528))
You should now be able to use npm to install esbuild on a 32-bit Linux ARM device. This lets you run esbuild on a Raspberry Pi. Note that this target isn't officially supported because it's not covered by any automated tests.
## 0.8.21
* On-resolve plugins now apply to entry points ([#546](https://github.com/evanw/esbuild/issues/546))
Previously entry points were required to already be resolved to valid file system paths. This meant that on-resolve plugins didn't run, which breaks certain workflows. Now entry point paths are resolved using normal import resolution rules.
To avoid making this a breaking change, there is now special behavior for entry point path resolution. If the entry point path exists relative to the current working directory and the path does not start with `./` or `../`, esbuild will now automatically insert a leading `./` at the start of the path to prevent the path from being interpreted as a `node_modules` package path. This is only done if the file actually exists to avoid introducing `./` for paths with special plugin-specific syntax.
* Enable the build API in the browser ([#527](https://github.com/evanw/esbuild/issues/527))
Previously you could only use the transform API in the browser, not the build API. You can now use the build API in the browser too. There is currently no in-browser file system so the build API will not do anything by default. Using this API requires you to use plugins to provide your own file system. Instructions for running esbuild in the browser can be found here: https://esbuild.github.io/api/#running-in-the-browser.
* Set the importer to `sourcefile` in on-resolve plugins for stdin
When the stdin feature is used with on-resolve plugins, the importer for any import paths in stdin is currently always set to `<stdin>`. The `sourcefile` option provides a way to set the file name of stdin but it wasn't carried through to on-resolve plugins due to an oversight. This release changes this behavior so now `sourcefile` is used instead of `<stdin>` if present. In addition, if the stdin resolve directory is also specified the importer will be placed in the `file` namespace similar to a normal file.
## 0.8.20
* Fix an edge case with class body initialization
When bundling, top-level class statements are rewritten to variable declarations initialized to a class expression. This avoids a severe performance pitfall in Safari when there are a large number of class statements. However, this transformation was done incorrectly if a class contained a static field that references the class name in its own initializer:
```js
class Foo {
static foo = new Foo
}
```
In that specific case, the transformed code could crash when run because the class name is not yet initialized when the static field initializer is run. Only JavaScript code was affected. TypeScript code was not affected. This release fixes this bug.
* Remove more types of statements as dead code ([#580](https://github.com/evanw/esbuild/issues/580))
This change improves dead-code elimination in the case where unused statements follow an unconditional jump, such as a `return`:
```js
if (true) return
if (something) thisIsDeadCode()
```
These unused statements are removed in more cases than in the previous release. Some statements may still be kept that contain hoisted symbols (`var` and `function` statements) because they could potentially impact the code before the conditional jump.
## 0.8.19
* Handle non-ambiguous multi-path re-exports ([#568](https://github.com/evanw/esbuild/pull/568))
Wildcard re-exports using the `export * from 'path'` syntax can potentially result in name collisions that cause an export name to be ambiguous. For example, the following code would result in an ambiguous export if both `a.js` and `b.js` export a symbol with the same name:
```js
export * from './a.js'
export * from './b.js'
```
Ambiguous exports have two consequences. First, any ambiguous names are silently excluded from the set of exported names. If you use an `import * as` wildcard import, the excluded names will not be present. Second, attempting to explicitly import an ambiguous name using an `import {} from` import clause will result in a module instantiation error.
This release fixes a bug where esbuild could in certain cases consider a name ambiguous when it actually isn't. Specifically this happens with longer chains of mixed wildcard and named re-exports. Here is one such case:
```js
// entry.js
import {x, y} from './not-ambiguous.js'
console.log(x, y)
```
```js
// /not-ambiguous.js
export * from './a.js'
export * from './b.js'
```
```js
// /a.js
export * from './c.js'
```
```js
// /b.js
export {x} from './c.js'
```
```js
// /c.js
export let x = 1, y = 2
```
Previously bundling `entry.js` with esbuild would incorrectly generate an error about an ambiguous `x` export. Now this case builds successfully without an error.
* Omit warnings about non-string paths in `await import()` inside a `try` block ([#574](https://github.com/evanw/esbuild/issues/574))
Bundling code that uses `require()` or `import()` with a non-string path currently generates a warning, because the target of that import will not be included in the bundle. This is helpful to warn about because other bundlers handle this case differently (e.g. Webpack bundles the entire directory tree and emulates a file system lookup) so existing code may expect the target of the import to be bundled.
You can avoid the warning with esbuild by surrounding the call to `require()` with a `try` block. The thinking is that if there is a surrounding `try` block, presumably the code is expecting the `require()` call to possibly fail and is prepared to handle the error. However, there is currently no way to avoid the warning for `import()` expressions. This release introduces an analogous behavior for `import()` expressions. You can now avoid the warning with esbuild if you use `await import()` and surround it with a `try` block.
## 0.8.18
* Fix a bug with certain complex optional chains ([#573](https://github.com/evanw/esbuild/issues/573))
The `?.` optional chaining operator only runs the right side of the operator if the left side is undefined, otherwise it returns undefined. This operator can be applied to both property accesses and function calls, and these can be combined into long chains of operators. These expressions must be transformed to a chain of `?:` operators if the `?.` operator isn't supported in the configured target environment. However, esbuild had a bug where an optional call of an optional property with a further property access afterward didn't preserve the value of `this` for the call. This bug has been fixed.
* Fix a renaming bug with external imports
There was a possibility of a cross-module name collision while bundling in a certain edge case. Specifically, when multiple files both contained an `import` statement to an external module and then both of those files were imported using `require`. For example:
```js
// index.js
console.log(require('./a.js'), require('./b.js'))
```
```js
// a.js
export {exists} from 'fs'
```
```js
// b.js
export {exists} from 'fs'
```
In this case the files `a.js` and `b.js` are converted to CommonJS format so they can be imported using `require`:
```js
// a.js
import {exists} from "fs";
var require_a = __commonJS((exports) => {
__export(exports, {
exists: () => exists
});
});
// b.js
import {exists} from "fs";
var require_b = __commonJS((exports) => {
__export(exports, {
exists: () => exists
});
});
// index.js
console.log(require_a(), require_b());
```
However, the `exists` symbol has been duplicated without being renamed. This is will result in a syntax error at run-time. The reason this happens is that the statements in the files `a.js` and `b.js` are placed in a nested scope because they are inside the CommonJS closure. The `import` statements were extracted outside the closure but the symbols they declared were incorrectly not added to the outer scope. This problem has been fixed, and this edge case should no longer result in name collisions.
## 0.8.17
* Get esbuild working on the Apple M1 chip via Rosetta 2 ([#564](https://github.com/evanw/esbuild/pull/564))
The Go compiler toolchain does not yet support the new Apple M1 chip. Go version 1.15 is currently in a feature freeze period so support will be added in the next version, Go 1.16, which will be [released in February](https://blog.golang.org/11years#TOC_3.).
This release changes the install script to install the executable for macOS `x64` on macOS `arm64` too. Doing this should still work because of the executable translation layer built into macOS. This change was contributed by [@sod](https://github.com/sod).
## 0.8.16
* Improve TypeScript type definitions ([#559](https://github.com/evanw/esbuild/issues/559))
The return value of the `build` API has some optional fields that are undefined unless certain arguments are present. That meant you had to use the `!` null assertion operator to avoid a type error if you have the TypeScript `strictNullChecks` setting enabled in your project. This release adds additional type information so that if the relevant arguments are present, the TypeScript compiler can tell that these optional fields on the return value will never be undefined. This change was contributed by [@lukeed](https://github.com/lukeed).
* Omit a warning about `require.main` when targeting CommonJS ([#560](https://github.com/evanw/esbuild/issues/560))
A common pattern in code that's intended to be run in node is to check if `require.main === module`. That will be true if the current file is being run from the command line but false if the current file is being run because some other code called `require()` on it. Previously esbuild generated a warning about an unexpected use of `require`. Now this warning is no longer generated for `require.main` when the output format is `cjs`.
* Warn about defining `process.env.NODE_ENV` as an identifier ([#466](https://github.com/evanw/esbuild/issues/466))
The define feature can be used to replace an expression with either a JSON literal or an identifier. Forgetting to put quotes around a string turns it into an identifier, which is a common mistake. This release introduces a warning when you define `process.env.NODE_ENV` as an identifier instead of a string. It's very common to use define to replace `process.env.NODE_ENV` with either `"production"` or `"development"` and sometimes people accidentally replace it with `production` or `development` instead. This is worth warning about because otherwise there would be no indication that something is wrong until the code crashes when run.
* Allow starting a local server at a specific host address ([#563](https://github.com/evanw/esbuild/pull/563))
By default, esbuild's local HTTP server is only available on the internal loopback address. This is deliberate behavior for security reasons, since the local network environment may not be trusted. However, it can be useful to run the server on a different address when developing with esbuild inside of a virtual machine/docker container or to request development assets from a remote testing device on the same network at a different IP address. With this release, you can now optionally specify the host in addition to the port:
```
esbuild --serve=192.168.0.1:8000
```
```js
esbuild.serve({
host: '192.168.0.1',
port: 8000,
}, {
...
})
```
```go
server, err := api.Serve(api.ServeOptions{
Host: "192.168.0.1",
Port: 8000,
}, api.BuildOptions{
...
})
```
This change was contributed by [@jamalc](https://github.com/jamalc).
## 0.8.15
* Allow `paths` without `baseUrl` in `tsconfig.json`
This feature was [recently released in TypeScript 4.1](https://devblogs.microsoft.com/typescript/announcing-typescript-4-1/#paths-without-baseurl). The `paths` feature in `tsconfig.json` allows you to do custom import path rewriting. For example, you can map paths matching `@namespace/*` to the path `./namespace/src/*` relative to the `tsconfig.json` file. Previously using the `paths` feature required you to additionally specify `baseUrl` so that the compiler could know which directory the path aliases were supposed to be relative to.
However, specifying `baseUrl` has the potentially-problematic side effect of causing all import paths to be looked up relative to the `baseUrl` directory, which could potentially cause package paths to accidentally be redirected to non-package files. Specifying `baseUrl` also causes Visual Studio Code's auto-import feature to generate paths relative to the `baseUrl` directory instead of relative to the directory containing the current file. There is more information about the problems this causes here: https://github.com/microsoft/TypeScript/issues/31869.
With TypeScript 4.1, you can now omit `baseUrl` when using `paths`. When you do this, it as if you had written `"baseUrl": "."` instead for the purpose of the `paths` feature, but the `baseUrl` value is not actually set and does not affect path resolution. These `tsconfig.json` files are now supported by esbuild.
* Fix evaluation order issue with import cycles and CommonJS-style output formats ([#542](https://github.com/evanw/esbuild/issues/542))
Previously entry points involved in an import cycle could cause evaluation order issues if the output format was `iife` or `cjs` instead of `esm`. This happened because this edge case was handled by treating the entry point file as a CommonJS file, which extracted the code into a CommonJS wrapper. Here's an example:
Input files:
```js
// index.js
import { test } from './lib'
export function fn() { return 42 }
if (test() !== 42) throw 'failure'
```
```js
// lib.js
import { fn } from './index'
export let test = fn
```
Previous output (problematic):
```js
// index.js
var require_esbuild = __commonJS((exports) => {
__export(exports, {
fn: () => fn2
});
function fn2() {
return 42;
}
if (test() !== 42)
throw "failure";
});
// lib.js
var index = __toModule(require_esbuild());
var test = index.fn;
module.exports = require_esbuild();
```
This approach changed the evaluation order because the CommonJS wrapper conflates both binding and evaluation. Binding and evaluation need to be separated to correctly handle this edge case. This edge case is now handled by inlining what would have been the contents of the CommonJS wrapper into the entry point location itself.
Current output (fixed):
```js
// index.js
__export(exports, {
fn: () => fn
});
// lib.js
var test = fn;
// index.js
function fn() {
return 42;
}
if (test() !== 42)
throw "failure";
```
## 0.8.14
* Fix a concurrency bug caused by an error message change ([#556](https://github.com/evanw/esbuild/issues/556))
An improvement to the error message for path resolution was introduced in version 0.8.12. It detects when a relative path is being interpreted as a package path because you forgot to start the path with `./`:
```
> src/posts/index.js: error: Could not resolve "PostCreate" (use "./PostCreate" to import "src/posts/PostCreate.js")
2 │ import PostCreate from 'PostCreate';
╵ ~~~~~~~~~~~~
```
This is implemented by re-running path resolution for package path resolution failures as a relative path instead. Unfortunately, this second path resolution operation wasn't guarded by a mutex and could result in concurrency bugs. This issue only occurs when path resolution fails. It is fixed in this release.
## 0.8.13
* Assigning to a `const` symbol is now an error when bundling
This change was made because esbuild may need to change a `const` symbol into a non-constant symbol in certain situations. One situation is when the "avoid TDZ" option is enabled. Another situation is some potential upcoming changes to lazily-evaluate certain modules for code splitting purposes. Making this an error gives esbuild the freedom to do these code transformations without potentially causing problems where constants are mutated. This has already been a warning for a while so code that does this should already have been obvious. This warning was made an error in a patch release because the expectation is that no real code relies on this behavior outside of conformance tests.
* Fix for the `--keep-names` option and anonymous lowered classes
This release fixes an issue where names were not preserved for anonymous classes that contained newer JavaScript syntax when targeting an older version of JavaScript. This was because that causes the class expression to be transformed into a sequence expression, which was then not recognized as a class expression. For example, the class did not have the name `foo` in the code below when the target was set to `es6`:
```js
let foo = class {
#privateMethod() {}
}
```
The `name` property of this class object is now `foo`.
* Fix captured class names when class name is re-assigned
This fixes a corner case with class lowering to better match the JavaScript specification. In JavaScript, the body of a class statement contains an implicit constant symbol with the same name as the symbol of the class statement itself. Lowering certain class features such as private methods means moving them outside the class body, in which case the contents of the private method are no longer within the scope of the constant symbol. This can lead to a behavior change if the class is later re-assigned:
```js
class Foo {
static test() { return this.#method() }
static #method() { return Foo }
}
let old = Foo
Foo = class Bar {}
console.log(old.test() === old) // This should be true
```
Previously this would print `false` when transformed to ES6 by esbuild. This now prints `true`. The current transformed output looks like this:
```js
var _method, method_fn;
const Foo2 = class {
static test() {
return __privateMethod(this, _method, method_fn).call(this);
}
};
let Foo = Foo2;
_method = new WeakSet();
method_fn = function() {
return Foo2;
};
_method.add(Foo);
let old = Foo;
Foo = class Bar {
};
console.log(old.test() === old);
```
* The `--allow-tdz` option is now always applied during bundling
This option turns top-level `let`, `const`, and `class` statements into `var` statements to work around some severe performance issues in the JavaScript run-time environment in Safari. Previously you had to explicitly enable this option. Now this behavior will always happen, and there is no way to turn it off. This means the `--allow-tdz` option is now meaningless and no longer does anything. It will be removed in a future release.
* When bundling and minifying, `const` is now converted into `let`
This was done because it's semantically equivalent but shorter. It's a valid transformation because assignment to a `const` symbol is now a compile-time error when bundling, so changing `const` to `let` should now not affect run-time behavior.
## 0.8.12
* Added an API for incremental builds ([#21](https://github.com/evanw/esbuild/issues/21))
There is now an API for incremental builds. This is what using the API looks like from JavaScript:
```js
require('esbuild').build({
entryPoints: ['app.js'],
bundle: true,
outfile: 'out.js',
incremental: true,
}).then(result => {
// The "rebuild" method is present if "incremental" is true. It returns a
// promise that resolves to the same kind of object that "build" returns.
// You can call "rebuild" as many times as you like.
result.rebuild().then(result2 => {
// Call "dispose" when you're done to free up resources.
result.rebuild.dispose()
})
})
```
Using the API from Go is similar, except there is no need to manually dispose of the rebuild callback:
```go
result := api.Build(api.BuildOptions{
EntryPoints: []string{"app.js"},
Bundle: true,
Outfile: "out.js",
Incremental: true,
})
result2 := result.Rebuild()
```
Incremental builds are more efficient than regular builds because some data is cached and can be reused if the original files haven't changed since the last build. There are currently two forms of caching used by the incremental build API:
* Files are stored in memory and are not re-read from the file system if the file metadata hasn't changed since the last build. This optimization only applies to file system paths. It does not apply to virtual modules created by plugins.
* Parsed ASTs are stored in memory and re-parsing the AST is avoided if the file contents haven't changed since the last build. This optimization applies to virtual modules created by plugins in addition to file system modules, as long as the virtual module path remains the same.
This is just the initial release of the incremental build API. Incremental build times still have room for improvement. Right now esbuild still re-resolves, re-loads, and re-links everything even if none of the input files have changed. Improvements to the incremental build mechanism will be coming in later releases.
* Support for a local file server ([#537](https://github.com/evanw/esbuild/issues/537))
You can now run esbuild with the `--serve` flag to start a local server that serves the output files over HTTP. This is intended to be used during development. You can point your `<script>` tag to a local server URL and your JavaScript and CSS files will be automatically built by esbuild whenever that URL is accessed. The server defaults to port 8000 but you can customize the port with `--serve=...`.
There is also an equivalent API for JavaScript:
```js
require('esbuild').serve({
port: 8000,
},{
entryPoints: ['app.js'],
bundle: true,
outfile: 'out.js',
}).then(server => {
// Call "stop" on the server when you're done
server.stop()
})
```
and for Go:
```go
server, err := api.Serve(api.ServeOptions{
Port: 8000,
}, api.BuildOptions{
EntryPoints: []string{"app.js"},
Bundle: true,
Outfile: "out.js",
})
// Call "stop" on the server when you're done
server.Stop()
```
This is a similar use case to "watch mode" in other tools where something automatically rebuilds your code when a file has changed on disk. The difference is that you don't encounter the problem where you make an edit, switch to your browser, and reload only to load the old files because the rebuild hasn't finished yet. Using a HTTP request instead of a file system access gives the rebuild tool the ability to delay the load until the rebuild operation has finished so your build is always up to date.
* Install to a temporary directory for Windows ([#547](https://github.com/evanw/esbuild/issues/547))
The install script runs `npm` in a temporary directory to download the correct binary executable for the current architecture. It then removes the temporary directory after the installation. However, removing a directory is sometimes impossible on Windows. To work around this problem, the install script now installs to the system's temporary directory instead of a directory inside the project itself. That way it's not problematic if a directory is left behind by the install script. This change was contributed by [@Djaler](https://github.com/Djaler).
* Fix the public path ending up in the metafile ([#549](https://github.com/evanw/esbuild/issues/549))
The change in version 0.8.7 to include the public path in import paths of code splitting chunks caused a regression where the public path was also included in the list of chunk imports in the metafile. This was unintentional. Now the public path setting should not affect the metafile contents.
## 0.8.11
* Fix parsing of casts in TypeScript followed by certain tokens
This aligns esbuild's TypeScript parser with the official TypeScript parser as far as parsing of `as` casts. It's not valid to form an expression after an `as` cast if the next token is a `(`, `[`, `++`, `--`, `?.`, assignment operator, or template literal. Previously esbuild wouldn't generate an error for these expressions. This is normally not a problem because the TypeScript compiler itself would reject the code as invalid. However, if the next token starts on a new line, that new token may be the start of another statement. In that case the code generated by esbuild was different than the code generated by the TypeScript compiler. This difference has been fixed.
* Implement wildcards for external paths ([#406](https://github.com/evanw/esbuild/issues/406))
You can now use a `*` wildcard character with the `--external` option to mark all files matching a certain pattern as external, which will remove them from the bundle. For example, you can now do `--external:*.png` to remove all `.png` files. When a `*` wildcard character is present in an external path, that pattern will be applied to the original path in the source code instead of to the path after it has been resolved to a real file system path. This lets you match on paths that aren't real file system paths.
* Add a warning about self-assignment
This release adds a warning for code that assigns an identifier to itself (e.g. `x = x`). This code is likely a mistake since doing this has no effect. This warning is not generated for assignments to global variables, since that can have side effects, and self-assignments with TypeScript casts, since those can be useful for changing the type of a variable in TypeScript. The warning is also not generated for code inside a `node_modules` folder.
## 0.8.10
* Fix parsing of conditional types in TypeScript ([#541](https://github.com/evanw/esbuild/issues/541))
Conditional types in TypeScript take the form `A extends B ? C : D`. Parsing of conditional types in esbuild was incorrect. The `?` can only follow an `extends` clause but esbuild didn't require the `extends` clause, which potentially led to build failures or miscompilation. The parsing for this syntax has been fixed and should now match the behavior of the TypeScript compiler. This fix was contributed by [@rtsao](https://github.com/rtsao).
* Ignore comments for character frequency analysis ([#543](https://github.com/evanw/esbuild/issues/543))
Character frequency analysis is used to derive the order of minified names for better gzip compression. The idea is to prefer using the most-used characters in the non-symbol parts of the document (keywords, strings, etc.) over characters that are less-used or absent. This is a very slight win, and is only approximate based on the input text instead of the output text because otherwise it would require minifying twice.
Right now comments are included in this character frequency histogram. This is not a correctness issue but it does mean that documents with the same code but different comments may be minified to different output files. This release fixes this difference by removing comments from the character frequency histogram.
* Add an option to ignore tree-shaking annotations ([#458](https://github.com/evanw/esbuild/issues/458))
Tree shaking is the term the JavaScript community uses for dead code elimination, a common compiler optimization that automatically removes unreachable code. Since JavaScript is a dynamic language, identifying unused code is sometimes very difficult for a compiler, so the community has developed certain annotations to help tell compilers what code should be considered unused. Currently there two forms of tree-shaking annotations that esbuild supports: inline `/* @__PURE__ */` comments before function calls and the `sideEffects` field in `package.json`.
These annotations can be problematic because the compiler depends completely on developers for accuracy and the annotations are occasionally incorrect. The `sideEffects` field is particularly error-prone because by default it causes all files in your package to be considered dead code if no imports are used. If you add a new file containing side effects and forget to update that field, your package will break when people try to bundle it.
This release adds a new flag `--tree-shaking=ignore-annotations` to allow you to bundle code that contains incorrect tree-shaking annotations with esbuild. An example of such code is [@tensorflow/tfjs](https://github.com/tensorflow/tfjs). Ideally the `--tree-shaking=ignore-annotations` flag is only a temporary workaround. You should report these issues to the maintainer of the package to get them fixed since they will trip up other people too.
* Add support for absolute `baseUrl` paths in `tsconfig.json` files
Previously esbuild always joined the `baseUrl` path to the end of the current directory path. However, if the `baseUrl` was an absolute path, that would end up including the current directory path twice. This situation could arise internally in certain cases involving multiple `tsconfig.json` files and `extends` fields even if the `tsconfig.json` files themselves didn't have absolute paths. Absolute paths are now not modified and should work correctly.
* Fix crash for modules that do `module.exports = null` ([#532](https://github.com/evanw/esbuild/issues/532))
The code generated by esbuild would crash at run-time if a module overwrote `module.exports` with null or undefined. This has been fixed and no longer crashes.
## 0.8.9
* Add support for the `mips64le` architecture ([#523](https://github.com/evanw/esbuild/issues/523))
You should now be able to install esbuild on the `mips64le` architecture. This build target is second-tier as it's not covered by CI, but I tested it in an emulator and it appears to work at the moment.
* Fix for packages with inconsistent side effect markings
Packages can have multiple entry points in their `package.json` file. Two commonly-used ones are specified using the fields `main` and `module`. Packages can also mark files in the package as not having side effects using the `sideEffects` field. Some packages have one entry point marked as having side effects and the other entry point as not having side effects. This is arguably a problem with the package itself. However, this caused an issue with esbuild's automatic entry point field selection method where it would incorrectly consider both `main` and `module` to not have side effects if one of them was marked as not having side effects. Now `main` and `module` will only be considered to not have side effects if the individual file was marked as not having side effects.
* Warn about `import './file'` when `./file` was marked as having no side effects
Files in packages containing `"sideEffects": false` in the enclosing `package.json` file are intended to be automatically removed from the bundle if they aren't used. However, code containing `import './file'` is likely trying to import that file for a side effect. This is a conflict of intentions so it seems like a good idea to warn about this. It's likely a configuration error by the author of the package. The warning points to the location in `package.json` that caused this situation.
* Add support for glob-style tests in `sideEffects` arrays
The `sideEffects` field in `package.json` can optionally contain an array of files that are considered to have side effects. Any file not in that list will be removed if the import isn't used. Webpack supports the `*` and `?` wildcard characters in these file strings. With this release, esbuild supports these wildcard characters too.
## 0.8.8
* Add the `--banner` and `--footer` options ([#482](https://github.com/evanw/esbuild/issues/482))
You can now use the `--banner` and `--footer` options to insert code before and/or after the code that esbuild generates. This is usually used to insert a banner comment at the top of your bundle. However, you can also use this for other purposes such as wrapping your whole bundle in `--banner='try {'` and `--footer='} catch (e) { reportError(e) }'`. Note that since these strings can contain partial JavaScript syntax, esbuild will not do anything to ensure the result is valid JavaScript syntax. This feature was contributed by [@Gelio](https://github.com/Gelio).
* Be more permissive inside TypeScript `declare` contexts
These cases are now allowed by esbuild:
* TypeScript supports a special `global { ... }` block inside `declare module`
* TypeScript allows arbitrary import and export statements inside `declare module`
* The TypeScript-specific `export as namespace name;` syntax is now ignored inside `declare module`.
* A trailing comma after a rest argument is disallowed in JavaScript but is allowed in TypeScript if you use `declare function`
* Log output to stderr has been overhauled
The formatting is now slightly different. Line numbers are now displayed to the left of the source text and source text is now dimmed to make the log messages themselves stand out more. And log messages now support "notes" which are additional messages with different attached locations.
Before:
```
example.ts:13:6: error: "test" has already been declared
class test extends BaseTest {
~~~~
```
After:
```
> example.ts: error: "test" has already been declared
13 │ class test extends BaseTest {
╵ ~~~~
example.ts: note: "test" was originally declared here
4 │ function test(name: string, callback: () => void) {
╵ ~~~~
```
## 0.8.7
* `--public-path` now affects code splitting chunk imports ([#524](https://github.com/evanw/esbuild/issues/524))
The public path setting is a path prefix that bakes in the path where your code is hosted. It can currently be used with the `file` loader to turn the exported URLs into absolute URLs. Previously this path prefix didn't apply to the cross-chunk imports generated by code splitting. This was an oversight. The public path setting now also works for cross-chunk imports in this release.
* Add `exports` for output files in metafile ([#487](https://github.com/evanw/esbuild/issues/487))
The metafile JSON data now contains a list of export names for all generated output files. This only affects builds that use the `esm` output format. It includes the names of all exports declared using the `export` keyword, including transitive exports that use the `export * from` syntax. If the entry point is in CommonJS format, there will be a single export called `default`.
* Fix values in metafile `inputs` object
This fixes a regression in the `inputs` object in generated metafile JSON data. Version 0.7.9 introduced the ability for a module to be split into multiple parts to correctly emulate ECMAScript module instantiation order. However, that caused split files to be present in the `inputs` object multiple times, once for each split part. That looked something like this:
```json
"outputs": {
"out/a.js": {
"imports": [
{
"path": "out/chunk.QXHH4FDI.js"
}
],
"inputs": {
"a.js": {
"bytesInOutput": 21
},
"a.js": {
"bytesInOutput": 0
}
},
"bytes": 120
}
}
```
This is problematic because duplicate keys are allowed in JSON and overwrite the previous key. The fix in this release is to accumulate the `bytesInOutput` values for all parts of a file and then only write out the accumulated values at the end.
* Avoid arrow functions when `import()` is converted to `require()` for `es5`
Setting the target to `es5` is supposed to remove arrow functions, since they are only supported in `es6` and above. However, arrow functions would still be generated if an `import()` expression pointed to an external module and the output format was `iife` or `cjs`. Now these arrow functions are replaced by function expressions instead.
* Convert `import()` to `require()` even if the argument isn't a string literal
The `import()` syntax is supposed to be converted to `require()` if the target is `cjs` instead of `esm`. However, this was previously only done if the argument was a string literal. This is now done for all `import()` expressions regardless of what the argument looks like.
* Transpose `require(a ? 'b' : 'c')` into `a ? require('b') : require('c')`
The reverse transformation is sometimes done by JavaScript minifiers such as [Terser](https://github.com/terser/terser) even if the original source code used the form `a ? require('b') : require('c')`. This messes up esbuild's import resolution which needs `require()` to take a single string as an argument. The transformation done here is a simple way to make sure esbuild still works on minified code. This transformation is also performed on `import()` and `require.resolve()`.
## 0.8.6
* Changes to TypeScript's `import name =` syntax
The parsing of TypeScript's `import name =` syntax should now match the official TypeScript parser. Previously esbuild incorrectly allowed any kind of expression after the equals sign. Now you can only use either a sequence of identifiers separated by periods or a call to the `require` function with a string literal.
* Do not report warnings about `require()` inside `try` ([#512](https://github.com/evanw/esbuild/issues/512))
This release no longer reports warnings about un-bundled calls to `require()` if they are within a `try` block statement. Presumably the try/catch statement is there to handle the potential run-time error from the unbundled `require()` call failing, so the potential failure is expected and not worth warning about.
* Add the `--keep-names` option ([#510](https://github.com/evanw/esbuild/issues/510))
In JavaScript the `name` property on functions and classes defaults to a nearby identifier in the source code. These syntax forms all set the `name` property of the function to `'fn'`:
```js
function fn() {}
let fn = function() {};
obj.fn = function() {};
fn = function() {};
let [fn = function() {}] = [];
let {fn = function() {}} = {};
[fn = function() {}] = [];
({fn = function() {}} = {});
```
However, minification renames symbols to reduce code size. That changes value of the `name` property for many of these cases. This is usually fine because the `name` property is normally only used for debugging. However, some frameworks rely on the `name` property for registration and binding purposes. If this is the case, you can now enable `--keep-names` to preserve the original `name` values even in minified code.
* Omit unused TypeScript import assignment aliases ([#474](https://github.com/evanw/esbuild/issues/474))
In TypeScript, `import x = y` is an alias statement that works for both values and types and can reach across files. Because esbuild doesn't replicate TypeScript's type system and because esbuild converts each file from TypeScript to JavaScript independently, it's not clear to esbuild if the alias refers to a value and should be kept as JavaScript or if the alias refers to a type and should be removed.
Previously all import aliases were kept in the generated JavaScript. This could lead to problems if the alias actually referred to a type. Now import aliases are only kept if they are used as values. This way import aliases that are only used as types will be automatically removed. This doesn't exactly match what the TypeScript compiler does in complex scenarios but it should work for many real-world cases.
* Validate that on-resolve plugins return absolute paths in the `file` namespace
The default path namespace for on-resolve plugins is the `file` namespace. Paths in this namespace are expected to be absolute paths. This is now enforced. If the returned path is not supposed to be a file system path, you should set a namespace other than `file` so esbuild doesn't treat it as a file system path.
* External paths returned by a plugin do not default to the `file` namespace
The `file` namespace is normally implied if it's not specified. However, that probably does not match the intent of the plugin for paths that have been marked as external. Such paths will now have an empty namespace instead of the namespace `file`. You now have to explicitly specify the `file` namespace in your plugin if you want it for external paths.
## 0.8.5
* Direct `eval()` now causes the module to be considered CommonJS ([#175](https://github.com/evanw/esbuild/pull/175))
Code containing a direct call to `eval()` can potentially access any name in the current scope or in any parent scope. Therefore all symbols in all of these scopes must not be renamed or minified. This was already the case for all non-top-level symbols, but it accidentally wasn't the case for top-level symbols.
Preventing top-level symbols from being renamed is problematic because they may be merged in with symbols from other files due to the scope hoisting optimization that applies to files in the ECMAScript module format. That could potentially cause the names to collide and cause a syntax error if they aren't renamed. This problem is now avoided by treating files containing direct `eval()` as CommonJS modules instead, which causes these files to each be wrapped in their own closure with a separate scope.
Note that this change means that tree shaking is disabled for these files. There is rarely a reason to use direct `eval()` and it is almost always a mistake. You likely want to use a form of indirect eval such as `(0, eval)('code')` instead. That also has the benefit of not disabling symbol minification for that file.
* Add a `text` property to output files in build results ([#496](https://github.com/evanw/esbuild/issues/496))
If you pass `write: false` to the JavaScript `build` API, the output files that would have been written to the file system are instead returned as an array of objects. Each object has a `Uint8Array` property called `contents` with the bytes of the file. It does not contain a string because the bytes of the file may not be valid UTF-8 (e.g. a PNG image) and it's not safe to decode output files as UTF-8 text in all cases.
This release adds a convenience property called `text` that lazily evaluates and returns `new TextDecoder().decode(contents)` the first time it's accessed. You should only use this in cases where you are sure the contents of the file are encoded using UTF-8 encoding. Invalid code point sequences will be replaced by the U+FFFD replacement character.
## 0.8.4
* Using `delete` on an import namespace object is now an error
This release makes the following code forbidden when bundling is active:
```js
import * as ns from './some-file';
delete ns.prop;
```
Doing this does not delete the property because properties on ECMAScript module objects are not mutable. Assigning to a property of an import namespace object is already an error and not including the `delete` operator as an assignment was an oversight. This release just makes `delete` assignment consistent with other forms of assignment.
* Mark dead code inside branching expressions
Code inside branching expressions where the branch is statically determined to never be taken is now marked as dead code. Previously this was only the case for statements, not expressions. This change means `false && require('pkg')` will no longer generate an error about `pkg` being missing even if it is indeed missing. This change affects the `||`, `&&`, `??`, and `?:` operators.
* Fix metafile when importing CSS from JS ([#504](https://github.com/evanw/esbuild/pull/504))
This release fixes a bug where importing a CSS file from JavaScript caused esbuild to generate invalid JSON in the resulting metafile. It was only a problem if you were importing CSS from JS and enabled metafile output. This fix was contributed by [@nitsky](https://github.com/nitsky).
* Fix downloads for Yarn 2 ([#505](https://github.com/evanw/esbuild/pull/505))
The change related to Yarn 2 in the previous release had a bug that prevented downloads from succeeding when installing esbuild with Yarn 2. This fix was contributed by [@mathieudutour](https://github.com/mathieudutour).
## 0.8.3
* Fix name collision with TypeScript namespaces containing their own name
This fixes a bug where TypeScript namespaces containing a declaration that re-uses the name of the enclosing namespace incorrectly failed the build with a duplicate declaration error. Here is an example:
```ts
namespace foo {
export let foo
}
```
This happened because esbuild compiles that code into something like this:
```ts
var foo;
(function (foo) {
foo.foo = 123;
console.log(foo.foo);
})(foo || (foo = {}));
```
The exported name `foo` was colliding with the automatically-declared function argument also named `foo`, which normally must be declared in that scope to shadow the outer namespace variable. This release fixes the problem by not declaring the function argument in the scope if there is already a declaration with that name in that scope.
* Prefer `.css` files for `@import` in CSS
People sometimes create a `.js`-related file and an adjacent `.css` file with the same name when creating a component (e.g. `button.tsx` and `button.css`). They also sometimes use `@import "./button"` in CSS and omit the file extension. Currently esbuild uses a single global order of extensions to try when an extension is omitted. This is configured with `--resolve-extensions` and defaults to `.tsx, .ts, .jsx, .mjs, .cjs, .js, .css, .json`. This means the `.tsx` file will be matched because `.tsx` comes before `.css` in the order.
This release changes the behavior to use a different order of extensions for `@import` statements in CSS files. The order is the list given by `--resolve-extensions` with all extensions removed that have `.js`-related loaders configured. In this case the filtered list would just be `.css` since all other default resolve extensions have JavaScript loaders, but if you also configure another resolve extension to use the `css` loader that will also qualify for implicit extension support with `@import` statements in CSS.
* Add support for `paths` in `tsconfig.json` for absolute paths
Previously it wasn't possible to use `paths` in `tsconfig.json` to remap paths starting with `/` on systems that considered that an absolute path (so not Windows). This is because absolute paths are handled before normal path resolution logic. Now this should work correctly.
* Hack around lack of support for binary packages in Yarn 2 ([#467](https://github.com/evanw/esbuild/issues/467))
The Yarn 2 package manager is deliberately incompatible with binary modules because the Yarn 2 developers don't think they should be used. See [yarnpkg/berry#882](https://github.com/yarnpkg/berry/issues/882) for details. This means running esbuild with Yarn 2 currently doesn't work (Yarn 2 tries to load the esbuild binary as a JavaScript file).
The suggested workaround from the Yarn 2 team is to replace the binary with a JavaScript file wrapper that invokes the esbuild binary using node's `child_process` module. However, doing that would slow down esbuild for everyone. The `esbuild` command that is exported from the main package is intentionally a native executable instead of a JavaScript wrapper script because starting up a new node process just to invoke a native binary is unnecessary additional overhead.
The hack added in this release is to detect whether esbuild is being installed with Yarn 2 during the install script and only install a JavaScript file wrapper for Yarn 2 users. Doing this should make it possible to run the esbuild command from Yarn 2 without slowing down esbuild for everyone. This change was contributed by [@rtsao](https://github.com/rtsao).
## 0.8.2
* Fix the omission of `outbase` in the JavaScript API ([#471](https://github.com/evanw/esbuild/pull/471))
The original PR for the `outbase` setting added it to the CLI and Go APIs but not the JavaScript API. This release adds it to the JavaScript API too.
* Fix the TypeScript type definitions ([#499](https://github.com/evanw/esbuild/pull/499))
The newly-released `plugins` option in the TypeScript type definitions was incorrectly marked as non-optional. It is now optional. This fix was contributed by [@remorses](https://github.com/remorses).
## 0.8.1
* The initial version of the plugin API ([#111](https://github.com/evanw/esbuild/pull/111))
The plugin API lets you inject custom code inside esbuild's build process. You can write plugins in either JavaScript or Go. Right now you can add an "on resolve" callback to determine where import paths go and an "on load" callback to determine what the imported file contains. These two primitives are very powerful, especially in combination with each other.
Here's a simple example plugin to show off the API in action. Let's say you wanted to enable a workflow where you can import environment variables like this:
```js
// app.js
import { NODE_ENV } from 'env'
console.log(`NODE_ENV is ${NODE_ENV}`)
```
This is how you might do that from JavaScript:
```js
let envPlugin = {
name: 'env-plugin',
setup(build) {
build.onResolve({ filter: /^env$/ }, args => ({
path: args.path,
namespace: 'env',
}))
build.onLoad({ filter: /.*/, namespace: 'env' }, () => ({
contents: JSON.stringify(process.env),
loader: 'json',
}))
},
}
require('esbuild').build({
entryPoints: ['app.js'],
bundle: true,
outfile: 'out.js',
plugins: [envPlugin],
logLevel: 'info',
}).catch(() => process.exit(1))
```
This is how you might do that from Go:
```go
package main
import (
"encoding/json"
"os"
"strings"
"github.com/evanw/esbuild/pkg/api"
)
var envPlugin = api.Plugin{
Name: "env-plugin",
Setup: func(build api.PluginBuild) {
build.OnResolve(api.OnResolveOptions{Filter: `^env$`},
func(args api.OnResolveArgs) (api.OnResolveResult, error) {
return api.OnResolveResult{
Path: args.Path,
Namespace: "env",
}, nil
})
build.OnLoad(api.OnLoadOptions{Filter: `.*`, Namespace: "env"},
func(args api.OnLoadArgs) (api.OnLoadResult, error) {
mappings := make(map[string]string)
for _, item := range os.Environ() {
if equals := strings.IndexByte(item, '='); equals != -1 {
mappings[item[:equals]] = item[equals+1:]
}
}
bytes, _ := json.Marshal(mappings)
contents := string(bytes)
return api.OnLoadResult{
Contents: &contents,
Loader: api.LoaderJSON,
}, nil
})
},
}
func main() {
result := api.Build(api.BuildOptions{
EntryPoints: []string{"app.js"},
Bundle: true,
Outfile: "out.js",
Plugins: []api.Plugin{envPlugin},
Write: true,
LogLevel: api.LogLevelInfo,
})
if len(result.Errors) > 0 {
os.Exit(1)
}
}
```
Comprehensive documentation for the plugin API is not yet available but is coming soon.
* Add the `outbase` option ([#471](https://github.com/evanw/esbuild/pull/471))
Currently, esbuild uses the lowest common ancestor of the entrypoints to determine where to place each entrypoint's output file. This is an excellent default, but is not ideal in some situations. Take for example an app with a folder structure similar to Next.js, with js files at `pages/a/b/c.js` and `pages/a/b/d.js`. These two files correspond to the paths `/a/b/c` and `/a/b/d`. Ideally, esbuild would emit `out/a/b/c.js` and `out/a/b/d.js`. However, esbuild identifies `pages/a/b` as the lowest common ancestor and emits `out/c.js` and `out/d.js`. This release introduces an `--outbase` argument to the cli that allows the user to choose which path to base entrypoint output paths on. With this change, running esbuild with `--outbase=pages` results in the desired behavior. This change was contributed by [@nitsky](https://github.com/nitsky).
## 0.8.0
**This release contains backwards-incompatible changes.** Since esbuild is before version 1.0.0, these changes have been released as a new minor version to reflect this (as [recommended by npm](https://docs.npmjs.com/misc/semver)). You should either be pinning the exact version of `esbuild` in your `package.json` file or be using a version range syntax that only accepts patch upgrades such as `^0.7.0`. See the documentation about [semver](https://docs.npmjs.com/misc/semver) for more information.
The breaking changes are as follows:
* Changed the transform API result object
For the transform API, the return values `js` and `jsSourceMap` have been renamed to `code` and `map` respectively. This is because esbuild now supports CSS as a first-class content type, and returning CSS code in a variable called `js` made no sense.
* The class field transform is now more accurate
Class fields look like this:
```js
class Foo {
foo = 123
}
```
Previously the transform for class fields used a normal assignment for initialization:
```js
class Foo {
constructor() {
this.foo = 123;
}
}
```
However, this doesn't exactly follow the initialization behavior in the JavaScript specification. For example, it can cause a setter to be called if one exists with that property name, which isn't supposed to happen. A more accurate transform that used `Object.defineProperty()` instead was available under the `--strict:class-fields` option.
This release removes the `--strict:class-fields` option and makes that the default behavior. There is no longer a way to compile class fields to normal assignments instead, since that doesn't follow JavaScript semantics. Note that for legacy reasons, TypeScript code will still compile class fields to normal assignments unless `useDefineForClassFields` is enabled in `tsconfig.json` just like the official TypeScript compiler.
* When bundling stdin using the API, `resolveDir` is now required to resolve imports
The `resolveDir` option specifies the directory to resolve relative imports against. Previously it defaulted to the current working directory. Now it no longer does, so you must explicitly specify it if you need it:
```js
const result = await esbuild.build({
stdin: {
contents,
resolveDir,
},
bundle: true,
outdir,
})
```
This was changed because the original behavior was unintentional, and because being explicit seems better in this case. Note that this only affects the JavaScript and Go APIs. The resolution directory for stdin passed using the command-line API still defaults to the current working directory.
In addition, it is now possible for esbuild to discover input source maps linked via `//# sourceMappingURL=` comments relative to the `resolveDir` for stdin. This previously only worked for files with a real path on the file system.
* Made names in the Go API consistent
Previously some of the names in the Go API were unnecessarily different than the corresponding names in the CLI and JavaScript APIs. This made it harder to write documentation and examples for these APIs that work consistently across all three API surfaces. These different names in the Go API have been fixed:
* `Defines` → `Define`
* `Externals` → `External`
* `Loaders` → `Loader`
* `PureFunctions` → `Pure`
* The global name parameter now takes a JavaScript expression ([#293](https://github.com/evanw/esbuild/issues/293))
The global name parameter determines the name of the global variable created for exports with the IIFE output format. For example, a global name of `abc` would generate the following IIFE:
```js
var abc = (() => {
...
})();
```
Previously this name was injected into the source code verbatim without any validation. This meant a global name of `abc.def` would generate this code, which is a syntax error:
```js
var abc.def = (() => {
...
})();
```
With this release, a global name of `abc.def` will now generate the following code instead:
```js
var abc = abc || {};
abc.def = (() => {
...
})();
```
The full syntax is an identifier followed by one or more property accesses. If you need to include a `.` character in your property name, you can use an index expression instead. For example, the global name `versions['1.0']` will generate the following code:
```js
var versions = versions || {};
versions["1.0"] = (() => {
...
})();
```
* Removed the workaround for `document.all` with nullish coalescing and optional chaining
The `--strict:nullish-coalescing` and `--strict:optional-chaining` options have been removed. They only existed to address a theoretical problem where modern code that uses the new `??` and `?.` operators interacted with the legacy [`document.all` object](https://developer.mozilla.org/en-US/docs/Web/API/Document/all) that has been deprecated for a long time. Realistically this case is extremely unlikely to come up in practice, so these obscure options were removed to simplify the API and reduce code complexity. For what it's worth this behavior also matches [Terser](https://github.com/terser/terser), a commonly-used JavaScript minifier.
## 0.7.22
* Add `tsconfigRaw` to the transform API ([#483](https://github.com/evanw/esbuild/issues/483))
The `build` API uses access to the file system and doesn't run in the browser, but the `transform` API doesn't access the file system and can run in the browser. Previously you could only use the build API for certain scenarios involving TypeScript code and `tsconfig.json` files, such as configuring the `importsNotUsedAsValues` setting.
You can now use `tsconfig.json` with the transform API by passing in the raw contents of that file:
```js
let result = esbuild.transformSync(ts, {
loader: 'ts',
tsconfigRaw: {
compilerOptions: {
importsNotUsedAsValues: 'preserve',
},
},
})
```
Right now four values are supported with the transform API: `jsxFactory`, `jsxFragmentFactory`, `useDefineForClassFields`, and `importsNotUsedAsValues`. The values `extends`, `baseUrl`, and `paths` are not supported because they require access to the file system and the transform API deliberately does not access the file system.
You can also pass the `tsconfig.json` file as a string instead of a JSON object if you prefer. This can be useful because `tsconfig.json` files actually use a weird pseudo-JSON syntax that allows comments and trailing commas, which means it can't be parsed with `JSON.parse()`.
* Warn about `process.env.NODE_ENV`
Some popular browser-oriented libraries such as React use `process.env.NODE_ENV` even though this is not an API provided by the browser. While esbuild makes it easy to replace this at compile time using the `--define` feature, you must still do this manually and it's easy to forget. Now esbuild will warn you if you're bundling code containing `process.env.NODE_ENV` for the browser and you haven't configured it to be replaced by something.
* Work around a bug in Safari for the run-time code ([#489](https://github.com/evanw/esbuild/issues/489))
The `Object.getOwnPropertyDescriptor` function in Safari is broken for numeric properties. It incorrectly returns `undefined`, which crashes the run-time code esbuild uses to bind modules together. This release contains code to avoid a crash in this case.
## 0.7.21
* Use bracketed escape codes for non-BMP characters
The previous release introduced code that escapes non-ASCII characters using ASCII escape sequences. Since JavaScript uses UCS-2/UTF-16 internally, a non-[BMP](https://en.wikipedia.org/wiki/Plane_(Unicode)#Basic_Multilingual_Plane) character such as `𐀀` ended up being encoded using a [surrogate pair](https://en.wikipedia.org/wiki/Universal_Character_Set_characters#Surrogates): `\uD800\uDC00`. This is fine when the character is contained in a string, but it causes a syntax error when that character is used as an identifier.
This release fixes this issue by using the newer bracketed escape code instead: `\u{10000}`. One complication with doing this is that this escape code won't work in older environments without ES6 support. Because of this, using identifiers containing non-BMP characters is now an error if the configured target environment doesn't support bracketed escape codes.
* Escape non-ASCII characters in properties
The previous release overlooked the need to escape non-ASCII characters in properties in various places in the grammar (e.g. object literals, property accesses, import and export aliases). This resulted in output containing non-ASCII characters even with `--charset=ascii`. These characters should now always be escaped, even in properties.
## 0.7.20
* Default to ASCII-only output ([#70](https://github.com/evanw/esbuild/issues/70), [#485](https://github.com/evanw/esbuild/issues/485))
While esbuild's output is encoded using UTF-8 encoding, there are many other character encodings in the wild (e.g. [Windows-1250](https://en.wikipedia.org/wiki/Windows-1250)). You can explicitly mark the output files as UTF-8 by adding `<meta charset="utf-8">` to your HTML page or by including `charset=utf-8` in the `Content-Type` header sent by your server. This is probably a good idea regardless of the contents of esbuild's output since information being displayed to users is probably also encoded using UTF-8.
However, sometimes it's not possible to guarantee that your users will be running your code as UTF-8. For example, you may not control the server response or the contents of the HTML page that loads your script. Also, if your code needs to run in IE, there are [certain cases](https://docs.microsoft.com/en-us/troubleshoot/browsers/wrong-character-set-for-html-page) where IE may ignore the `<meta charset="utf-8">` tag and make up another encoding instead.
Also content encoded using UTF-8 may be parsed up to 1.7x slower by the browser than ASCII-only content, at least according to this blog post from the V8 team: https://v8.dev/blog/scanner. The official recommendation is to "avoid non-ASCII identifiers where possible" to improve parsing performance.
For these reasons, esbuild's default output has been changed to ASCII-only. All Unicode code points in identifiers and strings that are outside of the printable ASCII range (`\x20-\x7E` inclusive) are escaped using backslash escape sequences. If you would like to use raw UTF-8 encoding instead, you can pass the `--charset=utf8` flag to esbuild.
Further details:
* This does not yet escape non-ASCII characters embedded in regular expressions. This is because esbuild does not currently parse the contents of regular expressions at all. The flag was added despite this limitation because it's still useful for code that doesn't contain cases like this.
* This flag does not apply to comments. I believe preserving non-ASCII data in comments should be fine because even if the encoding is wrong, the run time environment should completely ignore the contents of all comments. For example, the [V8 blog post](https://v8.dev/blog/scanner) mentions an optimization that avoids decoding comment contents completely. And all comments other than license-related comments are stripped out by esbuild anyway.
* This new `--charset` flag simultaneously applies to all output file types (JavaScript, CSS, and JSON). So if you configure your server to send the correct `Content-Type` header and want to use `--charset=utf8`, make sure your server is configured to treat both `.js` and `.css` files as UTF-8.
* Interpret escape sequences in CSS tokens
Escape sequences in CSS tokens are now interpreted. This was already the case for string and URL tokens before, but this is now the case for all identifier-like tokens as well. For example, `c\6flor: #\66 00` is now correctly recognized as `color: #f00`.
* Support `.css` with the `--out-extension` option
The `--out-extension` option was added so you could generate `.mjs` and `.cjs` files for node like this: `--out-extension:.js=.mjs`. However, now that CSS is a first-class content type in esbuild, this should also be available for `.css` files. I'm not sure why you would want to do this, but you can now do `--out-extension:.css=.something` too.
## 0.7.19
* Add the `--avoid-tdz` option for large bundles in Safari ([#478](https://github.com/evanw/esbuild/issues/478))
This is a workaround for a performance issue with certain large JavaScript files in Safari.
First, some background. In JavaScript the `var` statement is "hoisted" meaning the variable is declared immediately in the closest surrounding function, module, or global scope. Accessing one of these variables before its declaration has been evaluated results in the value `undefined`. In ES6 the `const`, `let`, and `class` statements introduce what's called a "temporal dead zone" or TDZ. This means that, unlike `var` statements, accessing one of these variable before its declaration has been evaluated results in a `ReferenceError` being thrown. It's called a "temporal dead zone" because it's a zone of time in which the variable is inaccessible.
According to [this WebKit bug](https://bugs.webkit.org/show_bug.cgi?id=199866), there's a severe performance issue with the tracking of TDZ checks in JavaScriptCore, the JavaScript JIT compiler used by WebKit. In a large private code base I have access to, the initialization phase of the bundle produced by esbuild runs 10x faster in Safari if top-level `const`, `let`, and `class` are replaced with `var`. It's a difference between a loading time of about 2sec vs. about 200ms. This transformation is not enabled by default because it changes the semantics of the code (it removes the TDZ and `const` assignment checks). However, this change in semantics may be acceptable for you given the performance trade-off. You can enable it with the `--avoid-tdz` flag.
* Warn about assignment to `const` symbols
Now that some `const` symbols may be converted to `var` due to `--avoid-tdz`, it seems like a good idea to at least warn when an assignment to a `const` symbol is detected during bundling. Otherwise accidental assignments to `const` symbols could go unnoticed if there isn't other tooling in place such as TypeScript or a linter.
## 0.7.18
* Treat paths in CSS without a `./` or `../` prefix as relative ([#469](https://github.com/evanw/esbuild/issues/469))
JavaScript paths starting with `./` or `../` are considered relative paths, while other JavaScript paths are considered package paths and are looked up in that package's `node_modules` directory. Currently `url()` paths in CSS files use that same logic, so `url(images/image.png)` checks for a file named `image.png` in the `image` package.
This release changes this behavior. Now `url(images/image.png)` first checks for `./images/image.png`, then checks for a file named `image.png` in the `image` package. This behavior should match the behavior of Webpack's standard `css-loader` package.
* Import non-enumerable properties from CommonJS modules ([#472](https://github.com/evanw/esbuild/issues/472))
You can now import non-enumerable properties from CommonJS modules using an ES6 `import` statement. Here's an example of a situation where that might matter:
```js
// example.js
module.exports = class {
static method() {}
}
```
```js
import { method } from './example.js'
method()
```
Previously that didn't work because the `method` property is non-enumerable. This should now work correctly.
A minor consequence of this change is that re-exporting from a file using `export * from` will no longer re-export properties inherited from the prototype of the object assigned to `module.exports`. This is because run-time property copying has been changed from a for-in loop to `Object.getOwnPropertyNames`. This change should be inconsequential because as far as I can tell this isn't something any other bundler supports either.
* Remove arrow functions in runtime with `--target=es5`
The `--target=es5` flag is intended to prevent esbuild from introducing any ES6+ syntax into the generated output file. For example, esbuild usually shortens `{x: x}` into `{x}` since it's shorter, except that requires ES6 support. This release fixes a bug where `=>` arrow expressions in esbuild's runtime of helper functions were not converted to `function` expressions when `--target=es5` was present.
* Merge local variable declarations across files when minifying
Currently files are minified in parallel and then concatenated together for maximum performance. However, that means certain constructs are not optimally minified if they span multiple files. For example, a bundle containing two files `var a = 1` and `var b = 2` should ideally become `var a=1,b=2;` after minification but it currently becomes `var a=0;var b=2;` instead due to parallelism.
With this release, esbuild will generate `var a=1,b=2;` in this scenario. This is achieved by splicing the two files together to remove the trailing `;` and the leading `var `, which is more complicated than it sounds when you consider rewriting the source maps.
## 0.7.17
* Add `--public-path=` for the `file` loader ([#459](https://github.com/evanw/esbuild/issues/459))
The `file` loader causes importing a file to cause that file to be copied into the output directory. The name of the file is exported as the default export:
```js
// Assume ".png" is set to the "file" loader
import name from 'images/image.png'
// This prints something like "image.L3XDQOAT.png"
console.log(name)
```
The new public path setting configures the path prefix. So for example setting it to `https://www.example.com/v1` would change the output text for this example to `https://www.example.com/v1/image.L3XDQOAT.png`.
* Add `--inject:` for polyfills ([#451](https://github.com/evanw/esbuild/issues/451))
It's now possible to replace global variables with imports from a file with `--inject:file.js`. Note that `file.js` must export symbols using the `export` keyword for this to work. This can be used to polyfill a global variable in code you don't control. For example:
```js
// process.js
export let process = {cwd() {}}
```
```js
// entry.js
console.log(process.cwd())
```
Building this with `esbuild entry.js --inject:process.js` gives this:
```js
let process = {cwd() {
}};
console.log(process.cwd());
```
You can also combine this with the existing `--define` feature to be more selective about what you import. For example:
```js
// process.js
export function dummy_process_cwd() {}
```
```js
// entry.js
console.log(process.cwd())
```
Building this with `esbuild entry.js --inject:process.js --define:process.cwd=dummy_process_cwd` gives this:
```js
function dummy_process_cwd() {
}
console.log(dummy_process_cwd());
```
Note that this means you can use `--inject` to provide the implementation for JSX expressions (e.g. auto-import the `react` package):
```js
// shim.js
export * as React from 'react'
```
```jsx
// entry.jsx
console.log(<div/>)
```
Building this with `esbuild entry.js --inject:shim.js --format=esm` gives this:
```js
import * as React from "react";
console.log(/* @__PURE__ */ React.createElement("div", null));
```
You can also use `--inject:file.js` with files that have no exports. In that case the injected file just comes first before the rest of the output as if every input file contained `import "./file.js"`. Because of the way ECMAScript modules work, this injection is still "hygienic" in that symbols with the same name in different files are renamed so they don't collide with each other.
If you want to _conditionally_ import a file only if the export is actually used, you should mark the injected file as not having side effects by putting it in a package and adding `"sideEffects": false` in that package's `package.json` file. This setting is a [convention from Webpack](https://webpack.js.org/guides/tree-shaking/#mark-the-file-as-side-effect-free) that esbuild respects for any imported file, not just files used with `--inject`.
* Add an ECMAScript module build for the browser ([#342](https://github.com/evanw/esbuild/pull/342))
The [current browser API](https://github.com/evanw/esbuild/blob/cfaedaeeb35ae6e8b42921ab98ad98f75375d39f/docs/js-api.md#browser-api) lets you use esbuild in the browser via the `esbuild-wasm` package and a script tag:
```html
<script src="node_modules/esbuild-wasm/lib/browser.js"></script>
<script>
esbuild.startService({
wasmURL: 'node_modules/esbuild-wasm/esbuild.wasm',
}).then(service => {
// Use service
})
</script>
```
In addition to this approach, you can now also use esbuild in the browser from a module-type script (note the use of `esm/browser.js` instead of `lib/browser.js`):
```html
<script type="module">
import * as esbuild from 'node_modules/esbuild-wasm/esm/browser.js'
esbuild.startService({
wasmURL: 'node_modules/esbuild-wasm/esbuild.wasm',
}).then(service => {
// Use service
})
</script>
```
Part of this fix was contributed by [@calebeby](https://github.com/calebeby).
## 0.7.16
* Fix backward slashes in source maps on Windows ([#463](https://github.com/evanw/esbuild/issues/463))
The relative path fix in the previous release caused a regression where paths in source maps contained `\` instead of `/` on Windows. That is incorrect because source map paths are URLs, not file system paths. This release replaces `\` with `/` for consistency on Windows.
* `module.require()` is now an alias for `require()` ([#455](https://github.com/evanw/esbuild/issues/455))
Some packages such as [apollo-server](https://github.com/apollographql/apollo-server) use `module.require()` instead of `require()` with the intent of bypassing the bundler's `require` and calling the underlying function from `node` instead. Unfortunately that doesn't actually work because CommonJS module semantics means `module` is a variable local to that file's CommonJS closure instead of the host's `module` object.
This wasn't an issue when using `apollo-server` with Webpack because the literal expression `module.require()` is automatically rewritten to `require()` by Webpack: [webpack/webpack#7750](https://github.com/webpack/webpack/pull/7750). To get this package to work, esbuild now matches Webpack's behavior here. Calls to `module.require()` will become external calls to `require()` as long as the required path has been marked as external.
## 0.7.15
* Lower `export * as` syntax for ES2019 and below
The `export * from 'path'` syntax was added in ES2015 but the `export * as name from 'path'` syntax was added more recently in ES2020. This is a shorthand for an import followed by an export:
```js
// ES2020
export * as name from 'path'
// ES2019
import * as name from 'path'
export {name}
```
With this release, esbuild will now undo this shorthand syntax when using `--target=es2019` or below.
* Better code generation for TypeScript files with type-only exports ([#447](https://github.com/evanw/esbuild/issues/447))
Previously TypeScript files could have an unnecessary CommonJS wrapper in certain situations. The specific situation is bundling a file that re-exports something from another file without any exports. This happens because esbuild automatically considers a module to be a CommonJS module if there is no ES6 `import`/`export` syntax.
This behavior is undesirable because the CommonJS wrapper is usually unnecessary. It's especially undesirable for cases where the re-export uses `export * from` because then the re-exporting module is also converted to a CommonJS wrapper (since re-exporting everything from a CommonJS module must be done at run-time). That can also impact the bundle's exports itself if the entry point does this and the format is `esm`.
It is generally equivalent to avoid the CommonJS wrapper and just rewrite the imports to an `undefined` literal instead:
```js
import {name} from './empty-file'
console.log(name)
```
This can be rewritten to this instead (with a warning generated about `name` being missing):
```js
console.log(void 0)
```
With this release, this is now how cases like these are handled. The only case where this can't be done is when the import uses the `import * as` syntax. In that case a CommonJS wrapper is still necessary because the namespace cannot be rewritten to `undefined`.
* Add support for `importsNotUsedAsValues` in TypeScript ([#448](https://github.com/evanw/esbuild/issues/448))
The `importsNotUsedAsValues` field in `tsconfig.json` is now respected. Setting it to `"preserve"` means esbuild will no longer remove unused imports in TypeScript files. This field was added in TypeScript 3.8.
* Fix relative paths in generated source maps ([#444](https://github.com/evanw/esbuild/issues/444))
Currently paths in generated source map files don't necessarily correspond to real file system paths. They are really only meant to be human-readable when debugging in the browser.
However, the Visual Studio Code debugger expects these paths to point back to the original files on the file system. With this release, it should now always be possible to get back to the original source file by joining the directory containing the source map file with the relative path in the source map.
This fix was contributed by [@yoyo930021](https://github.com/yoyo930021).
## 0.7.14
* Fix a bug with compound import statements ([#446](https://github.com/evanw/esbuild/issues/446))
Import statements can simultaneously contain both a default import and a namespace import like this:
```js
import defVal, * as nsVal from 'path'
```
These statements were previously miscompiled when bundling if the import path was marked as external, or when converting to a specific output format, and the namespace variable itself was used for something other than a property access. The generated code contained a syntax error because it generated a `{...}` import clause containing the default import.
This particular problem was caused by code that converts namespace imports into import clauses for more efficient bundling. This transformation should not be done if the namespace import cannot be completely removed:
```js
// Can convert namespace to clause
import defVal, * as nsVal from 'path'
console.log(defVal, nsVal.prop)
```
```js
// Cannot convert namespace to clause
import defVal, * as nsVal from 'path'
console.log(defVal, nsVal)
```
## 0.7.13
* Fix `mainFields` in the JavaScript API ([#440](https://github.com/evanw/esbuild/issues/440) and [#441](https://github.com/evanw/esbuild/pull/441))
It turns out the JavaScript bindings for the `mainFields` API option didn't work due to a copy/paste error. The fix for this was contributed by [@yoyo930021](https://github.com/yoyo930021).
* The benchmarks have been updated
The benchmarks now include Parcel 2 and Webpack 5 (in addition to Parcel 1 and Webpack 4, which were already included). It looks like Parcel 2 is slightly faster than Parcel 1 and Webpack 5 is significantly slower than Webpack 4.
## 0.7.12
* Fix another subtle ordering issue with `import` statements
When importing a file while bundling, the import statement was ordered before the imported code. This could affect import execution order in complex scenarios involving nested hybrid ES6/CommonJS modules. The fix was to move the import statement to after the imported code instead. This issue affected the `@sentry/browser` package.
## 0.7.11
* Fix regression in 0.7.9 when minifying with code splitting ([#437](https://github.com/evanw/esbuild/issues/437))
In certain specific cases, bundling and minifying with code splitting active can cause a crash. This is a regression that was introduced in version 0.7.9 due to the fix for issue [#421](https://github.com/evanw/esbuild/issues/421). The crash has been fixed and this case now has test coverage.
## 0.7.10
* Recover from bad `main` field in `package.json` ([#423](https://github.com/evanw/esbuild/issues/423))
Some packages are published with invalid information in the `main` field of `package.json`. In that case, path resolution should fall back to searching for a file named `index.js` before giving up. This matters for the `simple-exiftool` package, for example.
* Ignore TypeScript types on `catch` clause bindings ([435](https://github.com/evanw/esbuild/issues/435))
This fixes an issue where using a type annotation in a `catch` clause like this was a syntax error:
```ts
try {
} catch (x: unknown) {
}
```
## 0.7.9
* Fixed panic when using a `url()` import in CSS with the `--metafile` option
This release fixes a crash that happens when `metafile` output is enabled and the `url()` syntax is used in a CSS file to import a successfully-resolved file.
* Minify some CSS colors
The minifier can now reduce the size of some CSS colors. This is the initial work to start CSS minification in general beyond whitespace removal. There is currently support for minifying hex, `rgb()/rgba()`, and `hsl()/hsla()` into hex or shorthand hex. The minification process respects the configured target browser and doesn't use any syntax that wouldn't be supported.
* Lower newer CSS syntax for older browsers
Newer color syntax such as `rgba(255 0 0 / 50%)` will be converted to older syntax (in this case `rgba(255, 0, 0, 0.5)`) when the target browser doesn't support the newer syntax. For example, this happens when using `--target=chrome60`.
* Fix an ordering issue with `import` statements ([#421](https://github.com/evanw/esbuild/issues/421))
Previously `import` statements that resolved to a CommonJS module turned into a call to `require()` inline. This was subtly incorrect when combined with tree shaking because it could sometimes cause imported modules to be reordered:
```js
import {foo} from './cjs-file'
import {bar} from './esm-file'
console.log(foo, bar)
```
That code was previously compiled into something like this, which is incorrect because the evaluation of `bar` may depend on side effects from importing `cjs-file.js`:
```js
// ./cjs-file.js
var require_cjs_file = __commonJS(() => {
...
})
// ./esm-file.js
let bar = ...;
// ./example.js
const cjs_file = __toModule(require_cjs_file())
console.log(cjs_file.foo, bar)
```
That code is now compiled into something like this:
```js
// ./cjs-file.js
var require_cjs_file = __commonJS(() => {
...
})
// ./example.js
const cjs_file = __toModule(require_cjs_file())
// ./esm-file.js
let bar = ...;
// ./example.js
console.log(cjs_file.foo, bar)
```
This now means that a single input file can end up in multiple discontiguous regions in the output file as is the case with `example.js` here, which wasn't the case before this bug fix.
## 0.7.8
* Move external `@import` rules to the top
Bundling could cause `@import` rules for paths that have been marked as external to be inserted in the middle of the CSS file. This would cause them to become invalid and be ignored by the browser since all `@import` rules must come first at the top of the file. These `@import` rules are now always moved to the top of the file so they stay valid.
* Better support for `@keyframes` rules
The parser now directly understands `@keyframes` rules, which means it can now format them more accurately and report more specific syntax errors.
* Minify whitespace around commas in CSS
Whitespace around commas in CSS will now be pretty-printed when not minifying and removed when minifying. So `a , b` becomes `a, b` when pretty-printed and `a,b` when minified.
* Warn about unknown at-rules in CSS
Using an `@rule` in a CSS file that isn't known by esbuild now generates a warning and these rules will be passed through unmodified. If they aren't known to esbuild, they are probably part of a CSS preprocessor syntax that should have been compiled away before giving the file to esbuild to parse.
* Recoverable CSS syntax errors are now warnings
The base CSS syntax can preserve nonsensical rules as long as they contain valid tokens and have matching opening and closing brackets. These rule with incorrect syntax now generate a warning instead of an error and esbuild preserves the syntax in the output file. This makes it possible to use esbuild to process CSS that was generated by another tool that contains bugs.
For example, the following code is invalid CSS, and was presumably generated by a bug in an automatic prefix generator:
```css
div {
-webkit-undefined;
-moz-undefined;
-undefined;
}
```
This code will no longer prevent esbuild from processing the CSS file.
* Treat `url(...)` in CSS files as an import ([#415](https://github.com/evanw/esbuild/issues/415))
When bundling, the `url(...)` syntax in CSS now tries to resolve the URL as a path using the bundler's built in path resolution logic. The following loaders can be used with this syntax: `text`, `base64`, `file`, `dataurl`, and `binary`.
* Automatically treat certain paths as external
The following path forms are now automatically considered external:
* `http://example.com/image.png`
* `https://example.com/image.png`
* `//example.com/image.png`
* `data:image/png;base64,iVBORw0KGgo=`
In addition, paths starting with `#` are considered external in CSS files, which allows the following syntax to continue to work:
```css
path {
/* This can be useful with SVG DOM content */
fill: url(#filter);
}
```
## 0.7.7
* Fix TypeScript decorators on static members
This release fixes a bug with the TypeScript transform for the `experimentalDecorators` setting. Previously the target object for all decorators was the class prototype, which was incorrect for static members. Static members now correctly use the class object itself as a target object.
* Experimental support for CSS syntax ([#20](https://github.com/evanw/esbuild/issues/20))
This release introduces the new `css` loader, enabled by default for `.css` files. It has the following features:
* You can now use esbuild to process CSS files by passing a CSS file as an entry point. This means CSS is a new first-class file type and you can use it without involving any JavaScript code at all.
* When bundling is enabled, esbuild will bundle multiple CSS files together if they are referenced using the `@import "./file.css";` syntax. CSS files can be excluded from the bundle by marking them as external similar to JavaScript files.
* There is basic support for pretty-printing CSS, and for whitespace removal when the `--minify` flag is present. There isn't any support for CSS syntax compression yet. Note that pretty-printing and whitespace removal both rely on the CSS syntax being recognized. Currently esbuild only recognizes certain CSS syntax and passes through unrecognized syntax unchanged.
Some things to keep in mind:
* CSS support is a significant undertaking and this is the very first release. There are almost certainly going to be issues. This is an experimental release to land the code and get feedback.
* There is no support for CSS modules yet. Right now all class names are in the global namespace. Importing a CSS file into a JavaScript file will not result in any import names.
* There is currently no support for code splitting of CSS. I haven't tested multiple entry-point scenarios yet and code splitting will require additional changes to the AST format.
## 0.7.6
* Fix JSON files with multiple entry points ([#413](https://github.com/evanw/esbuild/issues/413))
This release fixes an issue where a single build operation containing multiple entry points and a shared JSON file which is used by more than one of those entry points can generate incorrect code for the JSON file when code splitting is disabled. The problem was not cloning the AST representing the JSON file before mutating it.
* Silence warnings about `require.resolve()` for external paths ([#410](https://github.com/evanw/esbuild/issues/410))
Bundling code containing a call to node's [`require.resolve()`](https://nodejs.org/api/modules.html#modules_require_resolve_request_options) function causes a warning because it's an unsupported use of `require` that does not end up being bundled. For example, the following code will likely have unexpected behavior if `foo` ends up being bundled because the `require()` call is evaluated at bundle time but the `require.resolve()` call is evaluated at run time:
```js
let foo = {
path: require.resolve('foo'),
module: require('foo'),
};
```
These warnings can already be disabled by surrounding the code with a `try`/`catch` statement. With this release, these warnings can now also be disabled by marking the path as external.
* Ensure external relative paths start with `./` or `../`
Individual file paths can be marked as external in addition to package paths. In that case, the path to the file is rewritten to be relative to the output directory. However, previously the relative path for files in the output directory itself did not start with `./`, meaning they could potentially be interpreted as a package path instead of a relative path. These paths are now prefixed with `./` to avoid this edge case.
## 0.7.5
* Fix an issue with automatic semicolon insertion after `let` ([#409](https://github.com/evanw/esbuild/issues/409))
The character sequence `let` can be considered either a keyword or an identifier depending on the context. A fix was previously landed in version 0.6.31 to consider `let` as an identifier in code like this:
```js
if (0) let
x = 0
```
Handling this edge case is useless but the behavior is required by the specification. However, that fix also unintentionally caused `let` to be considered an identifier in code like this:
```js
let
x = 0
```
In this case, `let` should be considered a keyword instead. This has been fixed.
* Fix some additional conformance tests
Some additional syntax edge cases are now forbidden including `let let`, `import {eval} from 'path'`, and `if (1) x: function f() {}`.
## 0.7.4
* Undo an earlier change to try to improve yarn compatibility ([#91](https://github.com/evanw/esbuild/pull/91) and [#407](https://github.com/evanw/esbuild/issues/407))
The [yarn package manager](https://github.com/yarnpkg/yarn) behaves differently from npm and is not compatible in many ways. While npm is the only officially supported package manager for esbuild, people have contributed fixes for other package managers including yarn. One such fix is PR [#91](https://github.com/evanw/esbuild/pull/91) which makes sure the install script only runs once for a given installation directory.
I suspect this fix is actually incorrect, and is the cause of issue [#407](https://github.com/evanw/esbuild/issues/407). The problem seems to be that if you change the version of a package using `yarn add esbuild@version`, yarn doesn't clear out the installation directory before reinstalling the package so the package ends up with a mix of files from both package versions. This is not how npm behaves and seems like a pretty severe bug in yarn. I am reverting PR [#91](https://github.com/evanw/esbuild/pull/91) in an attempt to fix this issue.
* Disable some warnings for code inside `node_modules` directories ([#395](https://github.com/evanw/esbuild/issues/395) and [#402](https://github.com/evanw/esbuild/issues/402))
Using esbuild to build code with certain suspicious-looking syntax may generate a warning. These warnings don't fail the build (the build still succeeds) but they point out code that is very likely to not behave as intended. This has caught real bugs in the past:
* [rollup/rollup#3729](https://github.com/rollup/rollup/issues/3729): Invalid dead code removal for return statement due to ASI
* [aws/aws-sdk-js#3325](https://github.com/aws/aws-sdk-js/issues/3325): Array equality bug in the Node.js XML parser
* [olifolkerd/tabulator#2962](https://github.com/olifolkerd/tabulator/issues/2962): Nonsensical comparisons with typeof and "null"
* [mrdoob/three.js#11183](https://github.com/mrdoob/three.js/pull/11183): Comparison with -0 in Math.js
* [mrdoob/three.js#11182](https://github.com/mrdoob/three.js/pull/11182): Operator precedence bug in WWOBJLoader2.js
However, it's not esbuild's job to find bugs in other libraries, and these warnings are problematic for people using these libraries with esbuild. The only fix is to either disable all esbuild warnings and not get warnings about your own code, or to try to get the warning fixed in the affected library. This is especially annoying if the warning is a false positive as was the case in https://github.com/firebase/firebase-js-sdk/issues/3814. So these warnings are now disabled for code inside `node_modules` directories.
## 0.7.3
* Fix compile error due to missing `unix.SYS_IOCTL` in the latest `golang.org/x/sys` ([#396](https://github.com/evanw/esbuild/pull/396))
The `unix.SYS_IOCTL` export was apparently removed from `golang.org/x/sys` recently, which affected code in esbuild that gets the width of the terminal. This code now uses another method of getting the terminal width. The fix was contributed by [@akayj](https://github.com/akayj).
* Validate that the versions of the host code and the binary executable match ([#407](https://github.com/evanw/esbuild/issues/407))
After the install script runs, the version of the downloaded binary should always match the version of the package being installed. I have added some additional checks to verify this in case this invariant is ever broken. Breaking this invariant is very bad because it means the code being run is a mix of code from different package versions.
## 0.7.2
* Transform arrow functions to function expressions with `--target=es5` ([#182](https://github.com/evanw/esbuild/issues/182) and [#297](https://github.com/evanw/esbuild/issues/297))
Arrow functions are now transformed into function expressions when targeting `es5`. For example, this code:
```js
function foo() {
var x = () => [this, arguments]
return x()
}
```
is transformed into this code:
```js
function foo() {
var _this = this, _arguments = arguments;
var x = function() {
return [_this, _arguments];
};
return x();
}
```
* Parse template literal types from TypeScript 4.1
TypeScript 4.1 includes a new feature called template literal types. You can read [the announcement](https://devblogs.microsoft.com/typescript/announcing-typescript-4-1-beta/#template-literal-types) for more details. The following syntax can now be parsed correctly by esbuild:
```ts
let foo: `${'a' | 'b'}-${'c' | 'd'}` = 'a-c'
```
* Parse key remapping in mapped types from TypeScript 4.1
TypeScript 4.1 includes a new feature called key remapping in mapped types. You can read [the announcement](https://devblogs.microsoft.com/typescript/announcing-typescript-4-1-beta/#key-remapping-mapped-types) for more details. The following syntax can now be parsed correctly by esbuild:
```ts
type RemoveField<T, F> = { [K in keyof T as Exclude<K, F>]: T[K] }
```
* Allow automatic semicolon insertion before the TypeScript `as` operator
The following code now correctly parses as two separate statements instead of one statement with a newline in the middle:
```ts
let foo = bar
as (null);
```
* Fix a bug where `module` was incorrectly minified for non-JavaScript loaders
If you pass a non-JavaScript file such as a `.json` file to esbuild, it will by default generate `module.exports = {...}`. However, the `module` variable would incorrectly be minified when `--minify` is present. This issue has been fixed. This bug did not appear if `--format=cjs` was also present, only if no `--format` flag was specified.
* Fix bugs with `async` functions ([#388](https://github.com/evanw/esbuild/issues/388))
This release contains correctness fixes for `async` arrow functions with regard to the `arguments` variable. This affected `async` arrow functions nested inside `function` expressions or statements. Part of this fix was contributed by [@rtsao](https://github.com/rtsao).
* Fix `export` clause when converting to CommonJS in transform API calls ([#393](https://github.com/evanw/esbuild/issues/393))
This release fixes some bugs with the recently-released feature in version 0.6.32 where you can specify an output format even when bundling is disabled. This is the case when using the transform API call, for example. Previously esbuild could generate code that crashed at run time while trying to export something incorrectly. This only affected code with top-level `export` statements. This has been fixed and these cases now have test coverage.
## 0.7.1
* Fix bug that forbids `undefined` values in the JavaScript API
The validation added in the previous release was accidentally overly restrictive and forbids `undefined` values for optional properties. This release allows `undefined` values again (which are simply ignored).
## 0.7.0
* Mark output files with a hashbang as executable ([#364](https://github.com/evanw/esbuild/issues/364))
Output files that start with a hashbang line such as `#!/usr/bin/env node` will now automatically be marked as executable. This lets you run them directly in a Unix-like shell without using the `node` command.
* Use `"main"` for `require()` and `"module"` for `import` ([#363](https://github.com/evanw/esbuild/issues/363))
The [node module resolution algorithm](https://nodejs.org/api/modules.html#modules_all_together) uses the `"main"` field in `package.json` to determine which file to load when a package is loaded with `require()`. Independent of node, most bundlers have converged on a convention where the `"module"` field takes precedence over the `"main"` field when present. Package authors can then use the `"module"` field to publish the same code in a different format for bundlers than for node.
This is commonly used to publish "dual packages" that appear to use ECMAScript modules to bundlers but that appear to use CommonJS modules to node. This is useful because ECMAScript modules improve bundler output by taking advantage of "tree shaking" (basically dead-code elimination) and because ECMAScript modules cause lots of problems in node (for example, node doesn't support importing ECMAScript modules using `require()`).
The problem is that if code using `require()` resolves to the `"module"` field in esbuild, the resulting value is currently always an object. ECMAScript modules export a namespace containing all exported properties. There is no direct equivalent of `module.exports = value` in CommonJS. The closest is `export default value` but the CommonJS equivalent of that is `exports.default = value`. This is problematic for code containing `module.exports = function() {}` which is a frequently-used CommonJS library pattern. An example of such an issue is Webpack issue [#6584](https://github.com/webpack/webpack/issues/6584).
An often-proposed way to fix this is to map `require()` to `"main"` and map `import` to `"module"`. The problem with this is that it means the same package would be loaded into memory more than once if it is loaded both with `require()` and with `import` (perhaps from separate packages). An example of such an issue is GraphQL issue [#1479](https://github.com/graphql/graphql-js/issues/1479#issuecomment-416718578).
The workaround for these problems in this release is that esbuild will now exclusively use `"main"` for a package that is loaded using `require()` at least once. Otherwise, if a package is only loaded using `import`, esbuild will exclusively use the `"module"` field. This still takes advantage of tree shaking for ECMAScript modules but gracefully falls back to CommonJS for compatibility.
Keep in mind that the [`"browser"` field](https://github.com/defunctzombie/package-browser-field-spec) still takes precedence over both `"module"` and `"main"` when building for the browser platform.
* Add the `--main-fields=` flag ([#363](https://github.com/evanw/esbuild/issues/363))
This adopts a configuration option from Webpack that lets you specify the order of "main fields" from `package.json` to use when determining the main module file for a package. Node only uses `main` but bundlers often respect other ones too such as `module` or `browser`. You can read more about this feature in the Webpack documentation [here](https://webpack.js.org/configuration/resolve/#resolvemainfields).
The default order when targeting the browser is essentially `browser,module,main` with the caveat that `main` may be chosen over `module` for CommonJS compatibility as described above. If choosing `module` over `main` at the expense of CommonJS compatibility is important to you, this behavior can be disabled by explicitly specifying `--main-fields=browser,module,main`.
The default order when targeting node is `main,module`. Note that this is different than Webpack, which defaults to `module,main`. This is also for compatibility because some packages incorrectly treat `module` as meaning "code for the browser" instead of what it actually means, which is "code for ES6 environments". Unfortunately this disables most tree shaking that would otherwise be possible because it means CommonJS modules will be chosen over ECMAScript modules. If choosing `module` over `main` is important to you (e.g. to potentially take advantage of improved tree shaking), this behavior can be disabled by explicitly specifying `--main-fields=module,main`.
* Additional validation of arguments to JavaScript API calls ([#381](https://github.com/evanw/esbuild/issues/381))
JavaScript API calls each take an object with many optional properties as an argument. Previously there was only minimal validation of the contents of that object. If you aren't using TypeScript, this can lead to confusing situations when the data on the object is invalid. Now there is some additional validation done to the shape of the object and the types of the properties.
It is now an error to pass an object with a property that esbuild won't use. This should help to catch typos. It is also now an error if a property on the object has an unexpected type.
## 0.6.34
* Fix parsing of `type;` statements followed by an identifier in TypeScript ([#377](https://github.com/evanw/esbuild/pull/377))
The following TypeScript code is now correctly parsed as two separate expression statements instead of one type declaration statement:
```ts
type
Foo = {}
```
This was contributed by [@rtsao](https://github.com/rtsao).
* Fix `export {Type}` in TypeScript when bundling ([#379](https://github.com/evanw/esbuild/issues/379))
In TypeScript, `export {Type}` is supposed to be silently removed by the compiler if `Type` does not refer to a value declared locally in the file. Previously this behavior was incompletely implemented. The statement itself was removed but the export record was not, so later stages of the pipeline could sometimes add the export statement back. This release removes the export record as well as the statement so it should stay removed in all cases.
* Forbid exporting non-local symbols in JavaScript
It is now an error to export an identifier using `export {foo}` if `foo` is not declared locally in the same file. This error matches the error that would happen at run-time if the code were to be evaluated in a JavaScript environment that supports ES6 module syntax. This is only an error in JavaScript. In TypeScript, the missing identifier is silently removed instead since it's assumed to be a type name.
* Handle source maps with out-of-order mappings ([#378](https://github.com/evanw/esbuild/issues/378))
Almost all tools that generate source maps write out the mappings in increasing order by generated position since the mappings are generated along with the output. However, some tools can apparently generate source maps with out-of-order mappings. It's impossible for generated line numbers to be out of order due to the way the source map format works, but it's possible for generated column numbers to be out of order. This release fixes this issue by sorting the mappings by generated position after parsing if necessary.
## 0.6.33
* Fix precedence of tagged template expressions ([#372](https://github.com/evanw/esbuild/issues/372))
Previously `` await tag`text` `` and `` new tag`text` `` were incorrectly parsed as `` (await tag)`text` `` and `` (new tag)`text` ``. They are now correctly parsed as `` await (tag`text`) `` and `` new (tag`text`) `` instead.
* Fix invalid syntax when lowering `super` inside `async` to `es2016` or earlier ([#375](https://github.com/evanw/esbuild/issues/375))
This release fixes a bug where using `super.prop` inside an `async` function with `--target=es2016` or earlier generated code that contained a syntax error. This was because `async` functions are converted to generator functions inside a wrapper function in this case, and `super` is not available inside the wrapper function. The fix is to move the reference to `super` outside of the wrapper function.
* Fix duplicate definition of `module` when targeting CommonJS ([#370](https://github.com/evanw/esbuild/issues/370))
The bundler didn't properly reserve the identifier `module` when using `--format=cjs`. This meant automatically-generated variables named `module` could potentially not be renamed to avoid collisions with the CommonJS `module` variable. It was possible to get into this situation when importing a module named `module`, such as the [node built-in module by that name](https://nodejs.org/api/module.html). This name is now marked as reserved when bundling to CommonJS, so automatically-generated variables named `module` will now be renamed to `module2` to avoid collisions.
## 0.6.32
* Allow `--format` when bundling is disabled ([#109](https://github.com/evanw/esbuild/issues/109))
This change means esbuild can be used to convert ES6 import and export syntax to CommonJS syntax. The following code:
```js
import foo from 'foo'
export const bar = foo
```
will be transformed into the following code with `--format=cjs` (the code for `__export` and `__toModule` was omitted for brevity):
```js
__export(exports, {
bar: () => bar
});
const foo = __toModule(require("foo"));
const bar = foo.default;
```
This also applies to non-JavaScript loaders too. The following JSON:
```json
{"foo": true, "bar": false}
```
is normally converted to the following code with `--loader=json`:
```js
module.exports = {foo: true, bar: false};
```
but will be transformed into the following code instead with `--loader=json --format=esm`:
```js
var foo = true;
var bar = false;
var stdin_default = {foo, bar};
export {
bar,
stdin_default as default,
foo
};
```
Note that converting CommonJS `require()` calls to ES6 imports is not currently supported. Code containing a reference to `require` in these situations will generate a warning.
* Change the flag for boolean and string minification ([#371](https://github.com/evanw/esbuild/issues/371))
Previously setting the `--minify-whitespace` flag shortened `true` and `false` to `!0` and `!1` and shortened string literals containing many newlines by writing them as template literals instead. These shortening operations have been changed to the `--minify-syntax` flag instead. There is no change in behavior for the `--minify` flag because that flag already implies both `--minify-whitespace` and `--minify-syntax`.
* Remove trailing `()` from `new` when minifying
Now `new Foo()` will be printed as `new Foo` when minifying (as long as it's safe to do so), resulting in slightly shorter minified code.
* Forbid `async` functions when the target is `es5`
Previously using `async` functions did not cause a compile error when targeting `es5` since if they are unavailable, they are rewritten to use generator functions instead. However, generator functions may also be unsupported. It is now an error to use `async` functions if generator functions are unsupported.
* Fix subtle issue with transforming `async` functions when targeting `es2016` or below
The TypeScript compiler has a bug where, when the language target is set to `ES2016` or earlier, exceptions thrown during argument evaluation are incorrectly thrown immediately instead of later causing the returned promise to be rejected. Since esbuild replicates TypeScript's `async` function transformation pass, esbuild inherited this same bug. The behavior of esbuild has been changed to match the JavaScript specification.
Here's an example of code that was affected:
```js
async function test(value = getDefaultValue()) {}
let promise = test()
```
The call to `test()` here should never throw, even if `getDefaultValue()` throws an exception.
## 0.6.31
* Invalid source maps are no longer an error ([#367](https://github.com/evanw/esbuild/issues/367))
Previously esbuild would fail the build with an error if it encountered a source map that failed validation according to [the specification](https://sourcemaps.info/spec.html). Now invalid source maps will be validated with an error-tolerant validator that will either silently ignore errors or generate a warning, but will never fail the build.
* Fix various edge cases for conformance tests
* Hoisted function declarations in nested scopes can now shadow symbols in the enclosing scope without a syntax error:
```js
let foo
{
function foo() {}
}
```
* If statements directly containing function declarations now introduce a nested scope so this code is no longer a syntax error:
```js
let foo
if (true)
function foo() {}
```
* Keywords can now be used as export aliases with `export * as` statements:
```js
export * as class from 'path'
```
* It is now a syntax error to use `break` or `continue` in invalid locations:
```js
function foo() { break }
```
* Using `yield` as an identifier outside of a generator function is now allowed:
```js
var yield = null
```
* It is now a syntax error to use `yield` or `await` inside a generator or `async` function if it contains an escape sequence:
```js
async function foo() {
return \u0061wait;
}
```
* It is now a syntax error to use an `import()` expression with the `new` operator without parentheses:
```js
new import('path')
```
* Using `let` as an identifier is now allowed:
```js
let = null
```
* It is no longer a compile-time error to assign to an import when not bundling:
```js
import {foo} from 'path'
foo = null
```
Instead the behavior will be left up to the host environment at run-time, which should cause a run-time error. However, this will still be treated as a compile-time error when bundling because the scope-hoisting optimization that happens during bundling means the host may no longer cause run-time errors.
* You can now declare a variable named `arguments` inside a function without an error:
```js
function foo() {
let arguments = null
}
```
* Comma expressions in the iterable position of for-of loops are now a syntax error:
```js
for (var a of b, c) {
}
```
* It is now a syntax error to use `||` or `&&` with `??` without parentheses
```js
a ?? b || c // Syntax error
a ?? (b || c) // Allowed
(a ?? b) || c // Allowed
```
* It is now a syntax error to use `arguments` inside a `class` field initializer
```js
class Foo {
foo = arguments
}
```
* It is now a syntax error to a strict mode reserved word to name a `class`
```js
class static {}
```
## 0.6.30
* Fix optional call of `super` property ([#362](https://github.com/evanw/esbuild/issues/362))
This fixes a bug where lowering the code `super.foo?.()` was incorrectly transformed to this:
```js
var _a, _b;
(_b = (_a = super).foo) == null ? void 0 : _b.call(_a);
```
This is invalid code because a bare `super` keyword is not allowed. Now that code is transformed to this instead:
```js
var _a;
(_a = super.foo) == null ? void 0 : _a.call(this);
```
* Add a `--strict:optional-chaining` option
This affects the transform for the `?.` optional chaining operator. In loose mode (the default), `a?.b` is transformed to `a == null ? void 0 : a.b`. This works fine in all cases except when `a` is the special object `document.all`. In strict mode, `a?.b` is transformed to `a === null || a === void 0 ? void 0 : a.b` which works correctly with `document.all`. Enable `--strict:optional-chaining` if you need to use `document.all` with the `?.` operator.
## 0.6.29
* Add a warning for comparison with `NaN`
This warning triggers for code such as `x === NaN`. Code that does this is almost certainly a bug because `NaN === NaN` is false in JavaScript.
* Add a warning for duplicate switch case clauses
This warning detects situations when multiple `case` clauses in the same `switch` statement match on the same expression. This almost certainly indicates a problem with the code. This warning protects against situations like this:
```js
switch (typeof x) {
case 'object':
// ...
case 'function':
// ...
case 'boolean':
// ...
case 'object':
// ...
}
```
* Allow getters and setters in ES5 ([#356](https://github.com/evanw/esbuild/issues/356))
This was an oversight. I incorrectly thought getters and setters were added in ES6, not in ES5. This release allows getter and setter method syntax even when `--target=es5`.
* Fix a Windows-only regression with missing directory errors ([#359](https://github.com/evanw/esbuild/issues/359))
Various Go file system APIs return `ENOTDIR` for missing file system entries on Windows instead of `ENOENT` like they do on other platforms. This interfered with code added in the previous release that makes unexpected file system errors no longer silent. `ENOTDIR` is usually an unexpected error because it's supposed to happen when the file system entry is present but just unexpectedly a file instead of a directory. This release changes `ENOTDIR` to `ENOENT` in certain cases so that these Windows-only errors are no longer treated as unexpected errors.
* Enforce object accessor argument counts
According to the JavaScript specification, getter methods must have zero arguments and setter methods must have exactly one argument. This release enforces these rules.
* Validate assignment targets
Code containing invalid assignments such as `1 = 2` will now be correctly rejected as a syntax error. Previously such code was passed through unmodified and the output file would contain a syntax error (i.e. "garbage in, garbage out").
## 0.6.28
* Avoid running out of file handles when ulimit is low ([#348](https://github.com/evanw/esbuild/issues/348))
When esbuild uses aggressive concurrency, it can sometimes simultaneously use more file handles than allowed by the system. This can be a problem when the limit is low (e.g. using `ulimit -n 32`). In this release, esbuild now limits itself to using a maximum of 32 file operations simultaneously (in practice this may use up to 64 file handles since some file operations need two handles). This limit was chosen to be low enough to not cause issues with normal ulimit values but high enough to not impact benchmark times.
* Unexpected file system errors are no longer silent ([#348](https://github.com/evanw/esbuild/issues/348))
All file system errors were previously treated the same; any error meant the file or directory was considered to not exist. This was problematic when the process ran out of available file handles because it meant esbuild could ignore files that do actually exist if file handles are exhausted. Then esbuild could potentially generate a different output instead of failing with an error. Now if esbuild gets into this situation, it should report unexpected file system errors and fail to build instead of continuing to build and potentially producing incorrect output.
* Install script tries `npm install` before a direct download ([#347](https://github.com/evanw/esbuild/issues/347))
The `esbuild` package has a post-install script that downloads the native binary for the current platform over HTTP. Some people have configured their environments such that HTTP requests to npmjs.org will hang, and configured npm to use a proxy for HTTP requests instead. In this case, esbuild's install script will still work as long as `npm install` works because the HTTP request will eventually time out, at which point the install script will run `npm install` as a fallback. The timeout is of course undesirable.
This release changes the order of attempted download methods in the install script. Now `npm install` is tried first and directly downloading the file over HTTP will be tried as a fallback. This means installations will be slightly slower since npm is slow, but it should avoid the situation where the install script takes a long time because it's waiting for a HTTP timeout. This should still support the scenarios where there is a HTTP proxy configured, where there is a custom registry configured, and where the `npm` command isn't available.
## 0.6.27
* Add parentheses when calling `require()` inside `new` ([#339](https://github.com/evanw/esbuild/issues/339))
This release fixes an issue where `new (require('path')).ctor()` became `new require_path().ctor()` after bundling, which caused `require_path()` to be invoked as the constructor instead of `ctor()`. With this fix the code `new (require_path()).ctor()` is generated instead, which correctly invokes `ctor()` as the constructor. This was contributed by [@rtsao](https://github.com/rtsao).
## 0.6.26
* Fix syntax error when minifying and bundling CommonJS to ES5 ([#335](https://github.com/evanw/esbuild/issues/335))
With the flags `--minify --bundle --target=es5`, esbuild had a bug where the arrow function for the closure used to wrap CommonJS modules was not correctly printed as an ES5 function expression, causing a syntax error. This bug has been fixed.
## 0.6.25
* Avoid the `\v` escape sequence in JSON strings
Source maps are JSON files, and must obey the [JSON specification](https://www.json.org/). The escape sequence `\v` (for the ASCII control character 11) is valid in JavaScript but not in JSON. Previously esbuild contained a bug where source maps for files containing this ASCII control character were invalid JSON. This release fixes the bug by printing this character as `\u000B` instead.
* Speedup for `esbuild-wasm` when using the command line
The [esbuild-wasm](https://www.npmjs.com/package/esbuild-wasm) package includes a WebAssembly command-line tool called `esbuild` which functions the same as the native command-line tool called `esbuild` in the [esbuild](https://www.npmjs.com/package/esbuild) package. The difference is that the WebAssembly implementation is around an order of magnitude slower than the native version.
This release changes the API used to instantiate the WebAssembly module from [WebAssembly.instantiate](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WebAssembly/instantiate) to [WebAssembly.Module](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WebAssembly/Module/Module), which reduces end-to-end build time by around 1 second on my development laptop. The WebAssembly version is still much slower than the native version, but now it's a little faster than before.
* Optimize for the [@material-ui/icons](https://www.npmjs.com/package/@material-ui/icons) package
This package has a directory containing over 11,000 files. Certain optimizations in esbuild that worked fine for common cases severely impacted performance for this edge case. This release changes some aspects of path resolution caching to fix these problems. Build time for a certain benchmark involving this package improved from 1.01s for the previous release to 0.22s for this release. Other benchmark times appear to be unaffected.
## 0.6.24
* Switch from base64 encoding to base32 encoding for file hashes
Certain output files contain hashes in their name both to prevent collisions and to improve caching. For example, an SVG file named `example.svg` that is loaded using the `file` loader might be copied to a file named `example.T3K5TRK4.svg` in the build directory. The hashes are based on the file's contents so they only change when the file content itself changes.
The hashes previously used [base64 encoding](https://en.wikipedia.org/wiki/Base64) but I recently realized that since certain file systems (e.g. Windows) are case-insensitive, this could lead to confusing situations where esbuild could theoretically generate two files with different case-sensitive names but with the same case-insensitive name. Hashes now use [base32 encoding](https://en.wikipedia.org/wiki/Base32) which only includes uppercase letters, not lowercase letters, which should avoid this confusing situation.
* Optimize character frequency for better gzip compression
The character sequence used to generate minified names is now the characters in the input files sorted descending by frequency. Previously it was just the valid identifier characters in alphabetic order. This means minified names are more likely to contain characters found elsewhere in the output file (e.g. in keywords and strings). This is a pretty small win but it was added because it's a consistent win, it's simple to implement, and it's very fast to compute.
* Minor syntax minification improvements
This release contains these additional rules for syntax minification:
* `a ? b : b` is minified to `a, b`
* `a ? a : b` is minified to `a || b`
* `a ? b : a` is minified to `a && b`
* `a == void 0` is minified to `a == null`
* `a && (b && c)` is minified to `a && b && c` (same for `||`)
* `a ? c : (b, c)` is minified to `(a || b), c`
* `a ? (b, c) : c` is minified to `(a && b), c`
* `a ? b || c : c` is minified to `(a && b) || c`
* `a ? c : b && c` is minified to `(a || b) && c`
* `a ? b(c) : b(d)` is minified to `b(a ? c : d)`
* `a ? true : false` is minified to `!!a`
* `a != null ? a : b` is minified to `a ?? b` if it's supported in the target environment
* `a ? (b ? c : d) : d` is minified to `(a && b) ? c : d`
* `a ? b : (c ? b : d)` is minified to `(a || c) ? b : d`
* `(function foo() {})` is minified to `(function() {})`
* `typeof a === "string"` is minified to `typeof a == "string"`
* `if (a) if (b) return c` is minified to `if (a && b) return c`
* `while (a) if (!b) break;` is minified to `for (; a && b; ) ;`
* `a === null || a === undefined` is minified to `a == null`
These improvements cause minified code to be slightly smaller.
## 0.6.23
* Add an error message for a missing `--tsconfig` file ([#330](https://github.com/evanw/esbuild/issues/330))
The `--tsconfig` flag that was added in version 0.6.1 didn't report an error if the provided file doesn't actually exist. This release makes doing this an error that will fail the build.
* Avoid generating the minified label name `if` ([#332](https://github.com/evanw/esbuild/issues/332))
The recent minification changes in 0.6.20 introduced a regression where input files containing 333 or more label statements resulted in a label being assigned the minified name `if`, which is a JavaScript keyword. This is the first JavaScript keyword in the minified name sequence that esbuild uses for label names: `a b c ... aa ba ca ...`. The regression has been fixed and there is now test coverage for this case.
## 0.6.22
* The bell character is now escaped
In most terminals, printing the bell character (ASCII code 7) will trigger a sound. The macOS terminal will also flash the screen if sound is muted. This is annoying, and can happen when dumping the output of esbuild to the terminal if the input contains a bell character. Now esbuild will always escape bell characters in the output to avoid this problem.
* CommonJS modules now export properties of prototype ([#326](https://github.com/evanw/esbuild/issues/326))
This change is for compatibility with Webpack. You can now assign an object with a custom prototype to `module.exports` and esbuild will consider all enumerable properties on the prototype as exports. This behavior is necessary to correctly bundle the [paper.js](https://github.com/paperjs/paper.js) library, for example.
## 0.6.21
* Upgrade from Go 1.14 to Go 1.15
This change isn't represented by a commit in the repo, but from now on I will be using Go 1.15 to build the distributed binaries instead of Go 1.14. The [release notes for Go 1.15](https://golang.org/doc/go1.15) mention improvements to binary size:
> Go 1.15 reduces typical binary sizes by around 5% compared to Go 1.14 by eliminating certain types of GC metadata and more aggressively eliminating unused type metadata.
Initial testing shows that upgrading Go reduces the esbuild binary size on macOS from 7.4mb to 5.3mb, which is a 30% smaller binary! I assume the binary size savings are similar for other platforms. Run-time performance on the esbuild benchmarks seems consistent with previous releases.
* Lower non-tag template literals to ES5 ([#297](https://github.com/evanw/esbuild/issues/297))
You can now use non-tag template literals such as `` `abc` `` and `` `a${b}c` `` with `--target=es5` and esbuild will convert them to string addition such as `"abc"` and `"a" + b + "c"` instead of reporting an error.
* Newline normalization in template literals
This fixes a bug with esbuild that caused carriage-return characters to incorrectly end up in multi-line template literals if the source file used Windows-style line endings (i.e. `\r\n`). The ES6 language specification says that both carriage-return characters and Windows carriage-return line-feed sequences must be converted to line-feed characters instead. With this change, esbuild's parsing of multi-line template literals should no longer be platform-dependent.
* Fix minification bug with variable hoisting
Hoisted variables that are declared with `var` in a nested scope but hoisted to the top-level scope were incorrectly minified as a nested scope symbol instead of a top-level symbol, which could potentially cause a name collision. This bug has been fixed.
## 0.6.20
* Symbols are now renamed separately per chunk ([#16](https://github.com/evanw/esbuild/issues/16))
Previously, bundling with code splitting assigned minified names using a single frequency distribution calculated across all chunks. This meant that typical code changes in one chunk would often cause the contents of all chunks to change, which negated some of the benefits of the browser cache.
Now symbol renaming (both minified and not minified) is done separately per chunk. It was challenging to implement this without making esbuild a lot slower and causing it to use a lot more memory. Symbol renaming has been mostly rewritten to accomplish this and appears to actually usually use a little less memory and run a bit faster than before, even for code splitting builds that generate a lot of chunks. In addition, minified chunks are now slightly smaller because a given minified name can now be reused by multiple chunks.
## 0.6.19
* Reduce memory usage for large builds by 30-40% ([#304](https://github.com/evanw/esbuild/issues/304))
This release reduces memory usage. These specific percentages are likely only accurate for builds with a large number of files. Memory is reduced by ~30% for all builds by avoiding unnecessary per-file symbol maps, and is reduced by an additional ~10% for builds with source maps by preallocating some large arrays relating to source map output.
* Replace `.js` and `.jsx` with `.ts` or `.tsx` when resolving ([#118](https://github.com/evanw/esbuild/issues/118))
This adds an import path resolution behavior that's specific to the TypeScript compiler where you can use an import path that ends in `.js` or `.jsx` when the correct import path actually ends in `.ts` or `.tsx` instead. See the discussion here for more historical context: https://github.com/microsoft/TypeScript/issues/4595.
## 0.6.18
* Install script falls back to `npm install` ([#319](https://github.com/evanw/esbuild/issues/319))
The `esbuild` package has a post-install script that downloads the esbuild binary. However, this will fail if `registry.npmjs.org` (or the configured custom npm registry) is inaccessible.
This release adds an additional fallback for when the download fails. It tries to use the `npm install` command to download the esbuild binary instead. This handles situations where users have either configured npm with a proxy or have a custom command in their path called `npm`.
## 0.6.17
* Add a download cache to the install script
This speeds up repeated esbuild installs for the same version by only downloading the binary from npm the first time and then reusing it for subsequent installs. The binary files are cached in these locations, which are the same locations as the Electron install script:
* Windows: `%USERPROFILE%\AppData\Local\Cache\esbuild\bin`
* macOS: `~/Library/Caches/esbuild/bin`
* Other: `~/.cache/esbuild/bin`
The cache holds a maximum of 5 entries and purges least-recently-used entries above that limit.
* Omit `export default` of local type names ([#316](https://github.com/evanw/esbuild/issues/316))
Normally the `export default` syntax takes a value expression to export. However, TypeScript has a special case for `export default <identifier>` where the identifier is allowed to be a type expression instead of a value expression. In that case, the type expression should not be emitted in the resulting bundle. This release improves support for this case by omitting the export when the identifier matches a local type name.
## 0.6.16
* Colors for Windows console output
Console output on Windows now uses color instead of being monochrome. This should make log messages easier to read.
* Parenthesize destructuring assignment in arrow function expressions ([#313](https://github.com/evanw/esbuild/issues/313))
This fixes a bug where `() => ({} = {})` was incorrectly printed as `() => ({}) = {}`, which is a syntax error. This case is now printed correctly.
## 0.6.15
* Support symlinks with absolute paths in `node_modules` ([#310](https://github.com/evanw/esbuild/issues/310))
Previously esbuild only supported symlinks with relative paths, not absolute paths. Adding support for absolute paths in symlinks fixes issues with esbuild and [pnpm](https://github.com/pnpm/pnpm) on Windows.
* Preserve leading comments inside `import()` expressions ([#309](https://github.com/evanw/esbuild/issues/309))
This makes it possible to use esbuild as a faster TypeScript-to-JavaScript frontend for Webpack, which has special [magic comments](https://webpack.js.org/api/module-methods/#magic-comments) inside `import()` expressions that affect Webpack's behavior.
* Fix crash for source files beginning with `\r\n` when using source maps ([#311](https://github.com/evanw/esbuild/issues/311))
The source map changes in version 0.6.13 introduced a regression that caused source files beginning with `\r\n` to crash esbuild when source map generation was enabled. This was not caught during testing both because not many source files begin with a newline and not many source files have Windows-style line endings in them. This regression has been fixed and Windows-style line endings now have test coverage.
## 0.6.14
* Add support for parsing top-level await ([#253](https://github.com/evanw/esbuild/issues/253))
It seems appropriate for esbuild to support top-level await syntax now that [node is supporting top-level await syntax by default](https://github.com/nodejs/node/issues/34551) (it's the first widely-used platform to do so). This syntax can now be parsed by esbuild and is always passed through untransformed. It's only allowed when the target is `esnext` because the proposal is still in stage 3. It also cannot be used when bundling. Adding support for top-level await to the bundler is complicated since it causes imports to be asynchronous, which has far-reaching implications. This change is mainly for people using esbuild as a library to transform TypeScript into JavaScript one file at a time.
## 0.6.13
* Exclude non-JavaScript files from source maps ([#304](https://github.com/evanw/esbuild/issues/304))
Previously all input files were eligible for source map generation, even binary files included using loaders such as `dataurl`. This was not intentional. Doing this doesn't serve a purpose and can massively bloat the resulting source maps. Now all files are excluded except those loaded by the `js`, `jsx`, `ts`, and `tsx` loaders.
* Fix incorrect source maps with code splitting ([#303](https://github.com/evanw/esbuild/issues/303))
Source maps were completely incorrect when code splitting was enabled for chunk files that imported other chunk files. The source map offsets were not being adjusted past the automatically-generated cross-chunk import statements. This has been fixed.
* Change source map column offsets from bytes to UTF-16 code units
The [source map specification](https://sourcemaps.info/spec.html) leaves many things unspecified including what column numbers mean. Until now esbuild has been generating byte offsets for column numbers, but Mozilla's popular [source-map](https://github.com/mozilla/source-map) library appears to use UTF-16 code unit counts for column numbers instead. With this release, esbuild now also uses UTF-16 code units for column numbers in source maps. This should help esbuild's compatibility with other tools in the ecosystem.
* Fix a bug with partial source mappings
The source map specification makes it valid to have mappings that don't actually map to anything. These mappings were never generated by esbuild but they are sometimes present in source maps generated by other tools. There was a bug where the source map line number would be thrown off if one of these mappings was present at the end of a line. This bug has been fixed.
## 0.6.12
* Fix bugs with cross-chunk assignment handling ([#302](https://github.com/evanw/esbuild/issues/302))
The code splitting process may end up moving the declaration of a file-local variable into a separate chunk from an assignment to that variable. However, it's not possible to assign to a variable in another chunk because assigning to an import is not allowed in ES6. To avoid generating invalid code, esbuild runs an additional pass after code splitting to force all code involved in cross-chunk assignments into the same chunk.
The logic to do this is quite tricky. For example, moving code between chunks may introduce more cross-chunk assignments that also need to be handled. In this case the bug was caused by not handling complex cases with three or more levels of cross-chunk assignment dependency recursion. These cases now have test coverage and should be handled correctly.
## 0.6.11
* Code splitting chunks now use content hashes ([#16](https://github.com/evanw/esbuild/issues/16))
Code that is shared between multiple entry points is separated out into "chunk" files when code splitting is enabled. These files are named `chunk.HASH.js` where `HASH` is a string of characters derived from a hash (e.g. `chunk.iJkFSV6U.js`).
Previously the hash was computed from the paths of all entry points which needed that chunk. This was done because it was a simple way to ensure that each chunk was unique, since each chunk represents shared code from a unique set of entry points. But it meant that changing the contents of the chunk did not cause the chunk name to change.
Now the hash is computed from the contents of the chunk file instead. This better aligns esbuild with the behavior of other bundlers. If changing the contents of the file always causes the name to change, you can serve these files with a very large `max-age` so the browser knows to never re-request them from your server if they are already cached.
Note that the names of entry points _do not_ currently contain a hash, so this optimization does not apply to entry points. Do not serve entry point files with a very large `max-age` or the browser may not re-request them even when they are updated. Including a hash in the names of entry point files has not been done in this release because that would be a breaking change. This release is an intermediate step to a state where all output file names contain content hashes.
The reason why this hasn't been done before now is because this change makes chunk generation more complex. Generating the contents of a chunk involves generating import statements for the other chunks which that chunk depends on. However, if chunk names now include a content hash, chunk generation must wait until the dependency chunks have finished. This more complex behavior has now been implemented.
Care was taken to still parallelize as much as possible despite parts of the code having to block. Each input file in a chunk is still printed to a string fully in parallel. Waiting was only introduced in the chunk assembly stage where input file strings are joined together. In practice, this change doesn't appear to have slowed down esbuild by a noticeable amount.
* Fix an off-by-one error with source map generation ([#289](https://github.com/evanw/esbuild/issues/289))
The nested source map support added in version 0.6.5 contained a bug. Input files that were included in the bundle but that didn't themselves contain any generated code caused the source index to shift by one, throwing off the source names of all files after it. This could happen with files consisting only of re-export statements (e.g. `export {name} from 'path'`). This bug has been fixed and this specific scenario now has test coverage.
## 0.6.10
* Revert the binary operator chain change
It turns out this caused some behavior bugs in the generated code.
## 0.6.9
* Performance optimizations for large file transforms
There are two main JavaScript APIs: `build()` which operates on the file system and `transform()` which operates on in-memory data. Previously transforming large files using the JavaScript `transform()` API could be significantly slower than just writing the in-memory string to the file system, calling `build()`, and reading the result back from the file system. This is based on performance tests done on macOS 10.15.
Now esbuild will go through the file system when transforming large files (currently >1mb). This approach is only faster for large files, and can be significantly slower for small files, so small files still keep everything in memory.
* Avoid stack overflow for binary operator chains
Syntax trees with millions of sequential binary operators nested inside each other can cause the parser to stack overflow because it uses a recursive visitor pattern, so each binary operator added an entry to the call stack. Now code like this no longer triggers a stack overflow because the visitor uses the heap instead of the stack in this case. This is unlikely to matter in real-world code but can show up in certain artificial test cases, especially when `--minify-syntax` is enabled.
* Resolve implicitly-named `tsconfig.json` base files ([#279](https://github.com/evanw/esbuild/issues/279))
The official TypeScript compiler lets you specify a package path as the `extends` property of a `tsconfig.json` file. The base file is then searched for in the relevant `node_modules` directory. Previously the package path had to end with the name of the base file. Now you can additionally omit the name of the base file if the file name is `tsconfig.json`. This more closely matches the behavior of the official TypeScript compiler.
* Support for 32-bit Windows systems ([#285](https://github.com/evanw/esbuild/issues/285))
You can now install the esbuild npm package on 32-bit Windows systems.
## 0.6.8
* Attempt to support the taobao.org registry ([#291](https://github.com/evanw/esbuild/issues/291))
This release attempts to add support for the registry at https://registry.npm.taobao.org, which uses a different URL structure than the official npm registry. Also, the install script will now fall back to the official npm registry if installing with the configured custom registry fails.
## 0.6.7
* Custom registry can now have a path ([#286](https://github.com/evanw/esbuild/issues/286))
This adds support for custom registries hosted at a path other than `/`. Previously the registry had to be hosted at the domain level, like npm itself.
* Nested source maps use relative paths ([#289](https://github.com/evanw/esbuild/issues/289))
The original paths in nested source maps are now modified to be relative to the directory containing the source map. This means source maps from packages inside `node_modules` will stay inside `node_modules` in browser developer tools instead of appearing at the root of the virtual file system where they might collide with the original paths of files in other packages.
* Support for 32-bit Linux systems ([#285](https://github.com/evanw/esbuild/issues/285))
You can now install the esbuild npm package on 32-bit Linux systems.
## 0.6.6
* Fix minification bug with `this` values for function calls ([#282](https://github.com/evanw/esbuild/issues/282))
Previously `(0, this.fn)()` was incorrectly minified to `this.fn()`, which changes the value of `this` used for the function call. Now syntax like this is preserved during minification.
* Install script now respects the npm registry setting ([#286](https://github.com/evanw/esbuild/issues/286))
If you have configured npm to use a custom registry using `npm config set registry <url>` or by installing esbuild using `npm install --registry=<url> ...`, this custom registry URL should now be respected by the esbuild install script.
Specifically, the install script now uses the URL from the `npm_config_registry` environment variable if present instead of the default registry URL `https://registry.npmjs.org/`. Note that the URL must have both a protocol and a host name.
* Fixed ordering between `node_modules` and a force-overridden `tsconfig.json` ([#278](https://github.com/evanw/esbuild/issues/278))
When the `tsconfig.json` settings have been force-overridden using the new `--tsconfig` flag, the path resolution behavior behaved subtly differently than if esbuild naturally discovers the `tsconfig.json` file without the flag. The difference caused package paths present in a `node_modules` directory to incorrectly take precedence over custom path aliases configured in `tsconfig.json`. The ordering has been corrected such that custom path aliases always take place over `node_modules`.
* Add the `--out-extension` flag for custom output extensions ([#281](https://github.com/evanw/esbuild/issues/281))
Previously esbuild could only output files ending in `.js`. Now you can override this to another extension by passing something like `--out-extension:.js=.mjs`. This allows generating output files with the node-specific `.cjs` and `.mjs` extensions without having to use a separate command to rename them afterwards.
## 0.6.5
* Fix IIFE wrapper for ES5
The wrapper for immediately-invoked function expressions is hard-coded to an arrow function and was not updated when the ES5 target was added. This meant that bundling ES5 code would generate a bundle what wasn't ES5-compatible. Doing this now uses a function expression instead.
* Add support for nested source maps ([#211](https://github.com/evanw/esbuild/issues/211))
Source map comments of the form `//# sourceMappingURL=...` inside input files are now respected. This means you can bundle files with source maps and esbuild will generate a source map that maps all the way back to the original files instead of to the intermediate file with the source map.
## 0.6.4
* Allow extending `tsconfig.json` paths inside packages ([#269](https://github.com/evanw/esbuild/issues/269))
Previously the `extends` field in `tsconfig.json` only worked with relative paths (paths starting with `./` or `../`). Now this field can also take a package path, which will be resolved by looking for the package in the `node_modules` directory.
* Install script now avoids the `npm` command ([#274](https://github.com/evanw/esbuild/issues/274))
The install script now downloads the binary directly from npmjs.org instead of using the `npm` command to install the package. This should be more compatible with unusual node environments (e.g. having multiple old copies of npm installed).
* Fix a code splitting bug with re-exported symbols ([#273](https://github.com/evanw/esbuild/issues/273))
Re-exporting a symbol in an entry point didn't correctly track the cross-chunk dependency, which caused the output file to be missing a required import. This bug has been fixed.
* Fix code splitting if a dynamic entry point is doubled as a normal entry point ([#272](https://github.com/evanw/esbuild/issues/272))
Using a dynamic `import()` expression automatically adds the imported path as an entry point. However, manually adding the imported path to the bundler entry point list resulted in a build failure. This case is now handled.
* Fix dynamic imports from a parent directory ([#264](https://github.com/evanw/esbuild/issues/264))
The nested output directory feature interacted badly with the code splitting feature when an entry point contained a dynamic `import()` to a file from a directory that was a parent directory to all entry points. This caused esbuild to generate output paths starting with `../` which stepped outside of the output directory.
The directory structure of the input files is mirrored in the output directory relative to the [lowest common ancestor](https://en.wikipedia.org/wiki/Lowest_common_ancestor) among all entry point paths. However, code splitting introduces a new entry point for each dynamic import. These additional entry points are not in the original entry point list so they were ignored by the lowest common ancestor algorithm. The fix is to make sure all entry points are included, user-specified and dynamic.
## 0.6.3
* Fix `/* @__PURE__ */` IIFEs at start of statement ([#258](https://github.com/evanw/esbuild/issues/258))
The introduction of support for `/* @__PURE__ */` comments in an earlier release introduced a bug where parentheses were no longer inserted if a statement started with a function expression that was immediately invoked. This bug has been fixed and parentheses are now inserted correctly.
* Add support for `@jsx` and `@jsxFrag` comments ([#138](https://github.com/evanw/esbuild/issues/138))
You can now override the JSX factory and fragment values on a per-file basis using comments:
```jsx
// @jsx h
// @jsxFrag Fragment
import {h, Fragment} from 'preact'
console.log(<><a/></>)
```
This now generates the following code:
```js
import {h, Fragment} from "preact";
console.log(h(Fragment, null, h("a", null)));
```
* Add the `Write` option to the Go API
This brings the Go API to parity with the JavaScript API, and makes certain uses of the `api.Build()` call simpler. You can now specify `Write: true` to have the output files written to the file system during the build instead of having to do that yourself.
## 0.6.2
* Fix code splitting bug with re-export cycles ([#251](https://github.com/evanw/esbuild/issues/251))
Two files that both re-export each other could cause invalid code to be generated when code splitting is enabled. The specific failure was an export statement without a matching import statement from the shared code chunk. This bug has been fixed.
Semantically a `export * from 'path'` statement should behave like a `export {name} from 'path'` statement with the export list determined automatically. And likewise `export {name} from 'path'` should behave like `import {name} from 'path'; export {name}`.
This issue was caused by the re-exported symbols not registering themselves as if they were imported with an import statement. That caused code splitting to fail to generate an import statement when the definition of the symbol ended up in a different chunk than the use of the symbol.
* Fix code splitting bug with missing generated imports
An ES6 module that doesn't import or export anything but that still uses ES6 module syntax (e.g. `import.meta`) interacted badly with some optimizations and caused invalid code to be generated. This generated an import statement without a matching export statement. The bug has been fixed.
To improve tree shaking, esbuild automatically converts `import * as ns from 'path'; use(ns.prop)` into `import {prop} from 'path'; use(prop)` at parse time. The parser doesn't yet know anything about `path` because parsing happens in parallel, so this transformation is always performed.
Later on `path` is determined to be an ES6 module with no exports. This means that there is no symbol to bind `prop` to. Since it was originally a property access on what is now known to be an empty exports object, its value is guaranteed to be undefined. It's no longer a property access so esbuild inlines the undefined value at all uses by replacing `prop` with `void 0`.
However, code splitting wasn't aware of this and still thought imports needed to be generated for uses of `prop`, even though it doesn't actually exist. That caused invalid and unnecessary import statements to be generated. Now code splitting is aware of this undefined substitution behavior and ignores these symbol uses.
## 0.6.1
* Allow bundling with stdin as input ([#212](https://github.com/evanw/esbuild/issues/212))
You can now use `--bundle` without providing any input files and the input will come from stdin instead. Use `--sourcefile=...` to set the name of the input file for error messages and source maps. Dependencies of the input file will be resolved relative to the current working directory.
```
# These two commands are now basically equivalent
esbuild --bundle example.js
esbuild --bundle < example.js --sourcefile=example.js
```
This option has also been added to the JavaScript and Go APIs. If needed, you can customize the resolve directory with the `resolveDir` option:
```js
const {outputFiles: [stdout]} = await build({
stdin: {
contents: `
import {version} from './package.json'
console.log(version as string)
`,
sourcefile: 'example.ts',
resolveDir: __dirname,
loader: 'ts',
},
bundle: true,
write: false,
})
console.log(stdout)
```
* Implement `extends` for `tsconfig.json` ([#233](https://github.com/evanw/esbuild/issues/233))
A `tsconfig.json` file can inherit configurations from another file using the `extends` property. Before this release, esbuild didn't support this property and any inherited settings were missing. Now esbuild should include these inherited settings.
* Allow manually overriding `tsconfig.json` ([#226](https://github.com/evanw/esbuild/issues/226))
Normally esbuild finds the appropriate `tsconfig.json` file by walking up the directory tree. This release adds the `--tsconfig=...` flag which lets you disable this feature and force esbuild to use the provided configuration file instead. This corresponds to the TypeScript compiler's `--project` flag.
* Remove gaps in source maps within a file ([#249](https://github.com/evanw/esbuild/issues/249))
The widely-used [source-map](https://github.com/mozilla/source-map) library for parsing source maps [has a bug](https://github.com/mozilla/source-map/issues/261) where it doesn't return mappings from previous lines. This can cause queries within generated code to fail even though there are valid mappings on both sides of the query.
To work around this issue with the source-map library, esbuild now generates a mapping for every line of code that is generated from an input file. This means that queries with the source-map library should be more robust. For example, you should now be able to query within a multi-line template literal and not have the query fail.
Note that some lines of code generated during bundling will still not have source mappings. Examples include run-time library code and cross-chunk imports and exports.
## 0.6.0
* Output directory may now contain nested directories ([#224](https://github.com/evanw/esbuild/issues/224))
Note: This is a breaking change if you use multiple entry points from different directories. Output paths may change with this upgrade.
Previously esbuild would fail to bundle multiple entry points with the same name because all output files were written to the same directory. This can happen if your entry points are in different nested directories like this:
```
src/
├─ a/
│ └─ page.js
└─ b/
└─ page.js
```
With this release, esbuild will now generate nested directories in the output directory that mirror the directory structure of the original entry points. This avoids collisions because the output files will now be in separate directories. The directory structure is mirrored relative to the [lowest common ancestor](https://en.wikipedia.org/wiki/Lowest_common_ancestor) among all entry point paths. This is the same behavior as [Parcel](https://github.com/parcel-bundler/parcel) and the TypeScript compiler.
* Silence errors about missing dependencies inside try/catch blocks ([#247](https://github.com/evanw/esbuild/issues/247))
This release makes it easier to use esbuild with libraries such as [debug](npmjs.com/package/debug) which contain a use of `require()` inside a `try`/`catch` statement for a module that isn't listed in its dependencies. Normally you need to mark the library as `--external` to silence this error. However, calling `require()` and catching errors is a common pattern for conditionally importing an unknown module, so now esbuild automatically treats the missing module as external in these cases.
* TypeScript type definitions for the browser API
The node-based JavaScript API already ships with TypeScript type checking for the `esbuild` and `esbuild-wasm` packages. However, up until now the browser-based JavaScript API located in `esbuild-wasm/lib/browser` did not have type definitions. This release adds type definitions so you can now import `esbuild-wasm/lib/browser` in TypeScript and get type checking.
* Add chunk imports to metadata file ([#225](https://github.com/evanw/esbuild/issues/225))
With code splitting, it's sometimes useful to list out the chunks that will be needed by a given entry point. For example, you may want to use that list to insert one `<link rel="modulepreload">` tag for each chunk in your page header. This information is now present in the JSON metadata file that's generated with the `--metafile` flag. Each object in the `outputs` map now has an `imports` array, and each import has a `path`.
## 0.5.26
* Allow disabling non-existent modules with the `browser` package.json field ([#238](https://github.com/evanw/esbuild/issues/238))
The [browser field](https://github.com/defunctzombie/package-browser-field-spec) in package.json allows you to disable a module (i.e. force it to become empty) by adding an override that points to `false`. Previously esbuild still required it to have an existing absolute path on the file system so that the disabled module could have a consistent identity. Now this is no longer required, so you can disable modules that don't exist on the file system. For example, you can now use this feature to disable the `fs` module.
* Fix a bug with syntax transformation and `super()` calls ([#242](https://github.com/evanw/esbuild/issues/242))
In certain situations, esbuild accidentally transformed a class constructor such that a call to `super()` that came first in the original code no longer came first in the generated code. This code generation bug has now been fixed. Calls to `super()` that come first are should now stay that way.
## 0.5.25
* Performance improvment for repeated API calls
Previously every build or transform API call required parsing a new copy of the [esbuild JavaScript runtime code](internal/runtime/runtime.go). This added a constant overhead for every operation. Now the parsing of the runtime code is cached across API calls. The effect on performance depends on the size of the files you're transforming. Transform API calls appear to be >2x faster for small files, around ~10% faster for normal-sized files, and insignificant for large files.
* Add a binary loader
You can now assign the `binary` loader to a file extension to load all files of that type into a Uint8Array. The data is encoded as a base64 string and decoded into a Uint8Array at run time. The decoder defaults to a custom platform-independent implementation (faster than `atob`) but it switches to using the `Buffer` API with `--platform=node`.
* Add fine-grained `--target` environments ([#231](https://github.com/evanw/esbuild/issues/231))
You can now configure individual JavaScript environments as targets. The `--target` flag now takes a comma-separated list of values like this: `--target=chrome58,firefox57,safari11,edge16`. Compatibility data was mainly sourced from [this widely-used compatibility table](https://kangax.github.io/compat-table/es2016plus/).
There is also now an additional `es5` target. Since no transforms to ES5 are implemented yet, its purpose is mainly to prevent ES6 syntax from accidentally being compiled. This target also prevents esbuild from doing some ES6-specific optimizations that would unintentionally change ES5 code into ES6 code.
## 0.5.24
* Smaller code for loaders that generate expressions
Loaders that generate expressions (`json`, `text`, `base64`, `file`, and `dataurl`) export them using an assignment to `module.exports`. However, that forces the creation of a CommonJS module which adds unnecessary extra code. Now if the file for that loader is only imported using ES6 import statements instead of `require()`, the expression is exported using an `export default` statement instead. This generates smaller code. The bundler still falls back to the old `module.exports` behavior if the file is imported using `require()` instead of an ES6 import statement.
Example input file:
```js
import txt from './example.txt'
console.log(txt)
```
Old bundling behavior:
```js
// ...code for __commonJS() and __toModule() omitted...
// example.txt
var require_example = __commonJS((exports, module) => {
module.exports = "This is a text file.";
});
// example.ts
const example = __toModule(require_example());
console.log(example.default);
```
New bundling behavior:
```js
// example.txt
var example_default = "This is a text file.";
// example.ts
console.log(example_default);
```
In addition, top-level properties of imported JSON files are now converted into individual ES6 exports for better tree shaking. For example, that means you can now import the `version` property from your `package.json` file and the entire JSON file will be removed from the bundle:
```js
import {version} from './package.json'
console.log(version)
```
The example above will now generate code that looks like this:
```js
// package.json
var version = "1.0.0";
// example.ts
console.log(version);
```
## 0.5.23
* Fix `export declare` inside `namespace` in TypeScript ([#227](https://github.com/evanw/esbuild/issues/227))
The TypeScript parser assumed that ambient declarations (the `declare` keyword)
gitextract_8wuhqmhk/ ├── .editorconfig ├── .github/ │ ├── ISSUE_TEMPLATE/ │ │ └── new-issue.md │ └── workflows/ │ ├── ci.yml │ ├── e2e.yml │ ├── publish.yml │ └── validate.yml ├── .gitignore ├── CHANGELOG-2020.md ├── CHANGELOG-2021.md ├── CHANGELOG-2022.md ├── CHANGELOG-2023.md ├── CHANGELOG-2024.md ├── CHANGELOG.md ├── LICENSE.md ├── Makefile ├── README.md ├── RUNBOOK.md ├── cmd/ │ └── esbuild/ │ ├── main.go │ ├── main_other.go │ ├── main_wasm.go │ ├── service.go │ ├── stdio_protocol.go │ └── version.go ├── compat-table/ │ ├── .gitignore │ ├── README.md │ ├── package.json │ ├── src/ │ │ ├── caniuse.ts │ │ ├── compat-table.ts │ │ ├── css_table.ts │ │ ├── index.ts │ │ ├── js_table.ts │ │ ├── mdn.ts │ │ └── types.d.ts │ └── tsconfig.json ├── dl.sh ├── docs/ │ ├── architecture.md │ └── development.md ├── go.mod ├── go.sum ├── go.version ├── internal/ │ ├── api_helpers/ │ │ └── use_timer.go │ ├── ast/ │ │ └── ast.go │ ├── bundler/ │ │ └── bundler.go │ ├── bundler_tests/ │ │ ├── bundler_css_test.go │ │ ├── bundler_dce_test.go │ │ ├── bundler_default_test.go │ │ ├── bundler_glob_test.go │ │ ├── bundler_importphase_test.go │ │ ├── bundler_importstar_test.go │ │ ├── bundler_importstar_ts_test.go │ │ ├── bundler_loader_test.go │ │ ├── bundler_lower_test.go │ │ ├── bundler_packagejson_test.go │ │ ├── bundler_splitting_test.go │ │ ├── bundler_test.go │ │ ├── bundler_ts_test.go │ │ ├── bundler_tsconfig_test.go │ │ ├── bundler_yarnpnp_test.go │ │ └── snapshots/ │ │ ├── snapshots_css.txt │ │ ├── snapshots_dce.txt │ │ ├── snapshots_default.txt │ │ ├── snapshots_glob.txt │ │ ├── snapshots_importphase.txt │ │ ├── snapshots_importstar.txt │ │ ├── snapshots_importstar_ts.txt │ │ ├── snapshots_loader.txt │ │ ├── snapshots_lower.txt │ │ ├── snapshots_packagejson.txt │ │ ├── snapshots_splitting.txt │ │ ├── snapshots_ts.txt │ │ ├── snapshots_tsconfig.txt │ │ └── snapshots_yarnpnp.txt │ ├── cache/ │ │ ├── cache.go │ │ ├── cache_ast.go │ │ └── cache_fs.go │ ├── cli_helpers/ │ │ └── cli_helpers.go │ ├── compat/ │ │ ├── compat.go │ │ ├── compat_test.go │ │ ├── css_table.go │ │ └── js_table.go │ ├── config/ │ │ ├── config.go │ │ └── globals.go │ ├── css_ast/ │ │ ├── css_ast.go │ │ └── css_decl_table.go │ ├── css_lexer/ │ │ ├── css_lexer.go │ │ └── css_lexer_test.go │ ├── css_parser/ │ │ ├── css_color_spaces.go │ │ ├── css_decls.go │ │ ├── css_decls_animation.go │ │ ├── css_decls_border_radius.go │ │ ├── css_decls_box.go │ │ ├── css_decls_box_shadow.go │ │ ├── css_decls_color.go │ │ ├── css_decls_composes.go │ │ ├── css_decls_container.go │ │ ├── css_decls_font.go │ │ ├── css_decls_font_family.go │ │ ├── css_decls_font_weight.go │ │ ├── css_decls_gradient.go │ │ ├── css_decls_list_style.go │ │ ├── css_decls_transform.go │ │ ├── css_nesting.go │ │ ├── css_parser.go │ │ ├── css_parser_media.go │ │ ├── css_parser_selector.go │ │ ├── css_parser_test.go │ │ └── css_reduce_calc.go │ ├── css_printer/ │ │ ├── css_printer.go │ │ └── css_printer_test.go │ ├── fs/ │ │ ├── error_other.go │ │ ├── error_wasm+windows.go │ │ ├── filepath.go │ │ ├── fs.go │ │ ├── fs_mock.go │ │ ├── fs_mock_test.go │ │ ├── fs_real.go │ │ ├── fs_zip.go │ │ ├── iswin_other.go │ │ ├── iswin_wasm.go │ │ ├── iswin_windows.go │ │ ├── modkey_other.go │ │ └── modkey_unix.go │ ├── graph/ │ │ ├── graph.go │ │ ├── input.go │ │ └── meta.go │ ├── helpers/ │ │ ├── bitset.go │ │ ├── comment.go │ │ ├── dataurl.go │ │ ├── dataurl_test.go │ │ ├── float.go │ │ ├── glob.go │ │ ├── hash.go │ │ ├── joiner.go │ │ ├── mime.go │ │ ├── path.go │ │ ├── quote.go │ │ ├── serializer.go │ │ ├── stack.go │ │ ├── strings.go │ │ ├── timer.go │ │ ├── typos.go │ │ ├── utf.go │ │ └── waitgroup.go │ ├── js_ast/ │ │ ├── js_ast.go │ │ ├── js_ast_helpers.go │ │ ├── js_ast_test.go │ │ ├── js_ident.go │ │ └── unicode.go │ ├── js_lexer/ │ │ ├── js_lexer.go │ │ ├── js_lexer_test.go │ │ └── tables.go │ ├── js_parser/ │ │ ├── global_name_parser.go │ │ ├── js_parser.go │ │ ├── js_parser_lower.go │ │ ├── js_parser_lower_class.go │ │ ├── js_parser_lower_test.go │ │ ├── js_parser_test.go │ │ ├── json_parser.go │ │ ├── json_parser_test.go │ │ ├── sourcemap_parser.go │ │ ├── ts_parser.go │ │ └── ts_parser_test.go │ ├── js_printer/ │ │ ├── js_printer.go │ │ └── js_printer_test.go │ ├── linker/ │ │ ├── debug.go │ │ └── linker.go │ ├── logger/ │ │ ├── logger.go │ │ ├── logger_darwin.go │ │ ├── logger_linux.go │ │ ├── logger_other.go │ │ ├── logger_test.go │ │ ├── logger_windows.go │ │ └── msg_ids.go │ ├── renamer/ │ │ └── renamer.go │ ├── resolver/ │ │ ├── dataurl.go │ │ ├── package_json.go │ │ ├── resolver.go │ │ ├── testExpectations.json │ │ ├── tsconfig_json.go │ │ ├── yarnpnp.go │ │ └── yarnpnp_test.go │ ├── runtime/ │ │ ├── runtime.go │ │ └── runtime_test.go │ ├── sourcemap/ │ │ └── sourcemap.go │ ├── test/ │ │ ├── diff.go │ │ └── util.go │ └── xxhash/ │ ├── LICENSE.txt │ ├── README.md │ ├── xxhash.go │ └── xxhash_other.go ├── lib/ │ ├── README.md │ ├── deno/ │ │ ├── external.d.ts │ │ ├── mod.ts │ │ └── wasm.ts │ ├── npm/ │ │ ├── browser.ts │ │ ├── node-install.ts │ │ ├── node-platform.ts │ │ ├── node-shim.ts │ │ └── node.ts │ ├── package.json │ ├── shared/ │ │ ├── common.ts │ │ ├── stdio_protocol.ts │ │ ├── types.ts │ │ ├── uint8array_json_parser.ts │ │ └── worker.ts │ ├── tsconfig-deno.json │ ├── tsconfig-nolib.json │ └── tsconfig.json ├── npm/ │ ├── @esbuild/ │ │ ├── aix-ppc64/ │ │ │ ├── README.md │ │ │ └── package.json │ │ ├── android-arm/ │ │ │ ├── README.md │ │ │ └── package.json │ │ ├── android-arm64/ │ │ │ ├── README.md │ │ │ └── package.json │ │ ├── android-x64/ │ │ │ ├── README.md │ │ │ └── package.json │ │ ├── darwin-arm64/ │ │ │ ├── README.md │ │ │ └── package.json │ │ ├── darwin-x64/ │ │ │ ├── README.md │ │ │ └── package.json │ │ ├── freebsd-arm64/ │ │ │ ├── README.md │ │ │ └── package.json │ │ ├── freebsd-x64/ │ │ │ ├── README.md │ │ │ └── package.json │ │ ├── linux-arm/ │ │ │ ├── README.md │ │ │ └── package.json │ │ ├── linux-arm64/ │ │ │ ├── README.md │ │ │ └── package.json │ │ ├── linux-ia32/ │ │ │ ├── README.md │ │ │ └── package.json │ │ ├── linux-loong64/ │ │ │ ├── README.md │ │ │ └── package.json │ │ ├── linux-mips64el/ │ │ │ ├── README.md │ │ │ └── package.json │ │ ├── linux-ppc64/ │ │ │ ├── README.md │ │ │ └── package.json │ │ ├── linux-riscv64/ │ │ │ ├── README.md │ │ │ └── package.json │ │ ├── linux-s390x/ │ │ │ ├── README.md │ │ │ └── package.json │ │ ├── linux-x64/ │ │ │ ├── README.md │ │ │ └── package.json │ │ ├── netbsd-arm64/ │ │ │ ├── README.md │ │ │ └── package.json │ │ ├── netbsd-x64/ │ │ │ ├── README.md │ │ │ └── package.json │ │ ├── openbsd-arm64/ │ │ │ ├── README.md │ │ │ └── package.json │ │ ├── openbsd-x64/ │ │ │ ├── README.md │ │ │ └── package.json │ │ ├── openharmony-arm64/ │ │ │ ├── README.md │ │ │ └── package.json │ │ ├── sunos-x64/ │ │ │ ├── README.md │ │ │ └── package.json │ │ ├── wasi-preview1/ │ │ │ ├── README.md │ │ │ └── package.json │ │ ├── win32-arm64/ │ │ │ ├── README.md │ │ │ └── package.json │ │ ├── win32-ia32/ │ │ │ ├── README.md │ │ │ └── package.json │ │ └── win32-x64/ │ │ ├── README.md │ │ └── package.json │ ├── esbuild/ │ │ ├── LICENSE.md │ │ ├── README.md │ │ └── package.json │ └── esbuild-wasm/ │ ├── LICENSE.md │ ├── README.md │ └── package.json ├── pkg/ │ ├── api/ │ │ ├── api.go │ │ ├── api_impl.go │ │ ├── api_impl_test.go │ │ ├── api_js_table.go │ │ ├── api_test.go │ │ ├── favicon.go │ │ ├── serve_other.go │ │ ├── serve_wasm.go │ │ └── watcher.go │ └── cli/ │ ├── cli.go │ ├── cli_impl.go │ ├── cli_js_table.go │ └── mangle_cache.go ├── require/ │ ├── old-ts/ │ │ ├── README.md │ │ └── package.json │ ├── parcel2/ │ │ ├── .terserrc │ │ └── package.json │ ├── rollup/ │ │ └── package.json │ ├── webpack5/ │ │ └── package.json │ └── yarnpnp/ │ ├── .gitignore │ ├── bar/ │ │ └── index.js │ ├── foo/ │ │ ├── index.js │ │ └── package.json │ ├── in.mjs │ ├── package.json │ └── tsconfig.json ├── scripts/ │ ├── browser/ │ │ ├── browser-tests.js │ │ ├── index.html │ │ └── package.json │ ├── dataurl-escapes.html │ ├── decorator-tests.js │ ├── decorator-tests.ts │ ├── deno-tests.js │ ├── destructuring-fuzzer.js │ ├── end-to-end-tests.js │ ├── esbuild.js │ ├── gen-unicode-table.js │ ├── gradient-tests.css │ ├── gradient-tests.html │ ├── graph-debugger.html │ ├── js-api-tests.js │ ├── node-unref-tests.js │ ├── package.json │ ├── parse-ts-files.js │ ├── plugin-tests.js │ ├── register-test.js │ ├── terser-tests.js │ ├── test-yarnpnp.js │ ├── test262-async.js │ ├── test262.js │ ├── try.html │ ├── ts-type-tests.js │ ├── tsconfig.json │ ├── uglify-tests.js │ ├── verify-source-map.js │ └── wasm-tests.js ├── staticcheck.conf └── version.txt
Showing preview only (2,176K chars total). Download the full file or copy to clipboard to get everything.
SYMBOL INDEX (6848 symbols across 183 files)
FILE: cmd/esbuild/main.go
function main (line 159) | func main() {
FILE: cmd/esbuild/main_other.go
function createTraceFile (line 15) | func createTraceFile(osArgs []string, traceFile string) func() {
function createHeapFile (line 29) | func createHeapFile(osArgs []string, heapFile string) func() {
function createCpuprofileFile (line 45) | func createCpuprofileFile(osArgs []string, cpuprofileFile string) func() {
function isServeUnsupported (line 59) | func isServeUnsupported() bool {
FILE: cmd/esbuild/main_wasm.go
function createTraceFile (line 12) | func createTraceFile(osArgs []string, traceFile string) func() {
function createHeapFile (line 17) | func createHeapFile(osArgs []string, heapFile string) func() {
function createCpuprofileFile (line 22) | func createCpuprofileFile(osArgs []string, cpuprofileFile string) func() {
function isServeUnsupported (line 27) | func isServeUnsupported() bool {
FILE: cmd/esbuild/service.go
type responseCallback (line 27) | type responseCallback
type pluginResolveCallback (line 28) | type pluginResolveCallback
type activeBuild (line 30) | type activeBuild struct
type serviceType (line 42) | type serviceType struct
method getActiveBuild (line 51) | func (service *serviceType) getActiveBuild(key int) *activeBuild {
method createActiveBuild (line 58) | func (service *serviceType) createActiveBuild(key int) *activeBuild {
method destroyActiveBuild (line 72) | func (service *serviceType) destroyActiveBuild(key int) {
method sendPacket (line 163) | func (service *serviceType) sendPacket(packet []byte) {
method sendRequest (line 171) | func (service *serviceType) sendRequest(request interface{}) interface...
method handleIncomingPacket (line 203) | func (service *serviceType) handleIncomingPacket(bytes []byte) {
method handleBuildRequest (line 597) | func (service *serviceType) handleBuildRequest(id uint32, request map[...
method convertPlugins (line 848) | func (service *serviceType) convertPlugins(key int, jsPlugins interfac...
method handleTransformRequest (line 1154) | func (service *serviceType) handleTransformRequest(id uint32, request ...
method handleFormatMessagesRequest (line 1228) | func (service *serviceType) handleFormatMessagesRequest(id uint32, req...
method handleAnalyzeMetafileRequest (line 1254) | func (service *serviceType) handleAnalyzeMetafileRequest(id uint32, re...
function runService (line 84) | func runService(sendPings bool) {
function encodeErrorPacket (line 588) | func encodeErrorPacket(id uint32, err error) []byte {
function resolveKindToString (line 793) | func resolveKindToString(kind api.ResolveKind) string {
function stringToResolveKind (line 821) | func stringToResolveKind(kind string) (api.ResolveKind, bool) {
function encodeStringArray (line 1275) | func encodeStringArray(strings []string) []interface{} {
function decodeStringArray (line 1283) | func decodeStringArray(values []interface{}) []string {
function encodeOutputFiles (line 1291) | func encodeOutputFiles(outputFiles []api.OutputFile) []interface{} {
function encodeLocation (line 1303) | func encodeLocation(loc *api.Location) interface{} {
function encodeMessages (line 1318) | func encodeMessages(msgs []api.Message) []interface{} {
function decodeLocation (line 1348) | func decodeLocation(value interface{}) *api.Location {
function decodeMessages (line 1368) | func decodeMessages(values []interface{}) []api.Message {
function decodeLocationToPrivate (line 1391) | func decodeLocationToPrivate(value interface{}) *logger.MsgLocation {
function decodeMessageToPrivate (line 1412) | func decodeMessageToPrivate(obj map[string]interface{}) logger.Msg {
FILE: cmd/esbuild/stdio_protocol.go
function readUint32 (line 14) | func readUint32(bytes []byte) (value uint32, leftOver []byte, ok bool) {
function writeUint32 (line 22) | func writeUint32(bytes []byte, value uint32) []byte {
function readLengthPrefixedSlice (line 28) | func readLengthPrefixedSlice(bytes []byte) (slice []byte, leftOver []byt...
type packet (line 36) | type packet struct
function encodePacket (line 42) | func encodePacket(p packet) []byte {
function decodePacket (line 110) | func decodePacket(bytes []byte) (packet, bool) {
FILE: cmd/esbuild/version.go
constant esbuildVersion (line 3) | esbuildVersion = "0.27.4"
FILE: compat-table/src/caniuse.ts
type StatusCode (line 6) | const enum StatusCode {
FILE: compat-table/src/compat-table.ts
type Test (line 139) | interface Test {
FILE: compat-table/src/index.ts
type Engine (line 12) | type Engine = keyof typeof engines
type JSFeature (line 28) | type JSFeature = keyof typeof jsFeatures
type CSSFeature (line 93) | type CSSFeature = keyof typeof cssFeatures
type CSSProperty (line 110) | type CSSProperty = keyof typeof cssProperties
type Support (line 147) | interface Support {
type VersionRange (line 153) | interface VersionRange {
type PrefixData (line 158) | interface PrefixData {
type SupportMap (line 164) | type SupportMap<F extends string> = Record<F, Partial<Record<Engine, Rec...
type VersionRangeMap (line 165) | type VersionRangeMap<F extends string> = Partial<Record<F, Partial<Recor...
type WhyNotMap (line 166) | type WhyNotMap<F extends string> = Partial<Record<F, Partial<Record<Engi...
type CSSPrefixMap (line 167) | type CSSPrefixMap = Partial<Record<CSSProperty, PrefixData[]>>
FILE: compat-table/src/mdn.ts
type PrefixRange (line 208) | type PrefixRange = { prefix: string, start: string, end?: string }
FILE: internal/ast/ast.go
type ImportKind (line 15) | type ImportKind
method StringForMetafile (line 43) | func (kind ImportKind) StringForMetafile() string {
method IsFromCSS (line 66) | func (kind ImportKind) IsFromCSS() bool {
method MustResolveToCSS (line 74) | func (kind ImportKind) MustResolveToCSS() bool {
constant ImportEntryPoint (line 19) | ImportEntryPoint ImportKind = iota
constant ImportStmt (line 22) | ImportStmt
constant ImportRequire (line 25) | ImportRequire
constant ImportDynamic (line 28) | ImportDynamic
constant ImportRequireResolve (line 31) | ImportRequireResolve
constant ImportAt (line 34) | ImportAt
constant ImportComposesFrom (line 37) | ImportComposesFrom
constant ImportURL (line 40) | ImportURL
type ImportPhase (line 82) | type ImportPhase
constant EvaluationPhase (line 85) | EvaluationPhase ImportPhase = iota
constant DeferPhase (line 88) | DeferPhase
constant SourcePhase (line 91) | SourcePhase
type ImportRecordFlags (line 94) | type ImportRecordFlags
method Has (line 160) | func (flags ImportRecordFlags) Has(flag ImportRecordFlags) bool {
constant IsUnused (line 100) | IsUnused ImportRecordFlags = 1 << iota
constant ContainsImportStar (line 105) | ContainsImportStar
constant ContainsDefaultAlias (line 109) | ContainsDefaultAlias
constant ContainsESModuleAlias (line 113) | ContainsESModuleAlias
constant CallsRunTimeReExportFn (line 117) | CallsRunTimeReExportFn
constant WrapWithToESM (line 120) | WrapWithToESM
constant WrapWithToCJS (line 123) | WrapWithToCJS
constant CallRuntimeRequire (line 126) | CallRuntimeRequire
constant HandlesImportErrors (line 138) | HandlesImportErrors
constant WasOriginallyBareImport (line 141) | WasOriginallyBareImport
constant IsExternalWithoutSideEffects (line 144) | IsExternalWithoutSideEffects
constant AssertTypeJSON (line 147) | AssertTypeJSON
constant ShouldNotBeExternalInMetafile (line 150) | ShouldNotBeExternalInMetafile
constant WasLoadedWithEmptyLoader (line 153) | WasLoadedWithEmptyLoader
constant ContainsUniqueKey (line 157) | ContainsUniqueKey
type ImportRecord (line 164) | type ImportRecord struct
type AssertOrWithKeyword (line 187) | type AssertOrWithKeyword
method String (line 194) | func (kw AssertOrWithKeyword) String() string {
constant AssertKeyword (line 190) | AssertKeyword AssertOrWithKeyword = iota
constant WithKeyword (line 191) | WithKeyword
type ImportAssertOrWith (line 201) | type ImportAssertOrWith struct
type AssertOrWithEntry (line 211) | type AssertOrWithEntry struct
function FindAssertOrWithEntry (line 219) | func FindAssertOrWithEntry(assertions []AssertOrWithEntry, name string) ...
type GlobPattern (line 228) | type GlobPattern struct
type Index32 (line 237) | type Index32 struct
method IsValid (line 245) | func (i Index32) IsValid() bool {
method GetIndex (line 249) | func (i Index32) GetIndex() uint32 {
function MakeIndex32 (line 241) | func MakeIndex32(index uint32) Index32 {
type SymbolKind (line 253) | type SymbolKind
method IsPrivate (line 352) | func (kind SymbolKind) IsPrivate() bool {
method IsHoisted (line 356) | func (kind SymbolKind) IsHoisted() bool {
method IsHoistedOrFunction (line 360) | func (kind SymbolKind) IsHoistedOrFunction() bool {
method IsFunction (line 364) | func (kind SymbolKind) IsFunction() bool {
method IsUnboundOrInjected (line 368) | func (kind SymbolKind) IsUnboundOrInjected() bool {
constant SymbolUnbound (line 258) | SymbolUnbound SymbolKind = iota
constant SymbolHoisted (line 269) | SymbolHoisted
constant SymbolHoistedFunction (line 270) | SymbolHoistedFunction
constant SymbolCatchIdentifier (line 290) | SymbolCatchIdentifier
constant SymbolGeneratorOrAsyncFunction (line 295) | SymbolGeneratorOrAsyncFunction
constant SymbolArguments (line 298) | SymbolArguments
constant SymbolClass (line 301) | SymbolClass
constant SymbolClassInComputedPropertyKey (line 304) | SymbolClassInComputedPropertyKey
constant SymbolPrivateField (line 307) | SymbolPrivateField
constant SymbolPrivateMethod (line 308) | SymbolPrivateMethod
constant SymbolPrivateGet (line 309) | SymbolPrivateGet
constant SymbolPrivateSet (line 310) | SymbolPrivateSet
constant SymbolPrivateGetSetPair (line 311) | SymbolPrivateGetSetPair
constant SymbolPrivateStaticField (line 312) | SymbolPrivateStaticField
constant SymbolPrivateStaticMethod (line 313) | SymbolPrivateStaticMethod
constant SymbolPrivateStaticGet (line 314) | SymbolPrivateStaticGet
constant SymbolPrivateStaticSet (line 315) | SymbolPrivateStaticSet
constant SymbolPrivateStaticGetSetPair (line 316) | SymbolPrivateStaticGetSetPair
constant SymbolLabel (line 319) | SymbolLabel
constant SymbolTSEnum (line 323) | SymbolTSEnum
constant SymbolTSNamespace (line 327) | SymbolTSNamespace
constant SymbolImport (line 331) | SymbolImport
constant SymbolConst (line 334) | SymbolConst
constant SymbolInjected (line 337) | SymbolInjected
constant SymbolMangledProp (line 340) | SymbolMangledProp
constant SymbolGlobalCSS (line 343) | SymbolGlobalCSS
constant SymbolLocalCSS (line 346) | SymbolLocalCSS
constant SymbolOther (line 349) | SymbolOther
type Ref (line 385) | type Ref struct
type LocRef (line 390) | type LocRef struct
type ImportItemStatus (line 395) | type ImportItemStatus
constant ImportItemNone (line 398) | ImportItemNone ImportItemStatus = iota
constant ImportItemGenerated (line 401) | ImportItemGenerated
constant ImportItemMissing (line 404) | ImportItemMissing
type SymbolFlags (line 407) | type SymbolFlags
method Has (line 514) | func (flags SymbolFlags) Has(flag SymbolFlags) bool {
constant MustNotBeRenamed (line 413) | MustNotBeRenamed SymbolFlags = 1 << iota
constant MustStartWithCapitalLetterForJSX (line 420) | MustStartWithCapitalLetterForJSX
constant DidKeepName (line 427) | DidKeepName
constant PrivateSymbolMustBeLowered (line 480) | PrivateSymbolMustBeLowered
constant RemoveOverwrittenFunctionDeclaration (line 488) | RemoveOverwrittenFunctionDeclaration
constant DidWarnAboutCommonJSInESM (line 492) | DidWarnAboutCommonJSInESM
constant CouldPotentiallyBeMutated (line 496) | CouldPotentiallyBeMutated
constant WasExported (line 500) | WasExported
constant IsEmptyFunction (line 503) | IsEmptyFunction
constant IsIdentityFunction (line 507) | IsIdentityFunction
constant CallCanBeUnwrappedIfUnused (line 511) | CallCanBeUnwrappedIfUnused
type Symbol (line 519) | type Symbol struct
method MergeContentsWith (line 593) | func (newSymbol *Symbol) MergeContentsWith(oldSymbol *Symbol) {
method SlotNamespace (line 614) | func (s *Symbol) SlotNamespace() SlotNamespace {
type SlotNamespace (line 604) | type SlotNamespace
constant SlotDefault (line 607) | SlotDefault SlotNamespace = iota
constant SlotLabel (line 608) | SlotLabel
constant SlotPrivateName (line 609) | SlotPrivateName
constant SlotMangledProp (line 610) | SlotMangledProp
constant SlotMustNotBeRenamed (line 611) | SlotMustNotBeRenamed
type SlotCounts (line 630) | type SlotCounts
method UnionMax (line 632) | func (a *SlotCounts) UnionMax(b SlotCounts) {
type NamespaceAlias (line 642) | type NamespaceAlias struct
type SymbolMap (line 647) | type SymbolMap struct
method Get (line 662) | func (sm SymbolMap) Get(ref Ref) *Symbol {
function NewSymbolMap (line 658) | func NewSymbolMap(sourceCount int) SymbolMap {
function FollowSymbols (line 669) | func FollowSymbols(symbols SymbolMap, ref Ref) Ref {
function FollowAllSymbols (line 689) | func FollowAllSymbols(symbols SymbolMap) {
function MergeSymbols (line 700) | func MergeSymbols(symbols SymbolMap, old Ref, new Ref) Ref {
type CharFreq (line 723) | type CharFreq
method Scan (line 725) | func (freq *CharFreq) Scan(text string, delta int32) {
method Include (line 748) | func (freq *CharFreq) Include(other *CharFreq) {
type NameMinifier (line 754) | type NameMinifier struct
method ShuffleByCharFreq (line 787) | func (source NameMinifier) ShuffleByCharFreq(freq CharFreq) NameMinifi...
method NumberToMinifiedName (line 810) | func (minifier NameMinifier) NumberToMinifiedName(i int) string {
type charAndCount (line 769) | type charAndCount struct
type charAndCountArray (line 776) | type charAndCountArray
method Len (line 778) | func (a charAndCountArray) Len() int { return len(a) }
method Swap (line 779) | func (a charAndCountArray) Swap(i int, j int) { a[i], a[j] = a[j], a[i] }
method Less (line 781) | func (a charAndCountArray) Less(i int, j int) bool {
FILE: internal/bundler/bundler.go
type scannerFile (line 43) | type scannerFile struct
type DataForSourceMap (line 56) | type DataForSourceMap struct
type Bundle (line 68) | type Bundle struct
method Compile (line 3009) | func (b *Bundle) Compile(log logger.Log, timer *helpers.Timer, mangleC...
method computeDataForSourceMapsInParallel (line 3213) | func (b *Bundle) computeDataForSourceMapsInParallel(options *config.Op...
method generateMetadataJSON (line 3276) | func (b *Bundle) generateMetadataJSON(results []graph.OutputFile, allR...
type parseArgs (line 82) | type parseArgs struct
type parseResult (line 102) | type parseResult struct
type globResolveResult (line 110) | type globResolveResult struct
type tlaCheck (line 117) | type tlaCheck struct
function parseFile (line 123) | func parseFile(args parseArgs) {
function reportExplicitPhaseImport (line 775) | func reportExplicitPhaseImport(
function ResolveFailureErrorTextSuggestionNotes (line 799) | func ResolveFailureErrorTextSuggestionNotes(
function isASCIIOnly (line 880) | func isASCIIOnly(text string) bool {
function guessMimeType (line 889) | func guessMimeType(extension string, contents string) string {
function extractSourceMapFromComment (line 899) | func extractSourceMapFromComment(
function sanitizeLocation (line 978) | func sanitizeLocation(fs fs.FS, loc *logger.MsgLocation) {
function logPluginMessages (line 989) | func logPluginMessages(
function RunOnResolvePlugins (line 1048) | func RunOnResolvePlugins(
type loaderPluginResult (line 1171) | type loaderPluginResult struct
function runOnLoadPlugins (line 1178) | func runOnLoadPlugins(
function canonicalFileSystemPathForWindows (line 1312) | func canonicalFileSystemPathForWindows(absPath string) string {
function HashForFileName (line 1316) | func HashForFileName(hashBytes []byte) string {
type scanner (line 1320) | type scanner struct
method maybeParseFile (line 1536) | func (s *scanner) maybeParseFile(
method allocateSourceIndex (line 1653) | func (s *scanner) allocateSourceIndex(path logger.Path, kind cache.Sou...
method allocateGlobSourceIndex (line 1673) | func (s *scanner) allocateGlobSourceIndex(parentSourceIndex uint32, gl...
method preprocessInjectedFiles (line 1693) | func (s *scanner) preprocessInjectedFiles() {
method addEntryPoints (line 1838) | func (s *scanner) addEntryPoints(entryPoints []EntryPoint) []graph.Ent...
method scanAllDependencies (line 2172) | func (s *scanner) scanAllDependencies() {
method generateResultForGlobResolve (line 2248) | func (s *scanner) generateResultForGlobResolve(
method processScannedFiles (line 2357) | func (s *scanner) processScannedFiles(entryPointMeta []graph.EntryPoin...
method validateTLA (line 2824) | func (s *scanner) validateTLA(sourceIndex uint32) tlaCheck {
type visitedFile (line 1341) | type visitedFile struct
type EntryPoint (line 1345) | type EntryPoint struct
function generateUniqueKeyPrefix (line 1351) | func generateUniqueKeyPrefix() (string, error) {
function ScanBundle (line 1367) | func ScanBundle(
type inputKind (line 1527) | type inputKind
constant inputKindNormal (line 1530) | inputKindNormal inputKind = iota
constant inputKindEntryPoint (line 1531) | inputKindEntryPoint
constant inputKindStdin (line 1532) | inputKindStdin
function lowestCommonAncestorDirectory (line 2115) | func lowestCommonAncestorDirectory(fs fs.FS, entryPoints []graph.EntryPo...
function DefaultExtensionToLoaderMap (line 2913) | func DefaultExtensionToLoaderMap() map[string]config.Loader {
function applyOptionDefaults (line 2931) | func applyOptionDefaults(options *config.Options) {
function fixInvalidUnsupportedJSFeatureOverrides (line 2987) | func fixInvalidUnsupportedJSFeatureOverrides(options *config.Options, im...
type Linker (line 2996) | type Linker
function findReachableFiles (line 3164) | func findReachableFiles(files []graph.InputFile, entryPoints []graph.Ent...
type runtimeCacheKey (line 3327) | type runtimeCacheKey struct
type runtimeCache (line 3333) | type runtimeCache struct
method parseRuntime (line 3340) | func (cache *runtimeCache) parseRuntime(options *config.Options) (sour...
function PathRelativeToOutbase (line 3398) | func PathRelativeToOutbase(
function sanitizeFilePathForVirtualModulePath (line 3487) | func sanitizeFilePathForVirtualModulePath(path string) string {
FILE: internal/bundler_tests/bundler_css_test.go
function TestCSSEntryPoint (line 14) | func TestCSSEntryPoint(t *testing.T) {
function TestCSSAtImportMissing (line 31) | func TestCSSAtImportMissing(t *testing.T) {
function TestCSSAtImportExternal (line 48) | func TestCSSAtImportExternal(t *testing.T) {
function TestCSSAtImport (line 99) | func TestCSSAtImport(t *testing.T) {
function TestCSSFromJSMissingImport (line 127) | func TestCSSFromJSMissingImport(t *testing.T) {
function TestCSSFromJSMissingStarImport (line 148) | func TestCSSFromJSMissingStarImport(t *testing.T) {
function TestImportGlobalCSSFromJS (line 169) | func TestImportGlobalCSSFromJS(t *testing.T) {
function TestImportLocalCSSFromJS (line 202) | func TestImportLocalCSSFromJS(t *testing.T) {
function TestImportLocalCSSFromJSMinifyIdentifiers (line 238) | func TestImportLocalCSSFromJSMinifyIdentifiers(t *testing.T) {
function TestImportLocalCSSFromJSMinifyIdentifiersAvoidGlobalNames (line 275) | func TestImportLocalCSSFromJSMinifyIdentifiersAvoidGlobalNames(t *testin...
function TestImportLocalCSSFromJSMinifyIdentifiersMultipleEntryPoints (line 306) | func TestImportLocalCSSFromJSMinifyIdentifiersMultipleEntryPoints(t *tes...
function TestImportCSSFromJSLocalVsGlobal (line 335) | func TestImportCSSFromJSLocalVsGlobal(t *testing.T) {
function TestImportCSSFromJSLowerBareLocalAndGlobal (line 427) | func TestImportCSSFromJSLowerBareLocalAndGlobal(t *testing.T) {
function TestImportCSSFromJSLocalAtKeyframes (line 466) | func TestImportCSSFromJSLocalAtKeyframes(t *testing.T) {
function TestImportCSSFromJSLocalAtCounterStyle (line 507) | func TestImportCSSFromJSLocalAtCounterStyle(t *testing.T) {
function TestImportCSSFromJSLocalAtContainer (line 586) | func TestImportCSSFromJSLocalAtContainer(t *testing.T) {
function TestImportCSSFromJSNthIndexLocal (line 631) | func TestImportCSSFromJSNthIndexLocal(t *testing.T) {
function TestImportCSSFromJSComposes (line 663) | func TestImportCSSFromJSComposes(t *testing.T) {
function TestImportCSSFromJSComposesFromMissingImport (line 744) | func TestImportCSSFromJSComposesFromMissingImport(t *testing.T) {
function TestImportCSSFromJSComposesFromNotCSS (line 794) | func TestImportCSSFromJSComposesFromNotCSS(t *testing.T) {
function TestImportCSSFromJSComposesCircular (line 828) | func TestImportCSSFromJSComposesCircular(t *testing.T) {
function TestImportCSSFromJSComposesFromCircular (line 859) | func TestImportCSSFromJSComposesFromCircular(t *testing.T) {
function TestImportCSSFromJSComposesFromUndefined (line 892) | func TestImportCSSFromJSComposesFromUndefined(t *testing.T) {
function TestImportCSSFromJSWriteToStdout (line 987) | func TestImportCSSFromJSWriteToStdout(t *testing.T) {
function TestImportJSFromCSS (line 1007) | func TestImportJSFromCSS(t *testing.T) {
function TestImportJSONFromCSS (line 1028) | func TestImportJSONFromCSS(t *testing.T) {
function TestMissingImportURLInCSS (line 1049) | func TestMissingImportURLInCSS(t *testing.T) {
function TestExternalImportURLInCSS (line 1068) | func TestExternalImportURLInCSS(t *testing.T) {
function TestInvalidImportURLInCSS (line 1098) | func TestInvalidImportURLInCSS(t *testing.T) {
function TestTextImportURLInCSSText (line 1139) | func TestTextImportURLInCSSText(t *testing.T) {
function TestDataURLImportURLInCSS (line 1157) | func TestDataURLImportURLInCSS(t *testing.T) {
function TestBinaryImportURLInCSS (line 1179) | func TestBinaryImportURLInCSS(t *testing.T) {
function TestBase64ImportURLInCSS (line 1201) | func TestBase64ImportURLInCSS(t *testing.T) {
function TestFileImportURLInCSS (line 1223) | func TestFileImportURLInCSS(t *testing.T) {
function TestIgnoreURLsInAtRulePrelude (line 1250) | func TestIgnoreURLsInAtRulePrelude(t *testing.T) {
function TestPackageURLsInCSS (line 1268) | func TestPackageURLsInCSS(t *testing.T) {
function TestCSSAtImportExtensionOrderCollision (line 1296) | func TestCSSAtImportExtensionOrderCollision(t *testing.T) {
function TestCSSAtImportExtensionOrderCollisionUnsupported (line 1317) | func TestCSSAtImportExtensionOrderCollisionUnsupported(t *testing.T) {
function TestCSSAtImportConditionsNoBundle (line 1340) | func TestCSSAtImportConditionsNoBundle(t *testing.T) {
function TestCSSAtImportConditionsBundleExternal (line 1353) | func TestCSSAtImportConditionsBundleExternal(t *testing.T) {
function TestCSSAtImportConditionsBundleExternalConditionWithURL (line 1366) | func TestCSSAtImportConditionsBundleExternalConditionWithURL(t *testing....
function TestCSSAtImportConditionsBundle (line 1381) | func TestCSSAtImportConditionsBundle(t *testing.T) {
function TestCSSAtImportConditionsWithImportRecordsBundle (line 1438) | func TestCSSAtImportConditionsWithImportRecordsBundle(t *testing.T) {
function TestCSSAtImportConditionsFromExternalRepo (line 1471) | func TestCSSAtImportConditionsFromExternalRepo(t *testing.T) {
function TestCSSAtImportConditionsAtLayerBundle (line 1808) | func TestCSSAtImportConditionsAtLayerBundle(t *testing.T) {
function TestCSSAtImportConditionsAtLayerBundleAlternatingLayerInFile (line 1870) | func TestCSSAtImportConditionsAtLayerBundleAlternatingLayerInFile(t *tes...
function TestCSSAtImportConditionsAtLayerBundleAlternatingLayerOnImport (line 1937) | func TestCSSAtImportConditionsAtLayerBundleAlternatingLayerOnImport(t *t...
function TestCSSAtImportConditionsChainExternal (line 2004) | func TestCSSAtImportConditionsChainExternal(t *testing.T) {
function TestCSSAndJavaScriptCodeSplittingIssue1064 (line 2029) | func TestCSSAndJavaScriptCodeSplittingIssue1064(t *testing.T) {
function TestCSSExternalQueryAndHashNoMatchIssue1822 (line 2070) | func TestCSSExternalQueryAndHashNoMatchIssue1822(t *testing.T) {
function TestCSSExternalQueryAndHashMatchIssue1822 (line 2096) | func TestCSSExternalQueryAndHashMatchIssue1822(t *testing.T) {
function TestCSSNestingOldBrowser (line 2118) | func TestCSSNestingOldBrowser(t *testing.T) {
function TestMetafileCSSBundleTwoToOne (line 2229) | func TestMetafileCSSBundleTwoToOne(t *testing.T) {
function TestDeduplicateRules (line 2261) | func TestDeduplicateRules(t *testing.T) {
function TestDeduplicateRulesGlobalVsLocalNames (line 2314) | func TestDeduplicateRulesGlobalVsLocalNames(t *testing.T) {
function TestUndefinedImportWarningCSS (line 2362) | func TestUndefinedImportWarningCSS(t *testing.T) {
function TestCSSMalformedAtImport (line 2462) | func TestCSSMalformedAtImport(t *testing.T) {
function TestCSSAtLayerBeforeImportNoBundle (line 2499) | func TestCSSAtLayerBeforeImportNoBundle(t *testing.T) {
function TestCSSAtLayerBeforeImportBundle (line 2517) | func TestCSSAtLayerBeforeImportBundle(t *testing.T) {
function TestCSSAtLayerMergingWithImportConditions (line 2545) | func TestCSSAtLayerMergingWithImportConditions(t *testing.T) {
function TestCSSCaseInsensitivity (line 2579) | func TestCSSCaseInsensitivity(t *testing.T) {
function TestCSSAssetPathsWithSpacesBundle (line 2621) | func TestCSSAssetPathsWithSpacesBundle(t *testing.T) {
FILE: internal/bundler_tests/bundler_dce_test.go
function TestPackageJsonSideEffectsFalseKeepNamedImportES6 (line 15) | func TestPackageJsonSideEffectsFalseKeepNamedImportES6(t *testing.T) {
function TestPackageJsonSideEffectsFalseKeepNamedImportCommonJS (line 40) | func TestPackageJsonSideEffectsFalseKeepNamedImportCommonJS(t *testing.T) {
function TestPackageJsonSideEffectsFalseKeepStarImportES6 (line 65) | func TestPackageJsonSideEffectsFalseKeepStarImportES6(t *testing.T) {
function TestPackageJsonSideEffectsFalseKeepStarImportCommonJS (line 90) | func TestPackageJsonSideEffectsFalseKeepStarImportCommonJS(t *testing.T) {
function TestPackageJsonSideEffectsTrueKeepES6 (line 115) | func TestPackageJsonSideEffectsTrueKeepES6(t *testing.T) {
function TestPackageJsonSideEffectsTrueKeepCommonJS (line 140) | func TestPackageJsonSideEffectsTrueKeepCommonJS(t *testing.T) {
function TestPackageJsonSideEffectsFalseKeepBareImportAndRequireES6 (line 165) | func TestPackageJsonSideEffectsFalseKeepBareImportAndRequireES6(t *testi...
function TestPackageJsonSideEffectsFalseKeepBareImportAndRequireCommonJS (line 194) | func TestPackageJsonSideEffectsFalseKeepBareImportAndRequireCommonJS(t *...
function TestPackageJsonSideEffectsFalseRemoveBareImportES6 (line 223) | func TestPackageJsonSideEffectsFalseRemoveBareImportES6(t *testing.T) {
function TestPackageJsonSideEffectsFalseRemoveBareImportCommonJS (line 251) | func TestPackageJsonSideEffectsFalseRemoveBareImportCommonJS(t *testing....
function TestPackageJsonSideEffectsFalseRemoveNamedImportES6 (line 279) | func TestPackageJsonSideEffectsFalseRemoveNamedImportES6(t *testing.T) {
function TestPackageJsonSideEffectsFalseRemoveNamedImportCommonJS (line 304) | func TestPackageJsonSideEffectsFalseRemoveNamedImportCommonJS(t *testing...
function TestPackageJsonSideEffectsFalseRemoveStarImportES6 (line 329) | func TestPackageJsonSideEffectsFalseRemoveStarImportES6(t *testing.T) {
function TestPackageJsonSideEffectsFalseRemoveStarImportCommonJS (line 354) | func TestPackageJsonSideEffectsFalseRemoveStarImportCommonJS(t *testing....
function TestPackageJsonSideEffectsArrayRemove (line 379) | func TestPackageJsonSideEffectsArrayRemove(t *testing.T) {
function TestPackageJsonSideEffectsArrayKeep (line 404) | func TestPackageJsonSideEffectsArrayKeep(t *testing.T) {
function TestPackageJsonSideEffectsArrayKeepMainUseModule (line 429) | func TestPackageJsonSideEffectsArrayKeepMainUseModule(t *testing.T) {
function TestPackageJsonSideEffectsArrayKeepMainUseMain (line 461) | func TestPackageJsonSideEffectsArrayKeepMainUseMain(t *testing.T) {
function TestPackageJsonSideEffectsArrayKeepMainImplicitModule (line 493) | func TestPackageJsonSideEffectsArrayKeepMainImplicitModule(t *testing.T) {
function TestPackageJsonSideEffectsArrayKeepMainImplicitMain (line 524) | func TestPackageJsonSideEffectsArrayKeepMainImplicitMain(t *testing.T) {
function TestPackageJsonSideEffectsArrayKeepModuleUseModule (line 560) | func TestPackageJsonSideEffectsArrayKeepModuleUseModule(t *testing.T) {
function TestPackageJsonSideEffectsArrayKeepModuleUseMain (line 592) | func TestPackageJsonSideEffectsArrayKeepModuleUseMain(t *testing.T) {
function TestPackageJsonSideEffectsArrayKeepModuleImplicitModule (line 624) | func TestPackageJsonSideEffectsArrayKeepModuleImplicitModule(t *testing....
function TestPackageJsonSideEffectsArrayKeepModuleImplicitMain (line 655) | func TestPackageJsonSideEffectsArrayKeepModuleImplicitMain(t *testing.T) {
function TestPackageJsonSideEffectsArrayGlob (line 691) | func TestPackageJsonSideEffectsArrayGlob(t *testing.T) {
function TestPackageJsonSideEffectsNestedDirectoryRemove (line 725) | func TestPackageJsonSideEffectsNestedDirectoryRemove(t *testing.T) {
function TestPackageJsonSideEffectsKeepExportDefaultExpr (line 750) | func TestPackageJsonSideEffectsKeepExportDefaultExpr(t *testing.T) {
function TestPackageJsonSideEffectsFalseNoWarningInNodeModulesIssue999 (line 774) | func TestPackageJsonSideEffectsFalseNoWarningInNodeModulesIssue999(t *te...
function TestPackageJsonSideEffectsFalseIntermediateFilesUnused (line 803) | func TestPackageJsonSideEffectsFalseIntermediateFilesUnused(t *testing.T) {
function TestPackageJsonSideEffectsFalseIntermediateFilesUsed (line 828) | func TestPackageJsonSideEffectsFalseIntermediateFilesUsed(t *testing.T) {
function TestPackageJsonSideEffectsFalseIntermediateFilesChainAll (line 854) | func TestPackageJsonSideEffectsFalseIntermediateFilesChainAll(t *testing...
function TestPackageJsonSideEffectsFalseIntermediateFilesChainOne (line 895) | func TestPackageJsonSideEffectsFalseIntermediateFilesChainOne(t *testing...
function TestPackageJsonSideEffectsFalseIntermediateFilesDiamond (line 927) | func TestPackageJsonSideEffectsFalseIntermediateFilesDiamond(t *testing....
function TestPackageJsonSideEffectsFalseOneFork (line 967) | func TestPackageJsonSideEffectsFalseOneFork(t *testing.T) {
function TestPackageJsonSideEffectsFalseAllFork (line 999) | func TestPackageJsonSideEffectsFalseAllFork(t *testing.T) {
function TestJSONLoaderRemoveUnused (line 1037) | func TestJSONLoaderRemoveUnused(t *testing.T) {
function TestTextLoaderRemoveUnused (line 1054) | func TestTextLoaderRemoveUnused(t *testing.T) {
function TestBase64LoaderRemoveUnused (line 1071) | func TestBase64LoaderRemoveUnused(t *testing.T) {
function TestDataURLLoaderRemoveUnused (line 1092) | func TestDataURLLoaderRemoveUnused(t *testing.T) {
function TestFileLoaderRemoveUnused (line 1113) | func TestFileLoaderRemoveUnused(t *testing.T) {
function TestRemoveUnusedImportMeta (line 1134) | func TestRemoveUnusedImportMeta(t *testing.T) {
function TestRemoveUnusedPureCommentCalls (line 1152) | func TestRemoveUnusedPureCommentCalls(t *testing.T) {
function TestRemoveUnusedNoSideEffectsTaggedTemplates (line 1225) | func TestRemoveUnusedNoSideEffectsTaggedTemplates(t *testing.T) {
function TestTreeShakingReactElements (line 1250) | func TestTreeShakingReactElements(t *testing.T) {
function TestDisableTreeShaking (line 1274) | func TestDisableTreeShaking(t *testing.T) {
function TestDeadCodeFollowingJump (line 1315) | func TestDeadCodeFollowingJump(t *testing.T) {
function TestDeadCodeInsideEmptyTry (line 1408) | func TestDeadCodeInsideEmptyTry(t *testing.T) {
function TestDeadCodeInsideUnusedCases (line 1433) | func TestDeadCodeInsideUnusedCases(t *testing.T) {
function TestRemoveTrailingReturn (line 1520) | func TestRemoveTrailingReturn(t *testing.T) {
function TestImportReExportOfNamespaceImport (line 1564) | func TestImportReExportOfNamespaceImport(t *testing.T) {
function TestTreeShakingImportIdentifier (line 1593) | func TestTreeShakingImportIdentifier(t *testing.T) {
function TestTreeShakingObjectProperty (line 1617) | func TestTreeShakingObjectProperty(t *testing.T) {
function TestTreeShakingClassProperty (line 1658) | func TestTreeShakingClassProperty(t *testing.T) {
function TestTreeShakingClassStaticProperty (line 1697) | func TestTreeShakingClassStaticProperty(t *testing.T) {
function TestTreeShakingUnaryOperators (line 1736) | func TestTreeShakingUnaryOperators(t *testing.T) {
function TestTreeShakingBinaryOperators (line 1766) | func TestTreeShakingBinaryOperators(t *testing.T) {
function TestTreeShakingNoBundleESM (line 1827) | func TestTreeShakingNoBundleESM(t *testing.T) {
function TestTreeShakingNoBundleCJS (line 1845) | func TestTreeShakingNoBundleCJS(t *testing.T) {
function TestTreeShakingNoBundleIIFE (line 1863) | func TestTreeShakingNoBundleIIFE(t *testing.T) {
function TestTreeShakingInESMWrapper (line 1881) | func TestTreeShakingInESMWrapper(t *testing.T) {
function TestDCETypeOf (line 1907) | func TestDCETypeOf(t *testing.T) {
function TestDCETypeOfEqualsString (line 1940) | func TestDCETypeOfEqualsString(t *testing.T) {
function TestDCETypeOfEqualsStringMangle (line 1957) | func TestDCETypeOfEqualsStringMangle(t *testing.T) {
function TestDCETypeOfEqualsStringGuardCondition (line 1976) | func TestDCETypeOfEqualsStringGuardCondition(t *testing.T) {
function TestDCETypeOfCompareStringGuardCondition (line 2080) | func TestDCETypeOfCompareStringGuardCondition(t *testing.T) {
function TestRemoveUnusedImports (line 2150) | func TestRemoveUnusedImports(t *testing.T) {
function TestRemoveUnusedImportsEval (line 2170) | func TestRemoveUnusedImportsEval(t *testing.T) {
function TestRemoveUnusedImportsEvalTS (line 2194) | func TestRemoveUnusedImportsEvalTS(t *testing.T) {
function TestDCEClassStaticBlocks (line 2213) | func TestDCEClassStaticBlocks(t *testing.T) {
function TestDCEClassStaticBlocksMinifySyntax (line 2258) | func TestDCEClassStaticBlocksMinifySyntax(t *testing.T) {
function TestDCEVarExports (line 2304) | func TestDCEVarExports(t *testing.T) {
function TestDCETemplateLiteral (line 2328) | func TestDCETemplateLiteral(t *testing.T) {
function TestTreeShakingLoweredClassStaticField (line 2349) | func TestTreeShakingLoweredClassStaticField(t *testing.T) {
function TestTreeShakingLoweredClassStaticFieldMinified (line 2383) | func TestTreeShakingLoweredClassStaticFieldMinified(t *testing.T) {
function TestTreeShakingLoweredClassStaticFieldAssignment (line 2419) | func TestTreeShakingLoweredClassStaticFieldAssignment(t *testing.T) {
function TestInlineIdentityFunctionCalls (line 2453) | func TestInlineIdentityFunctionCalls(t *testing.T) {
function TestInlineEmptyFunctionCalls (line 2634) | func TestInlineEmptyFunctionCalls(t *testing.T) {
function TestInlineFunctionCallBehaviorChanges (line 2769) | func TestInlineFunctionCallBehaviorChanges(t *testing.T) {
function TestInlineFunctionCallForInitDecl (line 2840) | func TestInlineFunctionCallForInitDecl(t *testing.T) {
function TestConstValueInliningNoBundle (line 2860) | func TestConstValueInliningNoBundle(t *testing.T) {
function TestConstValueInliningBundle (line 3034) | func TestConstValueInliningBundle(t *testing.T) {
function TestConstValueInliningAssign (line 3183) | func TestConstValueInliningAssign(t *testing.T) {
function TestConstValueInliningDirectEval (line 3212) | func TestConstValueInliningDirectEval(t *testing.T) {
function TestCrossModuleConstantFoldingNumber (line 3272) | func TestCrossModuleConstantFoldingNumber(t *testing.T) {
function TestCrossModuleConstantFoldingString (line 3398) | func TestCrossModuleConstantFoldingString(t *testing.T) {
function TestCrossModuleConstantFoldingComputedPropertyName (line 3490) | func TestCrossModuleConstantFoldingComputedPropertyName(t *testing.T) {
function TestMultipleDeclarationTreeShaking (line 3547) | func TestMultipleDeclarationTreeShaking(t *testing.T) {
function TestMultipleDeclarationTreeShakingMinifySyntax (line 3589) | func TestMultipleDeclarationTreeShakingMinifySyntax(t *testing.T) {
function TestPureCallsWithSpread (line 3632) | func TestPureCallsWithSpread(t *testing.T) {
function TestTopLevelFunctionInliningWithSpread (line 3649) | func TestTopLevelFunctionInliningWithSpread(t *testing.T) {
function TestNestedFunctionInliningWithSpread (line 3709) | func TestNestedFunctionInliningWithSpread(t *testing.T) {
function TestPackageJsonSideEffectsFalseCrossPlatformSlash (line 3773) | func TestPackageJsonSideEffectsFalseCrossPlatformSlash(t *testing.T) {
function TestTreeShakingJSWithAssociatedCSS (line 3803) | func TestTreeShakingJSWithAssociatedCSS(t *testing.T) {
function TestTreeShakingJSWithAssociatedCSSReExportSideEffectsFalse (line 3834) | func TestTreeShakingJSWithAssociatedCSSReExportSideEffectsFalse(t *testi...
function TestTreeShakingJSWithAssociatedCSSReExportSideEffectsFalseOnlyJS (line 3864) | func TestTreeShakingJSWithAssociatedCSSReExportSideEffectsFalseOnlyJS(t ...
function TestTreeShakingJSWithAssociatedCSSExportStarSideEffectsFalse (line 3894) | func TestTreeShakingJSWithAssociatedCSSExportStarSideEffectsFalse(t *tes...
function TestTreeShakingJSWithAssociatedCSSExportStarSideEffectsFalseOnlyJS (line 3924) | func TestTreeShakingJSWithAssociatedCSSExportStarSideEffectsFalseOnlyJS(...
function TestTreeShakingJSWithAssociatedCSSUnusedNestedImportSideEffectsFalse (line 3954) | func TestTreeShakingJSWithAssociatedCSSUnusedNestedImportSideEffectsFals...
function TestTreeShakingJSWithAssociatedCSSUnusedNestedImportSideEffectsFalseOnlyJS (line 3984) | func TestTreeShakingJSWithAssociatedCSSUnusedNestedImportSideEffectsFals...
function TestPreserveDirectivesMinifyPassThrough (line 4014) | func TestPreserveDirectivesMinifyPassThrough(t *testing.T) {
function TestPreserveDirectivesMinifyIIFE (line 4042) | func TestPreserveDirectivesMinifyIIFE(t *testing.T) {
function TestPreserveDirectivesMinifyBundle (line 4071) | func TestPreserveDirectivesMinifyBundle(t *testing.T) {
function TestNoSideEffectsComment (line 4117) | func TestNoSideEffectsComment(t *testing.T) {
function TestNoSideEffectsCommentIgnoreAnnotations (line 4257) | func TestNoSideEffectsCommentIgnoreAnnotations(t *testing.T) {
function TestNoSideEffectsCommentMinifyWhitespace (line 4390) | func TestNoSideEffectsCommentMinifyWhitespace(t *testing.T) {
function TestNoSideEffectsCommentUnusedCalls (line 4523) | func TestNoSideEffectsCommentUnusedCalls(t *testing.T) {
function TestNoSideEffectsCommentTypeScriptDeclare (line 4577) | func TestNoSideEffectsCommentTypeScriptDeclare(t *testing.T) {
function TestDCEOfIIFE (line 4605) | func TestDCEOfIIFE(t *testing.T) {
function TestDCEOfDestructuring (line 4647) | func TestDCEOfDestructuring(t *testing.T) {
function TestDCEOfDecorators (line 4675) | func TestDCEOfDecorators(t *testing.T) {
function TestDCEOfExperimentalDecorators (line 4702) | func TestDCEOfExperimentalDecorators(t *testing.T) {
function TestDCEOfUsingDeclarations (line 4736) | func TestDCEOfUsingDeclarations(t *testing.T) {
function TestDCEOfExprAfterKeepNamesIssue3195 (line 4775) | func TestDCEOfExprAfterKeepNamesIssue3195(t *testing.T) {
function TestDropLabels (line 4799) | func TestDropLabels(t *testing.T) {
function TestRemoveCodeAfterLabelWithReturn (line 4832) | func TestRemoveCodeAfterLabelWithReturn(t *testing.T) {
function TestDropLabelTreeShakingBugIssue3311 (line 4862) | func TestDropLabelTreeShakingBugIssue3311(t *testing.T) {
function TestDCEOfSymbolInstances (line 4883) | func TestDCEOfSymbolInstances(t *testing.T) {
function TestDCEOfNegatedBigints (line 4916) | func TestDCEOfNegatedBigints(t *testing.T) {
function TestDCEOfIteratorSuperclassIssue4310 (line 4935) | func TestDCEOfIteratorSuperclassIssue4310(t *testing.T) {
function TestDCEOfSymbolCtorCall (line 4951) | func TestDCEOfSymbolCtorCall(t *testing.T) {
function TestDCEOfSymbolForCall (line 4981) | func TestDCEOfSymbolForCall(t *testing.T) {
FILE: internal/bundler_tests/bundler_default_test.go
function TestSimpleES6 (line 20) | func TestSimpleES6(t *testing.T) {
function TestSimpleCommonJS (line 41) | func TestSimpleCommonJS(t *testing.T) {
function TestNestedCommonJS (line 65) | func TestNestedCommonJS(t *testing.T) {
function TestNewExpressionCommonJS (line 91) | func TestNewExpressionCommonJS(t *testing.T) {
function TestCommonJSFromES6 (line 110) | func TestCommonJSFromES6(t *testing.T) {
function TestES6FromCommonJS (line 137) | func TestES6FromCommonJS(t *testing.T) {
function TestNestedES6FromCommonJS (line 167) | func TestNestedES6FromCommonJS(t *testing.T) {
function TestExportFormsES6 (line 190) | func TestExportFormsES6(t *testing.T) {
function TestExportFormsIIFE (line 216) | func TestExportFormsIIFE(t *testing.T) {
function TestExportFormsWithMinifyIdentifiersAndNoBundle (line 243) | func TestExportFormsWithMinifyIdentifiersAndNoBundle(t *testing.T) {
function TestImportFormsWithNoBundle (line 278) | func TestImportFormsWithNoBundle(t *testing.T) {
function TestImportFormsWithMinifyIdentifiersAndNoBundle (line 303) | func TestImportFormsWithMinifyIdentifiersAndNoBundle(t *testing.T) {
function TestExportFormsCommonJS (line 329) | func TestExportFormsCommonJS(t *testing.T) {
function TestExportChain (line 369) | func TestExportChain(t *testing.T) {
function TestExportInfiniteCycle1 (line 390) | func TestExportInfiniteCycle1(t *testing.T) {
function TestExportInfiniteCycle2 (line 413) | func TestExportInfiniteCycle2(t *testing.T) {
function TestJSXImportsCommonJS (line 438) | func TestJSXImportsCommonJS(t *testing.T) {
function TestJSXImportsES6 (line 461) | func TestJSXImportsES6(t *testing.T) {
function TestJSXSyntaxInJS (line 485) | func TestJSXSyntaxInJS(t *testing.T) {
function TestJSXConstantFragments (line 504) | func TestJSXConstantFragments(t *testing.T) {
function TestJSXAutomaticImportsCommonJS (line 543) | func TestJSXAutomaticImportsCommonJS(t *testing.T) {
function TestJSXAutomaticImportsES6 (line 570) | func TestJSXAutomaticImportsES6(t *testing.T) {
function TestJSXAutomaticSyntaxInJS (line 598) | func TestJSXAutomaticSyntaxInJS(t *testing.T) {
function TestNodeModules (line 625) | func TestNodeModules(t *testing.T) {
function TestRequireChildDirCommonJS (line 646) | func TestRequireChildDirCommonJS(t *testing.T) {
function TestRequireChildDirES6 (line 664) | func TestRequireChildDirES6(t *testing.T) {
function TestRequireParentDirCommonJS (line 683) | func TestRequireParentDirCommonJS(t *testing.T) {
function TestRequireParentDirES6 (line 701) | func TestRequireParentDirES6(t *testing.T) {
function TestImportMissingES6 (line 720) | func TestImportMissingES6(t *testing.T) {
function TestImportMissingUnusedES6 (line 742) | func TestImportMissingUnusedES6(t *testing.T) {
function TestImportMissingCommonJS (line 763) | func TestImportMissingCommonJS(t *testing.T) {
function TestImportMissingNeitherES6NorCommonJS (line 782) | func TestImportMissingNeitherES6NorCommonJS(t *testing.T) {
function TestExportMissingES6 (line 830) | func TestExportMissingES6(t *testing.T) {
function TestDotImport (line 855) | func TestDotImport(t *testing.T) {
function TestRequireWithTemplate (line 874) | func TestRequireWithTemplate(t *testing.T) {
function TestDynamicImportWithTemplateIIFE (line 893) | func TestDynamicImportWithTemplateIIFE(t *testing.T) {
function TestRequireAndDynamicImportInvalidTemplate (line 913) | func TestRequireAndDynamicImportInvalidTemplate(t *testing.T) {
function TestDynamicImportWithExpressionCJS (line 950) | func TestDynamicImportWithExpressionCJS(t *testing.T) {
function TestMinifiedDynamicImportWithExpressionCJS (line 967) | func TestMinifiedDynamicImportWithExpressionCJS(t *testing.T) {
function TestConditionalRequireResolve (line 985) | func TestConditionalRequireResolve(t *testing.T) {
function TestConditionalRequire (line 1010) | func TestConditionalRequire(t *testing.T) {
function TestConditionalImport (line 1035) | func TestConditionalImport(t *testing.T) {
function TestRequireBadArgumentCount (line 1062) | func TestRequireBadArgumentCount(t *testing.T) {
function TestRequireJson (line 1084) | func TestRequireJson(t *testing.T) {
function TestRequireTxt (line 1106) | func TestRequireTxt(t *testing.T) {
function TestRequireBadExtension (line 1122) | func TestRequireBadExtension(t *testing.T) {
function TestFalseRequire (line 1140) | func TestFalseRequire(t *testing.T) {
function TestRequireWithoutCall (line 1156) | func TestRequireWithoutCall(t *testing.T) {
function TestNestedRequireWithoutCall (line 1172) | func TestNestedRequireWithoutCall(t *testing.T) {
function TestRequireWithCallInsideTry (line 1191) | func TestRequireWithCallInsideTry(t *testing.T) {
function TestRequireWithoutCallInsideTry (line 1213) | func TestRequireWithoutCallInsideTry(t *testing.T) {
function TestRequirePropertyAccessCommonJS (line 1233) | func TestRequirePropertyAccessCommonJS(t *testing.T) {
function TestAwaitImportInsideTry (line 1255) | func TestAwaitImportInsideTry(t *testing.T) {
function TestImportInsideTry (line 1276) | func TestImportInsideTry(t *testing.T) {
function TestImportThenCatch (line 1300) | func TestImportThenCatch(t *testing.T) {
function TestSourceMap (line 1317) | func TestSourceMap(t *testing.T) {
function TestNestedScopeBug (line 1347) | func TestNestedScopeBug(t *testing.T) {
function TestHashbangBundle (line 1370) | func TestHashbangBundle(t *testing.T) {
function TestHashbangNoBundle (line 1389) | func TestHashbangNoBundle(t *testing.T) {
function TestHashbangBannerUseStrictOrder (line 1403) | func TestHashbangBannerUseStrictOrder(t *testing.T) {
function TestRequireFSBrowser (line 1421) | func TestRequireFSBrowser(t *testing.T) {
function TestRequireFSNode (line 1440) | func TestRequireFSNode(t *testing.T) {
function TestRequireFSNodeMinify (line 1457) | func TestRequireFSNodeMinify(t *testing.T) {
function TestImportFSBrowser (line 1475) | func TestImportFSBrowser(t *testing.T) {
function TestImportFSNodeCommonJS (line 1498) | func TestImportFSNodeCommonJS(t *testing.T) {
function TestImportFSNodeES6 (line 1519) | func TestImportFSNodeES6(t *testing.T) {
function TestExportFSBrowser (line 1540) | func TestExportFSBrowser(t *testing.T) {
function TestExportFSNode (line 1560) | func TestExportFSNode(t *testing.T) {
function TestReExportFSNode (line 1577) | func TestReExportFSNode(t *testing.T) {
function TestExportFSNodeInCommonJSModule (line 1598) | func TestExportFSNodeInCommonJSModule(t *testing.T) {
function TestExportWildcardFSNodeES6 (line 1618) | func TestExportWildcardFSNodeES6(t *testing.T) {
function TestExportWildcardFSNodeCommonJS (line 1647) | func TestExportWildcardFSNodeCommonJS(t *testing.T) {
function TestExportSpecialName (line 1676) | func TestExportSpecialName(t *testing.T) {
function TestExportSpecialNameBundle (line 1693) | func TestExportSpecialNameBundle(t *testing.T) {
function TestNodeAnnotationFalsePositiveIssue3544 (line 1715) | func TestNodeAnnotationFalsePositiveIssue3544(t *testing.T) {
function TestNodeAnnotationInvalidIdentifierIssue4100 (line 1740) | func TestNodeAnnotationInvalidIdentifierIssue4100(t *testing.T) {
function TestMinifiedBundleES6 (line 1760) | func TestMinifiedBundleES6(t *testing.T) {
function TestMinifiedBundleCommonJS (line 1785) | func TestMinifiedBundleCommonJS(t *testing.T) {
function TestMinifiedBundleEndingWithImportantSemicolon (line 1812) | func TestMinifiedBundleEndingWithImportantSemicolon(t *testing.T) {
function TestRuntimeNameCollisionNoBundle (line 1829) | func TestRuntimeNameCollisionNoBundle(t *testing.T) {
function TestTopLevelReturnForbiddenImport (line 1844) | func TestTopLevelReturnForbiddenImport(t *testing.T) {
function TestTopLevelReturnForbiddenExport (line 1863) | func TestTopLevelReturnForbiddenExport(t *testing.T) {
function TestTopLevelReturnForbiddenTLA (line 1882) | func TestTopLevelReturnForbiddenTLA(t *testing.T) {
function TestThisOutsideFunction (line 1900) | func TestThisOutsideFunction(t *testing.T) {
function TestThisInsideFunction (line 1930) | func TestThisInsideFunction(t *testing.T) {
function TestThisWithES6Syntax (line 1970) | func TestThisWithES6Syntax(t *testing.T) {
function TestArrowFnScope (line 2093) | func TestArrowFnScope(t *testing.T) {
function TestSwitchScopeNoBundle (line 2118) | func TestSwitchScopeNoBundle(t *testing.T) {
function TestArgumentDefaultValueScopeNoBundle (line 2134) | func TestArgumentDefaultValueScopeNoBundle(t *testing.T) {
function TestArgumentsSpecialCaseNoBundle (line 2156) | func TestArgumentsSpecialCaseNoBundle(t *testing.T) {
function TestWithStatementTaintingNoBundle (line 2207) | func TestWithStatementTaintingNoBundle(t *testing.T) {
function TestDirectEvalTaintingNoBundle (line 2240) | func TestDirectEvalTaintingNoBundle(t *testing.T) {
function TestImportReExportES6Issue149 (line 2285) | func TestImportReExportES6Issue149(t *testing.T) {
function TestExternalModuleExclusionPackage (line 2320) | func TestExternalModuleExclusionPackage(t *testing.T) {
function TestExternalModuleExclusionScopedPackage (line 2345) | func TestExternalModuleExclusionScopedPackage(t *testing.T) {
function TestScopedExternalModuleExclusion (line 2397) | func TestScopedExternalModuleExclusion(t *testing.T) {
function TestExternalModuleExclusionRelativePath (line 2422) | func TestExternalModuleExclusionRelativePath(t *testing.T) {
function TestImportWithHashInPath (line 2456) | func TestImportWithHashInPath(t *testing.T) {
function TestImportWithHashParameter (line 2475) | func TestImportWithHashParameter(t *testing.T) {
function TestImportWithQueryParameter (line 2494) | func TestImportWithQueryParameter(t *testing.T) {
function TestImportAbsPathWithQueryParameter (line 2513) | func TestImportAbsPathWithQueryParameter(t *testing.T) {
function TestImportAbsPathAsFile (line 2532) | func TestImportAbsPathAsFile(t *testing.T) {
function TestImportAbsPathAsDir (line 2551) | func TestImportAbsPathAsDir(t *testing.T) {
function TestAutoExternal (line 2587) | func TestAutoExternal(t *testing.T) {
function TestAutoExternalNode (line 2606) | func TestAutoExternalNode(t *testing.T) {
function TestExternalWithWildcard (line 2630) | func TestExternalWithWildcard(t *testing.T) {
function TestExternalWildcardDoesNotMatchEntryPoint (line 2665) | func TestExternalWildcardDoesNotMatchEntryPoint(t *testing.T) {
function TestManyEntryPoints (line 2687) | func TestManyEntryPoints(t *testing.T) {
function TestRenamePrivateIdentifiersNoBundle (line 2749) | func TestRenamePrivateIdentifiersNoBundle(t *testing.T) {
function TestMinifyPrivateIdentifiersNoBundle (line 2782) | func TestMinifyPrivateIdentifiersNoBundle(t *testing.T) {
function TestRenameLabelsNoBundle (line 2816) | func TestRenameLabelsNoBundle(t *testing.T) {
function TestMinifySiblingLabelsNoBundle (line 2848) | func TestMinifySiblingLabelsNoBundle(t *testing.T) {
function TestMinifyNestedLabelsNoBundle (line 2881) | func TestMinifyNestedLabelsNoBundle(t *testing.T) {
function TestExportsAndModuleFormatCommonJS (line 2918) | func TestExportsAndModuleFormatCommonJS(t *testing.T) {
function TestMinifiedExportsAndModuleFormatCommonJS (line 2945) | func TestMinifiedExportsAndModuleFormatCommonJS(t *testing.T) {
function TestEmptyExportClauseBundleAsCommonJSIssue910 (line 2974) | func TestEmptyExportClauseBundleAsCommonJSIssue910(t *testing.T) {
function TestUseStrictDirectiveMinifyNoBundle (line 2995) | func TestUseStrictDirectiveMinifyNoBundle(t *testing.T) {
function TestUseStrictDirectiveBundleIssue1837 (line 3014) | func TestUseStrictDirectiveBundleIssue1837(t *testing.T) {
function TestUseStrictDirectiveBundleIIFEIssue2264 (line 3040) | func TestUseStrictDirectiveBundleIIFEIssue2264(t *testing.T) {
function TestUseStrictDirectiveBundleCJSIssue2264 (line 3057) | func TestUseStrictDirectiveBundleCJSIssue2264(t *testing.T) {
function TestUseStrictDirectiveBundleESMIssue2264 (line 3074) | func TestUseStrictDirectiveBundleESMIssue2264(t *testing.T) {
function TestNoOverwriteInputFileError (line 3091) | func TestNoOverwriteInputFileError(t *testing.T) {
function TestDuplicateEntryPoint (line 3108) | func TestDuplicateEntryPoint(t *testing.T) {
function TestRelativeEntryPointError (line 3123) | func TestRelativeEntryPointError(t *testing.T) {
function TestMultipleEntryPointsSameNameCollision (line 3141) | func TestMultipleEntryPointsSameNameCollision(t *testing.T) {
function TestReExportCommonJSAsES6 (line 3156) | func TestReExportCommonJSAsES6(t *testing.T) {
function TestReExportDefaultInternal (line 3174) | func TestReExportDefaultInternal(t *testing.T) {
function TestReExportDefaultExternalES6 (line 3196) | func TestReExportDefaultExternalES6(t *testing.T) {
function TestReExportDefaultExternalCommonJS (line 3222) | func TestReExportDefaultExternalCommonJS(t *testing.T) {
function TestReExportDefaultNoBundle (line 3248) | func TestReExportDefaultNoBundle(t *testing.T) {
function TestReExportDefaultNoBundleES6 (line 3263) | func TestReExportDefaultNoBundleES6(t *testing.T) {
function TestReExportDefaultNoBundleCommonJS (line 3280) | func TestReExportDefaultNoBundleCommonJS(t *testing.T) {
function TestImportMetaCommonJS (line 3297) | func TestImportMetaCommonJS(t *testing.T) {
function TestImportMetaES6 (line 3318) | func TestImportMetaES6(t *testing.T) {
function TestImportMetaNoBundle (line 3334) | func TestImportMetaNoBundle(t *testing.T) {
function TestLegalCommentsNone (line 3348) | func TestLegalCommentsNone(t *testing.T) {
function TestLegalCommentsInline (line 3385) | func TestLegalCommentsInline(t *testing.T) {
function TestLegalCommentsEndOfFile (line 3422) | func TestLegalCommentsEndOfFile(t *testing.T) {
function TestLegalCommentsLinked (line 3459) | func TestLegalCommentsLinked(t *testing.T) {
function TestLegalCommentsExternal (line 3496) | func TestLegalCommentsExternal(t *testing.T) {
function TestLegalCommentsModifyIndent (line 3533) | func TestLegalCommentsModifyIndent(t *testing.T) {
function TestLegalCommentsAvoidSlashTagInline (line 3561) | func TestLegalCommentsAvoidSlashTagInline(t *testing.T) {
function TestLegalCommentsAvoidSlashTagEndOfFile (line 3582) | func TestLegalCommentsAvoidSlashTagEndOfFile(t *testing.T) {
function TestLegalCommentsAvoidSlashTagExternal (line 3603) | func TestLegalCommentsAvoidSlashTagExternal(t *testing.T) {
function TestLegalCommentsManyEndOfFile (line 3624) | func TestLegalCommentsManyEndOfFile(t *testing.T) {
function TestLegalCommentsEscapeSlashScriptAndStyleEndOfFile (line 3724) | func TestLegalCommentsEscapeSlashScriptAndStyleEndOfFile(t *testing.T) {
function TestLegalCommentsEscapeSlashScriptAndStyleExternal (line 3743) | func TestLegalCommentsEscapeSlashScriptAndStyleExternal(t *testing.T) {
function TestLegalCommentsNoEscapeSlashScriptEndOfFile (line 3762) | func TestLegalCommentsNoEscapeSlashScriptEndOfFile(t *testing.T) {
function TestLegalCommentsNoEscapeSlashStyleEndOfFile (line 3782) | func TestLegalCommentsNoEscapeSlashStyleEndOfFile(t *testing.T) {
function TestLegalCommentsManyLinked (line 3802) | func TestLegalCommentsManyLinked(t *testing.T) {
function TestLegalCommentsMergeDuplicatesIssue4139 (line 3875) | func TestLegalCommentsMergeDuplicatesIssue4139(t *testing.T) {
function TestIIFE_ES5 (line 3928) | func TestIIFE_ES5(t *testing.T) {
function TestOutputExtensionRemappingFile (line 3945) | func TestOutputExtensionRemappingFile(t *testing.T) {
function TestOutputExtensionRemappingDir (line 3961) | func TestOutputExtensionRemappingDir(t *testing.T) {
function TestTopLevelAwaitIIFE (line 3977) | func TestTopLevelAwaitIIFE(t *testing.T) {
function TestTopLevelAwaitIIFEDeadBranch (line 3997) | func TestTopLevelAwaitIIFEDeadBranch(t *testing.T) {
function TestTopLevelAwaitCJS (line 4014) | func TestTopLevelAwaitCJS(t *testing.T) {
function TestTopLevelAwaitCJSDeadBranch (line 4034) | func TestTopLevelAwaitCJSDeadBranch(t *testing.T) {
function TestTopLevelAwaitESM (line 4051) | func TestTopLevelAwaitESM(t *testing.T) {
function TestTopLevelAwaitESMDeadBranch (line 4068) | func TestTopLevelAwaitESMDeadBranch(t *testing.T) {
function TestTopLevelAwaitNoBundle (line 4085) | func TestTopLevelAwaitNoBundle(t *testing.T) {
function TestTopLevelAwaitNoBundleDeadBranch (line 4100) | func TestTopLevelAwaitNoBundleDeadBranch(t *testing.T) {
function TestTopLevelAwaitNoBundleESM (line 4115) | func TestTopLevelAwaitNoBundleESM(t *testing.T) {
function TestTopLevelAwaitNoBundleESMDeadBranch (line 4132) | func TestTopLevelAwaitNoBundleESMDeadBranch(t *testing.T) {
function TestTopLevelAwaitNoBundleCommonJS (line 4149) | func TestTopLevelAwaitNoBundleCommonJS(t *testing.T) {
function TestTopLevelAwaitNoBundleCommonJSDeadBranch (line 4169) | func TestTopLevelAwaitNoBundleCommonJSDeadBranch(t *testing.T) {
function TestTopLevelAwaitNoBundleIIFE (line 4186) | func TestTopLevelAwaitNoBundleIIFE(t *testing.T) {
function TestTopLevelAwaitNoBundleIIFEDeadBranch (line 4206) | func TestTopLevelAwaitNoBundleIIFEDeadBranch(t *testing.T) {
function TestTopLevelAwaitForbiddenRequire (line 4223) | func TestTopLevelAwaitForbiddenRequire(t *testing.T) {
function TestTopLevelAwaitForbiddenRequireDeadBranch (line 4266) | func TestTopLevelAwaitForbiddenRequireDeadBranch(t *testing.T) {
function TestTopLevelAwaitAllowedImportWithoutSplitting (line 4295) | func TestTopLevelAwaitAllowedImportWithoutSplitting(t *testing.T) {
function TestTopLevelAwaitAllowedImportWithSplitting (line 4324) | func TestTopLevelAwaitAllowedImportWithSplitting(t *testing.T) {
function TestAssignToImport (line 4354) | func TestAssignToImport(t *testing.T) {
function TestAssignToImportNoBundle (line 4448) | func TestAssignToImportNoBundle(t *testing.T) {
function TestMinifyArguments (line 4531) | func TestMinifyArguments(t *testing.T) {
function TestWarningsInsideNodeModules (line 4559) | func TestWarningsInsideNodeModules(t *testing.T) {
function TestRequireResolve (line 4662) | func TestRequireResolve(t *testing.T) {
function TestInjectMissing (line 4716) | func TestInjectMissing(t *testing.T) {
function TestInjectDuplicate (line 4749) | func TestInjectDuplicate(t *testing.T) {
function TestInject (line 4767) | func TestInject(t *testing.T) {
function TestInjectNoBundle (line 4867) | func TestInjectNoBundle(t *testing.T) {
function TestInjectJSX (line 4961) | func TestInjectJSX(t *testing.T) {
function TestInjectJSXDotNames (line 4998) | func TestInjectJSXDotNames(t *testing.T) {
function TestInjectImportTS (line 5024) | func TestInjectImportTS(t *testing.T) {
function TestInjectImportOrder (line 5051) | func TestInjectImportOrder(t *testing.T) {
function TestInjectAssign (line 5086) | func TestInjectAssign(t *testing.T) {
function TestInjectWithDefine (line 5125) | func TestInjectWithDefine(t *testing.T) {
function TestOutbase (line 5174) | func TestOutbase(t *testing.T) {
function TestAvoidTDZ (line 5193) | func TestAvoidTDZ(t *testing.T) {
function TestAvoidTDZNoBundle (line 5214) | func TestAvoidTDZNoBundle(t *testing.T) {
function TestDefineImportMeta (line 5235) | func TestDefineImportMeta(t *testing.T) {
function TestDefineImportMetaES5 (line 5282) | func TestDefineImportMetaES5(t *testing.T) {
function TestInjectImportMeta (line 5320) | func TestInjectImportMeta(t *testing.T) {
function TestDefineThis (line 5357) | func TestDefineThis(t *testing.T) {
function TestDefineOptionalChain (line 5426) | func TestDefineOptionalChain(t *testing.T) {
function TestDefineOptionalChainLowered (line 5460) | func TestDefineOptionalChainLowered(t *testing.T) {
function TestDefineOptionalChainPanicIssue3551 (line 5496) | func TestDefineOptionalChainPanicIssue3551(t *testing.T) {
function TestDefineInfiniteLoopIssue2407 (line 5556) | func TestDefineInfiniteLoopIssue2407(t *testing.T) {
function TestDefineAssignWarning (line 5599) | func TestDefineAssignWarning(t *testing.T) {
function TestKeepNamesAllForms (line 5674) | func TestKeepNamesAllForms(t *testing.T) {
function TestKeepNamesTreeShaking (line 5757) | func TestKeepNamesTreeShaking(t *testing.T) {
function TestKeepNamesClassStaticName (line 5788) | func TestKeepNamesClassStaticName(t *testing.T) {
function TestCharFreqIgnoreComments (line 5823) | func TestCharFreqIgnoreComments(t *testing.T) {
function TestImportRelativeAsPackage (line 5853) | func TestImportRelativeAsPackage(t *testing.T) {
function TestForbidConstAssignWhenBundling (line 5878) | func TestForbidConstAssignWhenBundling(t *testing.T) {
function TestForbidConstAssignWhenLoweringUsing (line 5905) | func TestForbidConstAssignWhenLoweringUsing(t *testing.T) {
function TestConstWithLet (line 5932) | func TestConstWithLet(t *testing.T) {
function TestConstWithLetNoBundle (line 5953) | func TestConstWithLetNoBundle(t *testing.T) {
function TestConstWithLetNoMangle (line 5974) | func TestConstWithLetNoMangle(t *testing.T) {
function TestRequireMainCacheCommonJS (line 5993) | func TestRequireMainCacheCommonJS(t *testing.T) {
function TestExternalES6ConvertedToCommonJS (line 6015) | func TestExternalES6ConvertedToCommonJS(t *testing.T) {
function TestCallImportNamespaceWarning (line 6057) | func TestCallImportNamespaceWarning(t *testing.T) {
function TestJSXThisValueCommonJS (line 6137) | func TestJSXThisValueCommonJS(t *testing.T) {
function TestJSXThisValueESM (line 6177) | func TestJSXThisValueESM(t *testing.T) {
function TestJSXThisPropertyCommonJS (line 6225) | func TestJSXThisPropertyCommonJS(t *testing.T) {
function TestJSXThisPropertyESM (line 6265) | func TestJSXThisPropertyESM(t *testing.T) {
function TestJSXImportMetaValue (line 6313) | func TestJSXImportMetaValue(t *testing.T) {
function TestJSXImportMetaProperty (line 6363) | func TestJSXImportMetaProperty(t *testing.T) {
function TestBundlingFilesOutsideOfOutbase (line 6413) | func TestBundlingFilesOutsideOfOutbase(t *testing.T) {
function TestVarRelocatingBundle (line 6508) | func TestVarRelocatingBundle(t *testing.T) {
function TestVarRelocatingNoBundle (line 6520) | func TestVarRelocatingNoBundle(t *testing.T) {
function TestImportNamespaceThisValue (line 6532) | func TestImportNamespaceThisValue(t *testing.T) {
function TestThisUndefinedWarningESM (line 6563) | func TestThisUndefinedWarningESM(t *testing.T) {
function TestQuotedProperty (line 6592) | func TestQuotedProperty(t *testing.T) {
function TestQuotedPropertyMangle (line 6614) | func TestQuotedPropertyMangle(t *testing.T) {
function TestDuplicatePropertyWarning (line 6637) | func TestDuplicatePropertyWarning(t *testing.T) {
function TestRequireShimSubstitution (line 6672) | func TestRequireShimSubstitution(t *testing.T) {
function TestStrictModeNestedFnDeclKeepNamesVariableInliningIssue1552 (line 6710) | func TestStrictModeNestedFnDeclKeepNamesVariableInliningIssue1552(t *tes...
function TestBuiltInNodeModulePrecedence (line 6736) | func TestBuiltInNodeModulePrecedence(t *testing.T) {
function TestEntryNamesNoSlashAfterDir (line 6771) | func TestEntryNamesNoSlashAfterDir(t *testing.T) {
function TestEntryNamesNonPortableCharacter (line 6795) | func TestEntryNamesNonPortableCharacter(t *testing.T) {
function TestEntryNamesChunkNamesExtPlaceholder (line 6815) | func TestEntryNamesChunkNamesExtPlaceholder(t *testing.T) {
function TestMinifyIdentifiersImportPathFrequencyAnalysis (line 6847) | func TestMinifyIdentifiersImportPathFrequencyAnalysis(t *testing.T) {
function TestToESMWrapperOmission (line 6875) | func TestToESMWrapperOmission(t *testing.T) {
function TestNamedFunctionExpressionArgumentCollision (line 6926) | func TestNamedFunctionExpressionArgumentCollision(t *testing.T) {
function TestNoWarnCommonJSExportsInESMPassThrough (line 6945) | func TestNoWarnCommonJSExportsInESMPassThrough(t *testing.T) {
function TestWarnCommonJSExportsInESMConvert (line 6974) | func TestWarnCommonJSExportsInESMConvert(t *testing.T) {
function TestWarnCommonJSExportsInESMBundle (line 7017) | func TestWarnCommonJSExportsInESMBundle(t *testing.T) {
function TestMangleProps (line 7057) | func TestMangleProps(t *testing.T) {
function TestManglePropsMinify (line 7113) | func TestManglePropsMinify(t *testing.T) {
function TestManglePropsKeywordPropertyMinify (line 7173) | func TestManglePropsKeywordPropertyMinify(t *testing.T) {
function TestManglePropsOptionalChain (line 7194) | func TestManglePropsOptionalChain(t *testing.T) {
function TestManglePropsLoweredOptionalChain (line 7219) | func TestManglePropsLoweredOptionalChain(t *testing.T) {
function TestReserveProps (line 7245) | func TestReserveProps(t *testing.T) {
function TestManglePropsImportExport (line 7265) | func TestManglePropsImportExport(t *testing.T) {
function TestManglePropsImportExportBundled (line 7292) | func TestManglePropsImportExportBundled(t *testing.T) {
function TestManglePropsJSXTransform (line 7337) | func TestManglePropsJSXTransform(t *testing.T) {
function TestManglePropsJSXPreserve (line 7369) | func TestManglePropsJSXPreserve(t *testing.T) {
function TestManglePropsJSXTransformNamespace (line 7394) | func TestManglePropsJSXTransformNamespace(t *testing.T) {
function TestManglePropsAvoidCollisions (line 7414) | func TestManglePropsAvoidCollisions(t *testing.T) {
function TestManglePropsTypeScriptFeatures (line 7436) | func TestManglePropsTypeScriptFeatures(t *testing.T) {
function TestManglePropsShorthand (line 7544) | func TestManglePropsShorthand(t *testing.T) {
function TestManglePropsNoShorthand (line 7562) | func TestManglePropsNoShorthand(t *testing.T) {
function TestManglePropsLoweredClassFields (line 7581) | func TestManglePropsLoweredClassFields(t *testing.T) {
function TestManglePropsSuperCall (line 7606) | func TestManglePropsSuperCall(t *testing.T) {
function TestMangleNoQuotedProps (line 7627) | func TestMangleNoQuotedProps(t *testing.T) {
function TestMangleNoQuotedPropsMinifySyntax (line 7655) | func TestMangleNoQuotedPropsMinifySyntax(t *testing.T) {
function TestMangleQuotedProps (line 7684) | func TestMangleQuotedProps(t *testing.T) {
function TestMangleQuotedPropsMinifySyntax (line 7732) | func TestMangleQuotedPropsMinifySyntax(t *testing.T) {
function TestPreserveKeyComment (line 7781) | func TestPreserveKeyComment(t *testing.T) {
function TestManglePropsKeyComment (line 7798) | func TestManglePropsKeyComment(t *testing.T) {
function TestManglePropsKeyCommentMinify (line 7821) | func TestManglePropsKeyCommentMinify(t *testing.T) {
function TestIndirectRequireMessage (line 7854) | func TestIndirectRequireMessage(t *testing.T) {
function TestAmbiguousReexportMsg (line 7884) | func TestAmbiguousReexportMsg(t *testing.T) {
function TestNonDeterminismIssue2537 (line 7910) | func TestNonDeterminismIssue2537(t *testing.T) {
function TestMinifiedJSXPreserveWithObjectSpread (line 7946) | func TestMinifiedJSXPreserveWithObjectSpread(t *testing.T) {
function TestPackageAlias (line 7984) | func TestPackageAlias(t *testing.T) {
function TestPackageAliasMatchLongest (line 8035) | func TestPackageAliasMatchLongest(t *testing.T) {
function TestErrorsForAssertTypeJSON (line 8065) | func TestErrorsForAssertTypeJSON(t *testing.T) {
function TestOutputForAssertTypeJSON (line 8154) | func TestOutputForAssertTypeJSON(t *testing.T) {
function TestExternalPackages (line 8201) | func TestExternalPackages(t *testing.T) {
function TestMetafileVariousCases (line 8234) | func TestMetafileVariousCases(t *testing.T) {
function TestMetafileNoBundle (line 8299) | func TestMetafileNoBundle(t *testing.T) {
function TestMetafileVeryLongExternalPaths (line 8333) | func TestMetafileVeryLongExternalPaths(t *testing.T) {
function TestMetafileImportWithTypeJSON (line 8376) | func TestMetafileImportWithTypeJSON(t *testing.T) {
function TestCommentPreservation (line 8396) | func TestCommentPreservation(t *testing.T) {
function TestCommentPreservationImportAssertions (line 8562) | func TestCommentPreservationImportAssertions(t *testing.T) {
function TestCommentPreservationTransformJSX (line 8586) | func TestCommentPreservationTransformJSX(t *testing.T) {
function TestCommentPreservationPreserveJSX (line 8622) | func TestCommentPreservationPreserveJSX(t *testing.T) {
function TestErrorMessageCrashStdinIssue2913 (line 8661) | func TestErrorMessageCrashStdinIssue2913(t *testing.T) {
function TestLineLimitNotMinified (line 8682) | func TestLineLimitNotMinified(t *testing.T) {
function TestLineLimitMinified (line 8742) | func TestLineLimitMinified(t *testing.T) {
function TestBadImportErrorMessageWithHandlesImportErrorsFlag (line 8783) | func TestBadImportErrorMessageWithHandlesImportErrorsFlag(t *testing.T) {
function TestDecoratorPrintingESM (line 8814) | func TestDecoratorPrintingESM(t *testing.T) {
function TestDecoratorPrintingCJS (line 8856) | func TestDecoratorPrintingCJS(t *testing.T) {
function TestJSXDevSelfEdgeCases (line 8914) | func TestJSXDevSelfEdgeCases(t *testing.T) {
function TestObjectLiteralProtoSetterEdgeCases (line 8952) | func TestObjectLiteralProtoSetterEdgeCases(t *testing.T) {
function TestObjectLiteralProtoSetterEdgeCasesMinifySyntax (line 9012) | func TestObjectLiteralProtoSetterEdgeCasesMinifySyntax(t *testing.T) {
function TestForbidStringImportNamesNoBundle (line 9073) | func TestForbidStringImportNamesNoBundle(t *testing.T) {
function TestForbidStringExportNamesNoBundle (line 9095) | func TestForbidStringExportNamesNoBundle(t *testing.T) {
function TestForbidStringImportNamesBundle (line 9121) | func TestForbidStringImportNamesBundle(t *testing.T) {
function TestForbidStringExportNamesBundle (line 9149) | func TestForbidStringExportNamesBundle(t *testing.T) {
function TestInjectWithStringExportNameNoBundle (line 9186) | func TestInjectWithStringExportNameNoBundle(t *testing.T) {
function TestInjectWithStringExportNameBundle (line 9208) | func TestInjectWithStringExportNameBundle(t *testing.T) {
function TestInjectWithStringReExportNameNoBundle (line 9235) | func TestInjectWithStringReExportNameNoBundle(t *testing.T) {
function TestStringExportNamesCommonJS (line 9255) | func TestStringExportNamesCommonJS(t *testing.T) {
function TestStringExportNamesIIFE (line 9274) | func TestStringExportNamesIIFE(t *testing.T) {
function TestSourceIdentifierNameIndexSingleEntry (line 9294) | func TestSourceIdentifierNameIndexSingleEntry(t *testing.T) {
function TestSourceIdentifierNameIndexMultipleEntry (line 9314) | func TestSourceIdentifierNameIndexMultipleEntry(t *testing.T) {
function TestResolveExtensionsOrderIssue4053 (line 9342) | func TestResolveExtensionsOrderIssue4053(t *testing.T) {
function TestBundleESMWithNestedVarIssue4348 (line 9382) | func TestBundleESMWithNestedVarIssue4348(t *testing.T) {
FILE: internal/bundler_tests/bundler_glob_test.go
function TestGlobBasicNoBundle (line 13) | func TestGlobBasicNoBundle(t *testing.T) {
function TestGlobBasicNoSplitting (line 39) | func TestGlobBasicNoSplitting(t *testing.T) {
function TestTSGlobBasicNoSplitting (line 66) | func TestTSGlobBasicNoSplitting(t *testing.T) {
function TestGlobBasicSplitting (line 93) | func TestGlobBasicSplitting(t *testing.T) {
function TestTSGlobBasicSplitting (line 121) | func TestTSGlobBasicSplitting(t *testing.T) {
function TestGlobDirDoesNotExist (line 149) | func TestGlobDirDoesNotExist(t *testing.T) {
function TestGlobNoMatches (line 178) | func TestGlobNoMatches(t *testing.T) {
function TestGlobEntryPointAbsPath (line 208) | func TestGlobEntryPointAbsPath(t *testing.T) {
function TestGlobWildcardSlash (line 223) | func TestGlobWildcardSlash(t *testing.T) {
function TestGlobWildcardNoSlash (line 258) | func TestGlobWildcardNoSlash(t *testing.T) {
FILE: internal/bundler_tests/bundler_importphase_test.go
function TestImportDeferExternalESM (line 13) | func TestImportDeferExternalESM(t *testing.T) {
function TestImportDeferExternalCommonJS (line 45) | func TestImportDeferExternalCommonJS(t *testing.T) {
function TestImportDeferExternalIIFE (line 84) | func TestImportDeferExternalIIFE(t *testing.T) {
function TestImportDeferInternalESM (line 123) | func TestImportDeferInternalESM(t *testing.T) {
function TestImportDeferInternalCommonJS (line 157) | func TestImportDeferInternalCommonJS(t *testing.T) {
function TestImportDeferInternalIIFE (line 191) | func TestImportDeferInternalIIFE(t *testing.T) {
function TestImportSourceExternalESM (line 225) | func TestImportSourceExternalESM(t *testing.T) {
function TestImportSourceExternalCommonJS (line 257) | func TestImportSourceExternalCommonJS(t *testing.T) {
function TestImportSourceExternalIIFE (line 296) | func TestImportSourceExternalIIFE(t *testing.T) {
function TestImportSourceInternalESM (line 335) | func TestImportSourceInternalESM(t *testing.T) {
function TestImportSourceInternalCommonJS (line 369) | func TestImportSourceInternalCommonJS(t *testing.T) {
function TestImportSourceInternalIIFE (line 403) | func TestImportSourceInternalIIFE(t *testing.T) {
FILE: internal/bundler_tests/bundler_importstar_test.go
function TestImportStarUnused (line 13) | func TestImportStarUnused(t *testing.T) {
function TestImportStarCapture (line 33) | func TestImportStarCapture(t *testing.T) {
function TestImportStarNoCapture (line 53) | func TestImportStarNoCapture(t *testing.T) {
function TestImportStarExportImportStarUnused (line 73) | func TestImportStarExportImportStarUnused(t *testing.T) {
function TestImportStarExportImportStarNoCapture (line 97) | func TestImportStarExportImportStarNoCapture(t *testing.T) {
function TestImportStarExportImportStarCapture (line 121) | func TestImportStarExportImportStarCapture(t *testing.T) {
function TestImportStarExportStarAsUnused (line 145) | func TestImportStarExportStarAsUnused(t *testing.T) {
function TestImportStarExportStarAsNoCapture (line 168) | func TestImportStarExportStarAsNoCapture(t *testing.T) {
function TestImportStarExportStarAsCapture (line 191) | func TestImportStarExportStarAsCapture(t *testing.T) {
function TestImportStarExportStarUnused (line 214) | func TestImportStarExportStarUnused(t *testing.T) {
function TestImportStarExportStarNoCapture (line 237) | func TestImportStarExportStarNoCapture(t *testing.T) {
function TestImportStarExportStarCapture (line 260) | func TestImportStarExportStarCapture(t *testing.T) {
function TestImportStarCommonJSUnused (line 283) | func TestImportStarCommonJSUnused(t *testing.T) {
function TestImportStarCommonJSCapture (line 303) | func TestImportStarCommonJSCapture(t *testing.T) {
function TestImportStarCommonJSNoCapture (line 323) | func TestImportStarCommonJSNoCapture(t *testing.T) {
function TestImportStarAndCommonJS (line 343) | func TestImportStarAndCommonJS(t *testing.T) {
function TestImportStarNoBundleUnused (line 363) | func TestImportStarNoBundleUnused(t *testing.T) {
function TestImportStarNoBundleCapture (line 379) | func TestImportStarNoBundleCapture(t *testing.T) {
function TestImportStarNoBundleNoCapture (line 395) | func TestImportStarNoBundleNoCapture(t *testing.T) {
function TestImportStarMangleNoBundleUnused (line 411) | func TestImportStarMangleNoBundleUnused(t *testing.T) {
function TestImportStarMangleNoBundleCapture (line 428) | func TestImportStarMangleNoBundleCapture(t *testing.T) {
function TestImportStarMangleNoBundleNoCapture (line 445) | func TestImportStarMangleNoBundleNoCapture(t *testing.T) {
function TestImportStarExportStarOmitAmbiguous (line 462) | func TestImportStarExportStarOmitAmbiguous(t *testing.T) {
function TestImportExportStarAmbiguousError (line 490) | func TestImportExportStarAmbiguousError(t *testing.T) {
function TestImportExportStarAmbiguousWarning (line 522) | func TestImportExportStarAmbiguousWarning(t *testing.T) {
function TestReExportStarNameCollisionNotAmbiguousImport (line 554) | func TestReExportStarNameCollisionNotAmbiguousImport(t *testing.T) {
function TestReExportStarNameCollisionNotAmbiguousExport (line 583) | func TestReExportStarNameCollisionNotAmbiguousExport(t *testing.T) {
function TestReExportStarNameShadowingNotAmbiguous (line 609) | func TestReExportStarNameShadowingNotAmbiguous(t *testing.T) {
function TestReExportStarNameShadowingNotAmbiguousReExport (line 633) | func TestReExportStarNameShadowingNotAmbiguousReExport(t *testing.T) {
function TestImportStarOfExportStarAs (line 660) | func TestImportStarOfExportStarAs(t *testing.T) {
function TestImportOfExportStar (line 682) | func TestImportOfExportStar(t *testing.T) {
function TestImportOfExportStarOfImport (line 709) | func TestImportOfExportStarOfImport(t *testing.T) {
function TestExportSelfIIFE (line 739) | func TestExportSelfIIFE(t *testing.T) {
function TestExportSelfIIFEWithName (line 756) | func TestExportSelfIIFEWithName(t *testing.T) {
function TestExportSelfES6 (line 774) | func TestExportSelfES6(t *testing.T) {
function TestExportSelfCommonJS (line 791) | func TestExportSelfCommonJS(t *testing.T) {
function TestExportSelfCommonJSMinified (line 808) | func TestExportSelfCommonJSMinified(t *testing.T) {
function TestImportSelfCommonJS (line 826) | func TestImportSelfCommonJS(t *testing.T) {
function TestExportSelfAsNamespaceES6 (line 844) | func TestExportSelfAsNamespaceES6(t *testing.T) {
function TestImportExportSelfAsNamespaceES6 (line 861) | func TestImportExportSelfAsNamespaceES6(t *testing.T) {
function TestReExportOtherFileExportSelfAsNamespaceES6 (line 879) | func TestReExportOtherFileExportSelfAsNamespaceES6(t *testing.T) {
function TestReExportOtherFileImportExportSelfAsNamespaceES6 (line 899) | func TestReExportOtherFileImportExportSelfAsNamespaceES6(t *testing.T) {
function TestOtherFileExportSelfAsNamespaceUnusedES6 (line 920) | func TestOtherFileExportSelfAsNamespaceUnusedES6(t *testing.T) {
function TestOtherFileImportExportSelfAsNamespaceUnusedES6 (line 940) | func TestOtherFileImportExportSelfAsNamespaceUnusedES6(t *testing.T) {
function TestExportSelfAsNamespaceCommonJS (line 961) | func TestExportSelfAsNamespaceCommonJS(t *testing.T) {
function TestExportSelfAndRequireSelfCommonJS (line 978) | func TestExportSelfAndRequireSelfCommonJS(t *testing.T) {
function TestExportSelfAndImportSelfCommonJS (line 995) | func TestExportSelfAndImportSelfCommonJS(t *testing.T) {
function TestExportOtherAsNamespaceCommonJS (line 1013) | func TestExportOtherAsNamespaceCommonJS(t *testing.T) {
function TestImportExportOtherAsNamespaceCommonJS (line 1032) | func TestImportExportOtherAsNamespaceCommonJS(t *testing.T) {
function TestNamespaceImportMissingES6 (line 1052) | func TestNamespaceImportMissingES6(t *testing.T) {
function TestExportOtherCommonJS (line 1073) | func TestExportOtherCommonJS(t *testing.T) {
function TestExportOtherNestedCommonJS (line 1092) | func TestExportOtherNestedCommonJS(t *testing.T) {
function TestNamespaceImportUnusedMissingES6 (line 1114) | func TestNamespaceImportUnusedMissingES6(t *testing.T) {
function TestNamespaceImportMissingCommonJS (line 1135) | func TestNamespaceImportMissingCommonJS(t *testing.T) {
function TestNamespaceImportUnusedMissingCommonJS (line 1154) | func TestNamespaceImportUnusedMissingCommonJS(t *testing.T) {
function TestReExportNamespaceImportMissingES6 (line 1173) | func TestReExportNamespaceImportMissingES6(t *testing.T) {
function TestReExportNamespaceImportUnusedMissingES6 (line 1195) | func TestReExportNamespaceImportUnusedMissingES6(t *testing.T) {
function TestNamespaceImportReExportMissingES6 (line 1217) | func TestNamespaceImportReExportMissingES6(t *testing.T) {
function TestNamespaceImportReExportUnusedMissingES6 (line 1242) | func TestNamespaceImportReExportUnusedMissingES6(t *testing.T) {
function TestNamespaceImportReExportStarMissingES6 (line 1267) | func TestNamespaceImportReExportStarMissingES6(t *testing.T) {
function TestNamespaceImportReExportStarUnusedMissingES6 (line 1291) | func TestNamespaceImportReExportStarUnusedMissingES6(t *testing.T) {
function TestExportStarDefaultExportCommonJS (line 1315) | func TestExportStarDefaultExportCommonJS(t *testing.T) {
function TestIssue176 (line 1335) | func TestIssue176(t *testing.T) {
function TestReExportStarExternalIIFE (line 1360) | func TestReExportStarExternalIIFE(t *testing.T) {
function TestReExportStarExternalES6 (line 1382) | func TestReExportStarExternalES6(t *testing.T) {
function TestReExportStarExternalCommonJS (line 1403) | func TestReExportStarExternalCommonJS(t *testing.T) {
function TestReExportStarIIFENoBundle (line 1424) | func TestReExportStarIIFENoBundle(t *testing.T) {
function TestReExportStarES6NoBundle (line 1441) | func TestReExportStarES6NoBundle(t *testing.T) {
function TestReExportStarCommonJSNoBundle (line 1457) | func TestReExportStarCommonJSNoBundle(t *testing.T) {
function TestReExportStarAsExternalIIFE (line 1473) | func TestReExportStarAsExternalIIFE(t *testing.T) {
function TestReExportStarAsExternalES6 (line 1495) | func TestReExportStarAsExternalES6(t *testing.T) {
function TestReExportStarAsExternalCommonJS (line 1516) | func TestReExportStarAsExternalCommonJS(t *testing.T) {
function TestReExportStarAsIIFENoBundle (line 1537) | func TestReExportStarAsIIFENoBundle(t *testing.T) {
function TestReExportStarAsES6NoBundle (line 1554) | func TestReExportStarAsES6NoBundle(t *testing.T) {
function TestReExportStarAsCommonJSNoBundle (line 1570) | func TestReExportStarAsCommonJSNoBundle(t *testing.T) {
function TestImportDefaultNamespaceComboIssue446 (line 1586) | func TestImportDefaultNamespaceComboIssue446(t *testing.T) {
function TestImportDefaultNamespaceComboNoDefault (line 1670) | func TestImportDefaultNamespaceComboNoDefault(t *testing.T) {
function TestImportNamespaceUndefinedPropertyEmptyFile (line 1714) | func TestImportNamespaceUndefinedPropertyEmptyFile(t *testing.T) {
function TestImportNamespaceUndefinedPropertySideEffectFreeFile (line 1763) | func TestImportNamespaceUndefinedPropertySideEffectFreeFile(t *testing.T) {
function TestReExportStarEntryPointAndInnerFile (line 1814) | func TestReExportStarEntryPointAndInnerFile(t *testing.T) {
FILE: internal/bundler_tests/bundler_importstar_ts_test.go
function TestTSImportStarUnused (line 13) | func TestTSImportStarUnused(t *testing.T) {
function TestTSImportStarCapture (line 33) | func TestTSImportStarCapture(t *testing.T) {
function TestTSImportStarNoCapture (line 53) | func TestTSImportStarNoCapture(t *testing.T) {
function TestTSImportStarExportImportStarUnused (line 73) | func TestTSImportStarExportImportStarUnused(t *testing.T) {
function TestTSImportStarExportImportStarNoCapture (line 97) | func TestTSImportStarExportImportStarNoCapture(t *testing.T) {
function TestTSImportStarExportImportStarCapture (line 121) | func TestTSImportStarExportImportStarCapture(t *testing.T) {
function TestTSImportStarExportStarAsUnused (line 145) | func TestTSImportStarExportStarAsUnused(t *testing.T) {
function TestTSImportStarExportStarAsNoCapture (line 168) | func TestTSImportStarExportStarAsNoCapture(t *testing.T) {
function TestTSImportStarExportStarAsCapture (line 191) | func TestTSImportStarExportStarAsCapture(t *testing.T) {
function TestTSImportStarExportStarUnused (line 214) | func TestTSImportStarExportStarUnused(t *testing.T) {
function TestTSImportStarExportStarNoCapture (line 237) | func TestTSImportStarExportStarNoCapture(t *testing.T) {
function TestTSImportStarExportStarCapture (line 260) | func TestTSImportStarExportStarCapture(t *testing.T) {
function TestTSImportStarCommonJSUnused (line 283) | func TestTSImportStarCommonJSUnused(t *testing.T) {
function TestTSImportStarCommonJSCapture (line 303) | func TestTSImportStarCommonJSCapture(t *testing.T) {
function TestTSImportStarCommonJSNoCapture (line 323) | func TestTSImportStarCommonJSNoCapture(t *testing.T) {
function TestTSImportStarAndCommonJS (line 343) | func TestTSImportStarAndCommonJS(t *testing.T) {
function TestTSImportStarNoBundleUnused (line 363) | func TestTSImportStarNoBundleUnused(t *testing.T) {
function TestTSImportStarNoBundleCapture (line 379) | func TestTSImportStarNoBundleCapture(t *testing.T) {
function TestTSImportStarNoBundleNoCapture (line 395) | func TestTSImportStarNoBundleNoCapture(t *testing.T) {
function TestTSImportStarMangleNoBundleUnused (line 411) | func TestTSImportStarMangleNoBundleUnused(t *testing.T) {
function TestTSImportStarMangleNoBundleCapture (line 428) | func TestTSImportStarMangleNoBundleCapture(t *testing.T) {
function TestTSImportStarMangleNoBundleNoCapture (line 445) | func TestTSImportStarMangleNoBundleNoCapture(t *testing.T) {
function TestTSReExportTypeOnlyFileES6 (line 462) | func TestTSReExportTypeOnlyFileES6(t *testing.T) {
FILE: internal/bundler_tests/bundler_loader_test.go
function TestLoaderFile (line 15) | func TestLoaderFile(t *testing.T) {
function TestLoaderFileMultipleNoCollision (line 35) | func TestLoaderFileMultipleNoCollision(t *testing.T) {
function TestJSXSyntaxInJSWithJSXLoader (line 61) | func TestJSXSyntaxInJSWithJSXLoader(t *testing.T) {
function TestJSXPreserveCapitalLetter (line 79) | func TestJSXPreserveCapitalLetter(t *testing.T) {
function TestJSXPreserveCapitalLetterMinify (line 102) | func TestJSXPreserveCapitalLetterMinify(t *testing.T) {
function TestJSXPreserveCapitalLetterMinifyNested (line 126) | func TestJSXPreserveCapitalLetterMinifyNested(t *testing.T) {
function TestRequireCustomExtensionString (line 149) | func TestRequireCustomExtensionString(t *testing.T) {
function TestRequireCustomExtensionBase64 (line 169) | func TestRequireCustomExtensionBase64(t *testing.T) {
function TestRequireCustomExtensionDataURL (line 189) | func TestRequireCustomExtensionDataURL(t *testing.T) {
function TestRequireCustomExtensionPreferLongest (line 209) | func TestRequireCustomExtensionPreferLongest(t *testing.T) {
function TestAutoDetectMimeTypeFromExtension (line 231) | func TestAutoDetectMimeTypeFromExtension(t *testing.T) {
function TestLoaderJSONCommonJSAndES6 (line 251) | func TestLoaderJSONCommonJSAndES6(t *testing.T) {
function TestLoaderJSONInvalidIdentifierES6 (line 276) | func TestLoaderJSONInvalidIdentifierES6(t *testing.T) {
function TestLoaderJSONMissingES6 (line 295) | func TestLoaderJSONMissingES6(t *testing.T) {
function TestLoaderTextCommonJSAndES6 (line 313) | func TestLoaderTextCommonJSAndES6(t *testing.T) {
function TestLoaderBase64CommonJSAndES6 (line 332) | func TestLoaderBase64CommonJSAndES6(t *testing.T) {
function TestLoaderDataURLCommonJSAndES6 (line 355) | func TestLoaderDataURLCommonJSAndES6(t *testing.T) {
function TestLoaderFileCommonJSAndES6 (line 378) | func TestLoaderFileCommonJSAndES6(t *testing.T) {
function TestLoaderFileRelativePathJS (line 401) | func TestLoaderFileRelativePathJS(t *testing.T) {
function TestLoaderFileRelativePathCSS (line 423) | func TestLoaderFileRelativePathCSS(t *testing.T) {
function TestLoaderFileRelativePathAssetNamesJS (line 446) | func TestLoaderFileRelativePathAssetNamesJS(t *testing.T) {
function TestLoaderFileExtPathAssetNamesJS (line 473) | func TestLoaderFileExtPathAssetNamesJS(t *testing.T) {
function TestLoaderFileRelativePathAssetNamesCSS (line 503) | func TestLoaderFileRelativePathAssetNamesCSS(t *testing.T) {
function TestLoaderFilePublicPathJS (line 531) | func TestLoaderFilePublicPathJS(t *testing.T) {
function TestLoaderFilePublicPathCSS (line 554) | func TestLoaderFilePublicPathCSS(t *testing.T) {
function TestLoaderFilePublicPathAssetNamesJS (line 578) | func TestLoaderFilePublicPathAssetNamesJS(t *testing.T) {
function TestLoaderFilePublicPathAssetNamesCSS (line 606) | func TestLoaderFilePublicPathAssetNamesCSS(t *testing.T) {
function TestLoaderFileOneSourceTwoDifferentOutputPathsJS (line 635) | func TestLoaderFileOneSourceTwoDifferentOutputPathsJS(t *testing.T) {
function TestLoaderFileOneSourceTwoDifferentOutputPathsCSS (line 666) | func TestLoaderFileOneSourceTwoDifferentOutputPathsCSS(t *testing.T) {
function TestLoaderJSONNoBundle (line 698) | func TestLoaderJSONNoBundle(t *testing.T) {
function TestLoaderJSONNoBundleES6 (line 710) | func TestLoaderJSONNoBundleES6(t *testing.T) {
function TestLoaderJSONNoBundleES6ArbitraryModuleNamespaceNames (line 725) | func TestLoaderJSONNoBundleES6ArbitraryModuleNamespaceNames(t *testing.T) {
function TestLoaderJSONNoBundleCommonJS (line 739) | func TestLoaderJSONNoBundleCommonJS(t *testing.T) {
function TestLoaderJSONNoBundleIIFE (line 753) | func TestLoaderJSONNoBundleIIFE(t *testing.T) {
function TestLoaderJSONSharedWithMultipleEntriesIssue413 (line 767) | func TestLoaderJSONSharedWithMultipleEntriesIssue413(t *testing.T) {
function TestLoaderFileWithQueryParameter (line 789) | func TestLoaderFileWithQueryParameter(t *testing.T) {
function TestLoaderFromExtensionWithQueryParameter (line 812) | func TestLoaderFromExtensionWithQueryParameter(t *testing.T) {
function TestLoaderDataURLTextCSS (line 834) | func TestLoaderDataURLTextCSS(t *testing.T) {
function TestLoaderDataURLTextCSSCannotImport (line 852) | func TestLoaderDataURLTextCSSCannotImport(t *testing.T) {
function TestLoaderDataURLTextJavaScript (line 872) | func TestLoaderDataURLTextJavaScript(t *testing.T) {
function TestLoaderDataURLTextJavaScriptCannotImport (line 890) | func TestLoaderDataURLTextJavaScriptCannotImport(t *testing.T) {
function TestLoaderDataURLTextJavaScriptPlusCharacter (line 911) | func TestLoaderDataURLTextJavaScriptPlusCharacter(t *testing.T) {
function TestLoaderDataURLApplicationJSON (line 926) | func TestLoaderDataURLApplicationJSON(t *testing.T) {
function TestLoaderDataURLUnknownMIME (line 947) | func TestLoaderDataURLUnknownMIME(t *testing.T) {
function TestLoaderDataURLExtensionBasedMIME (line 964) | func TestLoaderDataURLExtensionBasedMIME(t *testing.T) {
function TestLoaderDataURLBase64VsPercentEncoding (line 1046) | func TestLoaderDataURLBase64VsPercentEncoding(t *testing.T) {
function TestLoaderDataURLBase64InvalidUTF8 (line 1078) | func TestLoaderDataURLBase64InvalidUTF8(t *testing.T) {
function TestLoaderDataURLEscapePercents (line 1099) | func TestLoaderDataURLEscapePercents(t *testing.T) {
function TestLoaderCopyWithBundleFromJS (line 1124) | func TestLoaderCopyWithBundleFromJS(t *testing.T) {
function TestLoaderCopyWithBundleFromCSS (line 1146) | func TestLoaderCopyWithBundleFromCSS(t *testing.T) {
function TestLoaderCopyWithBundleEntryPoint (line 1169) | func TestLoaderCopyWithBundleEntryPoint(t *testing.T) {
function TestLoaderCopyWithTransform (line 1202) | func TestLoaderCopyWithTransform(t *testing.T) {
function TestLoaderCopyWithFormat (line 1224) | func TestLoaderCopyWithFormat(t *testing.T) {
function TestJSXAutomaticNoNameCollision (line 1247) | func TestJSXAutomaticNoNameCollision(t *testing.T) {
function TestAssertTypeJSONWrongLoader (line 1267) | func TestAssertTypeJSONWrongLoader(t *testing.T) {
function TestWithTypeJSONOverrideLoader (line 1291) | func TestWithTypeJSONOverrideLoader(t *testing.T) {
function TestWithTypeJSONOverrideLoaderGlob (line 1308) | func TestWithTypeJSONOverrideLoaderGlob(t *testing.T) {
function TestWithTypeBytesOverrideLoader (line 1324) | func TestWithTypeBytesOverrideLoader(t *testing.T) {
function TestWithTypeBytesOverrideLoaderGlob (line 1341) | func TestWithTypeBytesOverrideLoaderGlob(t *testing.T) {
function TestWithBadType (line 1357) | func TestWithBadType(t *testing.T) {
function TestWithBadAttribute (line 1377) | func TestWithBadAttribute(t *testing.T) {
function TestEmptyLoaderJS (line 1397) | func TestEmptyLoaderJS(t *testing.T) {
function TestEmptyLoaderCSS (line 1428) | func TestEmptyLoaderCSS(t *testing.T) {
function TestExtensionlessLoaderJS (line 1452) | func TestExtensionlessLoaderJS(t *testing.T) {
function TestExtensionlessLoaderCSS (line 1472) | func TestExtensionlessLoaderCSS(t *testing.T) {
function TestLoaderCopyEntryPointAdvanced (line 1493) | func TestLoaderCopyEntryPointAdvanced(t *testing.T) {
function TestLoaderCopyUseIndex (line 1530) | func TestLoaderCopyUseIndex(t *testing.T) {
function TestLoaderCopyExplicitOutputFile (line 1549) | func TestLoaderCopyExplicitOutputFile(t *testing.T) {
function TestLoaderCopyStartsWithDotAbsPath (line 1565) | func TestLoaderCopyStartsWithDotAbsPath(t *testing.T) {
function TestLoaderCopyStartsWithDotRelPath (line 1589) | func TestLoaderCopyStartsWithDotRelPath(t *testing.T) {
function TestLoaderCopyWithInjectedFileNoBundle (line 1614) | func TestLoaderCopyWithInjectedFileNoBundle(t *testing.T) {
function TestLoaderCopyWithInjectedFileBundle (line 1634) | func TestLoaderCopyWithInjectedFileBundle(t *testing.T) {
function TestLoaderBundleWithImportAttributes (line 1653) | func TestLoaderBundleWithImportAttributes(t *testing.T) {
function TestLoaderBundleWithUnknownImportAttributesAndJSLoader (line 1672) | func TestLoaderBundleWithUnknownImportAttributesAndJSLoader(t *testing.T) {
function TestLoaderBundleWithUnknownImportAttributesAndCopyLoader (line 1698) | func TestLoaderBundleWithUnknownImportAttributesAndCopyLoader(t *testing...
function TestLoaderBundleWithTypeJSONOnlyDefaultExport (line 1721) | func TestLoaderBundleWithTypeJSONOnlyDefaultExport(t *testing.T) {
function TestLoaderJSONPrototype (line 1740) | func TestLoaderJSONPrototype(t *testing.T) {
function TestLoaderJSONPrototypeES5 (line 1761) | func TestLoaderJSONPrototypeES5(t *testing.T) {
function TestLoaderJSONWithBigInt (line 1783) | func TestLoaderJSONWithBigInt(t *testing.T) {
function TestLoaderTextUTF8BOM (line 1804) | func TestLoaderTextUTF8BOM(t *testing.T) {
function TestLoaderInlineSourceMapAbsolutePathIssue4075Unix (line 1824) | func TestLoaderInlineSourceMapAbsolutePathIssue4075Unix(t *testing.T) {
function TestLoaderInlineSourceMapAbsolutePathIssue4075Windows (line 1867) | func TestLoaderInlineSourceMapAbsolutePathIssue4075Windows(t *testing.T) {
function TestLoaderDataURLHashSuffixIssue4370 (line 1910) | func TestLoaderDataURLHashSuffixIssue4370(t *testing.T) {
FILE: internal/bundler_tests/bundler_lower_test.go
function TestLowerOptionalCatchNameCollisionNoBundle (line 18) | func TestLowerOptionalCatchNameCollisionNoBundle(t *testing.T) {
function TestLowerObjectSpreadNoBundle (line 35) | func TestLowerObjectSpreadNoBundle(t *testing.T) {
function TestLowerExponentiationOperatorNoBundle (line 63) | func TestLowerExponentiationOperatorNoBundle(t *testing.T) {
function TestLowerPrivateFieldAssignments2015NoBundle (line 108) | func TestLowerPrivateFieldAssignments2015NoBundle(t *testing.T) {
function TestLowerPrivateFieldAssignments2019NoBundle (line 149) | func TestLowerPrivateFieldAssignments2019NoBundle(t *testing.T) {
function TestLowerPrivateFieldAssignments2020NoBundle (line 190) | func TestLowerPrivateFieldAssignments2020NoBundle(t *testing.T) {
function TestLowerPrivateFieldAssignmentsNextNoBundle (line 231) | func TestLowerPrivateFieldAssignmentsNextNoBundle(t *testing.T) {
function TestLowerPrivateFieldOptionalChain2019NoBundle (line 271) | func TestLowerPrivateFieldOptionalChain2019NoBundle(t *testing.T) {
function TestLowerPrivateFieldOptionalChain2020NoBundle (line 293) | func TestLowerPrivateFieldOptionalChain2020NoBundle(t *testing.T) {
function TestLowerPrivateFieldOptionalChainNextNoBundle (line 315) | func TestLowerPrivateFieldOptionalChainNextNoBundle(t *testing.T) {
function TestTSLowerPrivateFieldOptionalChain2015NoBundle (line 336) | func TestTSLowerPrivateFieldOptionalChain2015NoBundle(t *testing.T) {
function TestTSLowerPrivateStaticMembers2015NoBundle (line 358) | func TestTSLowerPrivateStaticMembers2015NoBundle(t *testing.T) {
function TestTSLowerPrivateFieldAndMethodAvoidNameCollision2015 (line 383) | func TestTSLowerPrivateFieldAndMethodAvoidNameCollision2015(t *testing.T) {
function TestLowerPrivateGetterSetter2015 (line 404) | func TestLowerPrivateGetterSetter2015(t *testing.T) {
function TestLowerPrivateGetterSetter2019 (line 455) | func TestLowerPrivateGetterSetter2019(t *testing.T) {
function TestLowerPrivateGetterSetter2020 (line 506) | func TestLowerPrivateGetterSetter2020(t *testing.T) {
function TestLowerPrivateGetterSetterNext (line 557) | func TestLowerPrivateGetterSetterNext(t *testing.T) {
function TestLowerPrivateMethod2019 (line 607) | func TestLowerPrivateMethod2019(t *testing.T) {
function TestLowerPrivateMethod2020 (line 649) | func TestLowerPrivateMethod2020(t *testing.T) {
function TestLowerPrivateMethodNext (line 691) | func TestLowerPrivateMethodNext(t *testing.T) {
function TestLowerPrivateClassExpr2020NoBundle (line 732) | func TestLowerPrivateClassExpr2020NoBundle(t *testing.T) {
function TestLowerPrivateMethodWithModifiers2020 (line 756) | func TestLowerPrivateMethodWithModifiers2020(t *testing.T) {
function TestLowerAsync2016NoBundle (line 780) | func TestLowerAsync2016NoBundle(t *testing.T) {
function TestLowerAsync2017NoBundle (line 825) | func TestLowerAsync2017NoBundle(t *testing.T) {
function TestLowerAsyncThis2016CommonJS (line 858) | func TestLowerAsyncThis2016CommonJS(t *testing.T) {
function TestLowerAsyncThis2016ES6 (line 874) | func TestLowerAsyncThis2016ES6(t *testing.T) {
function TestLowerAsyncES5 (line 898) | func TestLowerAsyncES5(t *testing.T) {
function TestLowerAsyncSuperES2017NoBundle (line 935) | func TestLowerAsyncSuperES2017NoBundle(t *testing.T) {
function TestLowerAsyncSuperES2016NoBundle (line 1011) | func TestLowerAsyncSuperES2016NoBundle(t *testing.T) {
function TestLowerStaticAsyncSuperES2021NoBundle (line 1087) | func TestLowerStaticAsyncSuperES2021NoBundle(t *testing.T) {
function TestLowerStaticAsyncSuperES2016NoBundle (line 1153) | func TestLowerStaticAsyncSuperES2016NoBundle(t *testing.T) {
function TestLowerStaticSuperES2021NoBundle (line 1219) | func TestLowerStaticSuperES2021NoBundle(t *testing.T) {
function TestLowerStaticSuperES2016NoBundle (line 1271) | func TestLowerStaticSuperES2016NoBundle(t *testing.T) {
function TestLowerAsyncArrowSuperES2016 (line 1323) | func TestLowerAsyncArrowSuperES2016(t *testing.T) {
function TestLowerAsyncArrowSuperSetterES2016 (line 1368) | func TestLowerAsyncArrowSuperSetterES2016(t *testing.T) {
function TestLowerStaticAsyncArrowSuperES2016 (line 1413) | func TestLowerStaticAsyncArrowSuperES2016(t *testing.T) {
function TestLowerStaticAsyncArrowSuperSetterES2016 (line 1458) | func TestLowerStaticAsyncArrowSuperSetterES2016(t *testing.T) {
function TestLowerPrivateSuperES2022 (line 1503) | func TestLowerPrivateSuperES2022(t *testing.T) {
function TestLowerPrivateSuperES2021 (line 1534) | func TestLowerPrivateSuperES2021(t *testing.T) {
function TestLowerPrivateSuperStaticBundleIssue2158 (line 1566) | func TestLowerPrivateSuperStaticBundleIssue2158(t *testing.T) {
function TestLowerClassField2020NoBundle (line 1587) | func TestLowerClassField2020NoBundle(t *testing.T) {
function TestLowerClassFieldNextNoBundle (line 1611) | func TestLowerClassFieldNextNoBundle(t *testing.T) {
function TestTSLowerClassField2020NoBundle (line 1634) | func TestTSLowerClassField2020NoBundle(t *testing.T) {
function TestTSLowerClassPrivateFieldNextNoBundle (line 1663) | func TestTSLowerClassPrivateFieldNextNoBundle(t *testing.T) {
function TestLowerClassFieldStrictTsconfigJson2020 (line 1691) | func TestLowerClassFieldStrictTsconfigJson2020(t *testing.T) {
function TestTSLowerClassFieldStrictTsconfigJson2020 (line 1733) | func TestTSLowerClassFieldStrictTsconfigJson2020(t *testing.T) {
function TestTSLowerObjectRest2017NoBundle (line 1775) | func TestTSLowerObjectRest2017NoBundle(t *testing.T) {
function TestTSLowerObjectRest2018NoBundle (line 1823) | func TestTSLowerObjectRest2018NoBundle(t *testing.T) {
function TestClassSuperThisIssue242NoBundle (line 1871) | func TestClassSuperThisIssue242NoBundle(t *testing.T) {
function TestLowerExportStarAsNameCollisionNoBundle (line 1897) | func TestLowerExportStarAsNameCollisionNoBundle(t *testing.T) {
function TestLowerExportStarAsNameCollision (line 1914) | func TestLowerExportStarAsNameCollision(t *testing.T) {
function TestLowerStrictModeSyntax (line 1945) | func TestLowerStrictModeSyntax(t *testing.T) {
function TestLowerForbidStrictModeSyntax (line 1966) | func TestLowerForbidStrictModeSyntax(t *testing.T) {
function TestLowerPrivateClassFieldOrder (line 2001) | func TestLowerPrivateClassFieldOrder(t *testing.T) {
function TestLowerPrivateClassMethodOrder (line 2021) | func TestLowerPrivateClassMethodOrder(t *testing.T) {
function TestLowerPrivateClassAccessorOrder (line 2041) | func TestLowerPrivateClassAccessorOrder(t *testing.T) {
function TestLowerPrivateClassStaticFieldOrder (line 2061) | func TestLowerPrivateClassStaticFieldOrder(t *testing.T) {
function TestLowerPrivateClassStaticMethodOrder (line 2087) | func TestLowerPrivateClassStaticMethodOrder(t *testing.T) {
function TestLowerPrivateClassStaticAccessorOrder (line 2113) | func TestLowerPrivateClassStaticAccessorOrder(t *testing.T) {
function TestLowerPrivateClassBrandCheckUnsupported (line 2139) | func TestLowerPrivateClassBrandCheckUnsupported(t *testing.T) {
function TestLowerPrivateClassBrandCheckSupported (line 2165) | func TestLowerPrivateClassBrandCheckSupported(t *testing.T) {
function TestLowerTemplateObject (line 2190) | func TestLowerTemplateObject(t *testing.T) {
function TestLowerPrivateClassFieldStaticIssue1424 (line 2218) | func TestLowerPrivateClassFieldStaticIssue1424(t *testing.T) {
function TestLowerNullishCoalescingAssignmentIssue1493 (line 2241) | func TestLowerNullishCoalescingAssignmentIssue1493(t *testing.T) {
function TestStaticClassBlockESNext (line 2262) | func TestStaticClassBlockESNext(t *testing.T) {
function TestStaticClassBlockES2021 (line 2293) | func TestStaticClassBlockES2021(t *testing.T) {
function TestLowerRegExpNameCollision (line 2325) | func TestLowerRegExpNameCollision(t *testing.T) {
function TestLowerForAwait2017 (line 2343) | func TestLowerForAwait2017(t *testing.T) {
function TestLowerForAwait2015 (line 2366) | func TestLowerForAwait2015(t *testing.T) {
function TestLowerNestedFunctionDirectEval (line 2389) | func TestLowerNestedFunctionDirectEval(t *testing.T) {
function TestJavaScriptDecoratorsESNext (line 2418) | func TestJavaScriptDecoratorsESNext(t *testing.T) {
function TestJavaScriptAutoAccessorESNext (line 2442) | func TestJavaScriptAutoAccessorESNext(t *testing.T) {
function TestJavaScriptAutoAccessorES2022 (line 2509) | func TestJavaScriptAutoAccessorES2022(t *testing.T) {
function TestJavaScriptAutoAccessorES2021 (line 2577) | func TestJavaScriptAutoAccessorES2021(t *testing.T) {
function TestLowerUsing (line 2645) | func TestLowerUsing(t *testing.T) {
function TestLowerUsingUnsupportedAsync (line 2709) | func TestLowerUsingUnsupportedAsync(t *testing.T) {
function TestLowerUsingUnsupportedUsingAndAsync (line 2758) | func TestLowerUsingUnsupportedUsingAndAsync(t *testing.T) {
function TestLowerUsingHoisting (line 2807) | func TestLowerUsingHoisting(t *testing.T) {
function TestLowerUsingInsideTSNamespace (line 2978) | func TestLowerUsingInsideTSNamespace(t *testing.T) {
function TestLowerAsyncGenerator (line 2998) | func TestLowerAsyncGenerator(t *testing.T) {
function TestLowerAsyncGeneratorNoAwait (line 3058) | func TestLowerAsyncGeneratorNoAwait(t *testing.T) {
function TestJavaScriptDecoratorsBundleIssue3768 (line 3119) | func TestJavaScriptDecoratorsBundleIssue3768(t *testing.T) {
function TestForAwaitWithOptionalCatchIssue4378 (line 3148) | func TestForAwaitWithOptionalCatchIssue4378(t *testing.T) {
FILE: internal/bundler_tests/bundler_packagejson_test.go
function TestPackageJsonMain (line 13) | func TestPackageJsonMain(t *testing.T) {
function TestPackageJsonBadMain (line 39) | func TestPackageJsonBadMain(t *testing.T) {
function TestPackageJsonSyntaxErrorComment (line 65) | func TestPackageJsonSyntaxErrorComment(t *testing.T) {
function TestPackageJsonSyntaxErrorTrailingComma (line 94) | func TestPackageJsonSyntaxErrorTrailingComma(t *testing.T) {
function TestPackageJsonModule (line 123) | func TestPackageJsonModule(t *testing.T) {
function TestPackageJsonBrowserString (line 155) | func TestPackageJsonBrowserString(t *testing.T) {
function TestPackageJsonBrowserMapRelativeToRelative (line 181) | func TestPackageJsonBrowserMapRelativeToRelative(t *testing.T) {
function TestPackageJsonBrowserMapRelativeToModule (line 224) | func TestPackageJsonBrowserMapRelativeToModule(t *testing.T) {
function TestPackageJsonBrowserMapRelativeDisabled (line 260) | func TestPackageJsonBrowserMapRelativeDisabled(t *testing.T) {
function TestPackageJsonBrowserMapModuleToRelative (line 293) | func TestPackageJsonBrowserMapModuleToRelative(t *testing.T) {
function TestPackageJsonBrowserMapModuleToModule (line 332) | func TestPackageJsonBrowserMapModuleToModule(t *testing.T) {
function TestPackageJsonBrowserMapModuleDisabled (line 371) | func TestPackageJsonBrowserMapModuleDisabled(t *testing.T) {
function TestPackageJsonBrowserMapNativeModuleDisabled (line 405) | func TestPackageJsonBrowserMapNativeModuleDisabled(t *testing.T) {
function TestPackageJsonBrowserMapAvoidMissing (line 434) | func TestPackageJsonBrowserMapAvoidMissing(t *testing.T) {
function TestPackageJsonBrowserOverModuleBrowser (line 468) | func TestPackageJsonBrowserOverModuleBrowser(t *testing.T) {
function TestPackageJsonBrowserOverMainNode (line 507) | func TestPackageJsonBrowserOverMainNode(t *testing.T) {
function TestPackageJsonBrowserWithModuleBrowser (line 546) | func TestPackageJsonBrowserWithModuleBrowser(t *testing.T) {
function TestPackageJsonBrowserWithMainNode (line 593) | func TestPackageJsonBrowserWithMainNode(t *testing.T) {
function TestPackageJsonBrowserNodeModulesNoExt (line 640) | func TestPackageJsonBrowserNodeModulesNoExt(t *testing.T) {
function TestPackageJsonBrowserNodeModulesIndexNoExt (line 682) | func TestPackageJsonBrowserNodeModulesIndexNoExt(t *testing.T) {
function TestPackageJsonBrowserNoExt (line 724) | func TestPackageJsonBrowserNoExt(t *testing.T) {
function TestPackageJsonBrowserIndexNoExt (line 766) | func TestPackageJsonBrowserIndexNoExt(t *testing.T) {
function TestPackageJsonBrowserIssue2002A (line 809) | func TestPackageJsonBrowserIssue2002A(t *testing.T) {
function TestPackageJsonBrowserIssue2002B (line 830) | func TestPackageJsonBrowserIssue2002B(t *testing.T) {
function TestPackageJsonBrowserIssue2002C (line 852) | func TestPackageJsonBrowserIssue2002C(t *testing.T) {
function TestPackageJsonDualPackageHazardImportOnly (line 873) | func TestPackageJsonDualPackageHazardImportOnly(t *testing.T) {
function TestPackageJsonDualPackageHazardRequireOnly (line 901) | func TestPackageJsonDualPackageHazardRequireOnly(t *testing.T) {
function TestPackageJsonDualPackageHazardImportAndRequireSameFile (line 928) | func TestPackageJsonDualPackageHazardImportAndRequireSameFile(t *testing...
function TestPackageJsonDualPackageHazardImportAndRequireSeparateFiles (line 956) | func TestPackageJsonDualPackageHazardImportAndRequireSeparateFiles(t *te...
function TestPackageJsonDualPackageHazardImportAndRequireForceModuleBeforeMain (line 991) | func TestPackageJsonDualPackageHazardImportAndRequireForceModuleBeforeMa...
function TestPackageJsonDualPackageHazardImportAndRequireImplicitMain (line 1027) | func TestPackageJsonDualPackageHazardImportAndRequireImplicitMain(t *tes...
function TestPackageJsonDualPackageHazardImportAndRequireImplicitMainForceModuleBeforeMain (line 1061) | func TestPackageJsonDualPackageHazardImportAndRequireImplicitMainForceMo...
function TestPackageJsonDualPackageHazardImportAndRequireBrowser (line 1096) | func TestPackageJsonDualPackageHazardImportAndRequireBrowser(t *testing....
function TestPackageJsonMainFieldsA (line 1141) | func TestPackageJsonMainFieldsA(t *testing.T) {
function TestPackageJsonMainFieldsB (line 1170) | func TestPackageJsonMainFieldsB(t *testing.T) {
function TestPackageJsonNeutralNoDefaultMainFields (line 1199) | func TestPackageJsonNeutralNoDefaultMainFields(t *testing.T) {
function TestPackageJsonNeutralExplicitMainFields (line 1236) | func TestPackageJsonNeutralExplicitMainFields(t *testing.T) {
function TestPackageJsonExportsErrorInvalidModuleSpecifier (line 1265) | func TestPackageJsonExportsErrorInvalidModuleSpecifier(t *testing.T) {
function TestPackageJsonExportsErrorInvalidPackageConfiguration (line 1322) | func TestPackageJsonExportsErrorInvalidPackageConfiguration(t *testing.T) {
function TestPackageJsonExportsErrorInvalidPackageTarget (line 1353) | func TestPackageJsonExportsErrorInvalidPackageTarget(t *testing.T) {
function TestPackageJsonExportsErrorPackagePathNotExported (line 1389) | func TestPackageJsonExportsErrorPackagePathNotExported(t *testing.T) {
function TestPackageJsonExportsErrorModuleNotFound (line 1411) | func TestPackageJsonExportsErrorModuleNotFound(t *testing.T) {
function TestPackageJsonExportsErrorUnsupportedDirectoryImport (line 1433) | func TestPackageJsonExportsErrorUnsupportedDirectoryImport(t *testing.T) {
function TestPackageJsonImportsErrorUnsupportedDirectoryImport (line 1466) | func TestPackageJsonImportsErrorUnsupportedDirectoryImport(t *testing.T) {
function TestPackageJsonExportsRequireOverImport (line 1506) | func TestPackageJsonExportsRequireOverImport(t *testing.T) {
function TestPackageJsonExportsImportOverRequire (line 1536) | func TestPackageJsonExportsImportOverRequire(t *testing.T) {
function TestPackageJsonExportsDefaultOverImportAndRequire (line 1566) | func TestPackageJsonExportsDefaultOverImportAndRequire(t *testing.T) {
function TestPackageJsonExportsEntryPointImportOverRequire (line 1599) | func TestPackageJsonExportsEntryPointImportOverRequire(t *testing.T) {
function TestPackageJsonExportsEntryPointRequireOnly (line 1633) | func TestPackageJsonExportsEntryPointRequireOnly(t *testing.T) {
function TestPackageJsonExportsEntryPointModuleOverMain (line 1667) | func TestPackageJsonExportsEntryPointModuleOverMain(t *testing.T) {
function TestPackageJsonExportsEntryPointMainOnly (line 1691) | func TestPackageJsonExportsEntryPointMainOnly(t *testing.T) {
function TestPackageJsonExportsBrowser (line 1711) | func TestPackageJsonExportsBrowser(t *testing.T) {
function TestPackageJsonExportsNode (line 1742) | func TestPackageJsonExportsNode(t *testing.T) {
function TestPackageJsonExportsNeutral (line 1773) | func TestPackageJsonExportsNeutral(t *testing.T) {
function TestPackageJsonExportsOrderIndependent (line 1807) | func TestPackageJsonExportsOrderIndependent(t *testing.T) {
function TestPackageJsonExportsWildcard (line 1851) | func TestPackageJsonExportsWildcard(t *testing.T) {
function TestPackageJsonExportsErrorMissingTrailingSlash (line 1880) | func TestPackageJsonExportsErrorMissingTrailingSlash(t *testing.T) {
function TestPackageJsonExportsCustomConditions (line 1902) | func TestPackageJsonExportsCustomConditions(t *testing.T) {
function TestPackageJsonExportsNotExactMissingExtension (line 1930) | func TestPackageJsonExportsNotExactMissingExtension(t *testing.T) {
function TestPackageJsonExportsNotExactMissingExtensionPattern (line 1955) | func TestPackageJsonExportsNotExactMissingExtensionPattern(t *testing.T) {
function TestPackageJsonExportsExactMissingExtension (line 1985) | func TestPackageJsonExportsExactMissingExtension(t *testing.T) {
function TestPackageJsonExportsNoConditionsMatch (line 2014) | func TestPackageJsonExportsNoConditionsMatch(t *testing.T) {
function TestPackageJsonExportsMustUseRequire (line 2056) | func TestPackageJsonExportsMustUseRequire(t *testing.T) {
function TestPackageJsonExportsMustUseImport (line 2098) | func TestPackageJsonExportsMustUseImport(t *testing.T) {
function TestPackageJsonExportsReverseLookup (line 2140) | func TestPackageJsonExportsReverseLookup(t *testing.T) {
function TestPackageJsonExportsPatternTrailers (line 2181) | func TestPackageJsonExportsPatternTrailers(t *testing.T) {
function TestPackageJsonExportsAlternatives (line 2234) | func TestPackageJsonExportsAlternatives(t *testing.T) {
function TestPackageJsonImports (line 2280) | func TestPackageJsonImports(t *testing.T) {
function TestPackageJsonImportsRemapToOtherPackage (line 2312) | func TestPackageJsonImportsRemapToOtherPackage(t *testing.T) {
function TestPackageJsonImportsErrorMissingRemappedPackage (line 2344) | func TestPackageJsonImportsErrorMissingRemappedPackage(t *testing.T) {
function TestPackageJsonImportsInvalidPackageConfiguration (line 2370) | func TestPackageJsonImportsInvalidPackageConfiguration(t *testing.T) {
function TestPackageJsonImportsErrorEqualsHash (line 2395) | func TestPackageJsonImportsErrorEqualsHash(t *testing.T) {
function TestPackageJsonImportsHashSlashWithWildcard (line 2422) | func TestPackageJsonImportsHashSlashWithWildcard(t *testing.T) {
function TestPackageJsonImportsHashSlashExactMatch (line 2447) | func TestPackageJsonImportsHashSlashExactMatch(t *testing.T) {
function TestPackageJsonImportsHashSlashWithConditions (line 2473) | func TestPackageJsonImportsHashSlashWithConditions(t *testing.T) {
function TestPackageJsonImportsHashSlashSymmetricWithExports (line 2500) | func TestPackageJsonImportsHashSlashSymmetricWithExports(t *testing.T) {
function TestPackageJsonMainFieldsErrorMessageDefault (line 2525) | func TestPackageJsonMainFieldsErrorMessageDefault(t *testing.T) {
function TestPackageJsonMainFieldsErrorMessageNotIncluded (line 2548) | func TestPackageJsonMainFieldsErrorMessageNotIncluded(t *testing.T) {
function TestPackageJsonMainFieldsErrorMessageEmpty (line 2573) | func TestPackageJsonMainFieldsErrorMessageEmpty(t *testing.T) {
function TestPackageJsonTypeShouldBeTypes (line 2598) | func TestPackageJsonTypeShouldBeTypes(t *testing.T) {
function TestPackageJsonImportSelfUsingRequire (line 2621) | func TestPackageJsonImportSelfUsingRequire(t *testing.T) {
function TestPackageJsonImportSelfUsingImport (line 2659) | func TestPackageJsonImportSelfUsingImport(t *testing.T) {
function TestPackageJsonImportSelfUsingRequireScoped (line 2696) | func TestPackageJsonImportSelfUsingRequireScoped(t *testing.T) {
function TestPackageJsonImportSelfUsingImportScoped (line 2734) | func TestPackageJsonImportSelfUsingImportScoped(t *testing.T) {
function TestPackageJsonImportSelfUsingRequireFailure (line 2771) | func TestPackageJsonImportSelfUsingRequireFailure(t *testing.T) {
function TestPackageJsonImportSelfUsingImportFailure (line 2805) | func TestPackageJsonImportSelfUsingImportFailure(t *testing.T) {
function TestCommonJSVariableInESMTypeModule (line 2839) | func TestCommonJSVariableInESMTypeModule(t *testing.T) {
function TestPackageJsonNodePathsIssue2752 (line 2857) | func TestPackageJsonNodePathsIssue2752(t *testing.T) {
function TestPackageJsonReversePackageExportsIssue3377 (line 2890) | func TestPackageJsonReversePackageExportsIssue3377(t *testing.T) {
function TestPackageJsonDisabledTypeModuleIssue3367 (line 2928) | func TestPackageJsonDisabledTypeModuleIssue3367(t *testing.T) {
function TestPackageJsonSubpathImportNodeBuiltinIssue3485 (line 2960) | func TestPackageJsonSubpathImportNodeBuiltinIssue3485(t *testing.T) {
function TestPackageJsonBadExportsImportAndRequireWarningIssue3867 (line 2995) | func TestPackageJsonBadExportsImportAndRequireWarningIssue3867(t *testin...
function TestPackageJsonBadExportsDefaultWarningIssue3867 (line 3043) | func TestPackageJsonBadExportsDefaultWarningIssue3867(t *testing.T) {
function TestPackageJsonExportsDefaultWarningIssue3887 (line 3089) | func TestPackageJsonExportsDefaultWarningIssue3887(t *testing.T) {
function TestConfusingNameCollisionsIssue4144 (line 3122) | func TestConfusingNameCollisionsIssue4144(t *testing.T) {
function TestPackageJsonBrowserMatchingTrailingSlashIssue4187 (line 3156) | func TestPackageJsonBrowserMatchingTrailingSlashIssue4187(t *testing.T) {
FILE: internal/bundler_tests/bundler_splitting_test.go
function TestSplittingSharedES6IntoES6 (line 13) | func TestSplittingSharedES6IntoES6(t *testing.T) {
function TestSplittingSharedCommonJSIntoES6 (line 36) | func TestSplittingSharedCommonJSIntoES6(t *testing.T) {
function TestSplittingDynamicES6IntoES6 (line 59) | func TestSplittingDynamicES6IntoES6(t *testing.T) {
function TestSplittingDynamicCommonJSIntoES6 (line 79) | func TestSplittingDynamicCommonJSIntoES6(t *testing.T) {
function TestSplittingDynamicAndNotDynamicES6IntoES6 (line 99) | func TestSplittingDynamicAndNotDynamicES6IntoES6(t *testing.T) {
function TestSplittingDynamicAndNotDynamicCommonJSIntoES6 (line 120) | func TestSplittingDynamicAndNotDynamicCommonJSIntoES6(t *testing.T) {
function TestSplittingAssignToLocal (line 141) | func TestSplittingAssignToLocal(t *testing.T) {
function TestSplittingSideEffectsWithoutDependencies (line 170) | func TestSplittingSideEffectsWithoutDependencies(t *testing.T) {
function TestSplittingNestedDirectories (line 197) | func TestSplittingNestedDirectories(t *testing.T) {
function TestSplittingCircularReferenceIssue251 (line 225) | func TestSplittingCircularReferenceIssue251(t *testing.T) {
function TestSplittingMissingLazyExport (line 247) | func TestSplittingMissingLazyExport(t *testing.T) {
function TestSplittingReExportIssue273 (line 280) | func TestSplittingReExportIssue273(t *testing.T) {
function TestSplittingDynamicImportIssue272 (line 300) | func TestSplittingDynamicImportIssue272(t *testing.T) {
function TestSplittingDynamicImportOutsideSourceTreeIssue264 (line 320) | func TestSplittingDynamicImportOutsideSourceTreeIssue264(t *testing.T) {
function TestSplittingCrossChunkAssignmentDependencies (line 343) | func TestSplittingCrossChunkAssignmentDependencies(t *testing.T) {
function TestSplittingCrossChunkAssignmentDependenciesRecursive (line 379) | func TestSplittingCrossChunkAssignmentDependenciesRecursive(t *testing.T) {
function TestSplittingDuplicateChunkCollision (line 426) | func TestSplittingDuplicateChunkCollision(t *testing.T) {
function TestSplittingMinifyIdentifiersCrashIssue437 (line 459) | func TestSplittingMinifyIdentifiersCrashIssue437(t *testing.T) {
function TestSplittingHybridESMAndCJSIssue617 (line 488) | func TestSplittingHybridESMAndCJSIssue617(t *testing.T) {
function TestSplittingPublicPathEntryName (line 508) | func TestSplittingPublicPathEntryName(t *testing.T) {
function TestSplittingChunkPathDirPlaceholderImplicitOutbase (line 529) | func TestSplittingChunkPathDirPlaceholderImplicitOutbase(t *testing.T) {
function TestEdgeCaseIssue2793WithSplitting (line 554) | func TestEdgeCaseIssue2793WithSplitting(t *testing.T) {
function TestEdgeCaseIssue2793WithoutSplitting (line 578) | func TestEdgeCaseIssue2793WithoutSplitting(t *testing.T) {
FILE: internal/bundler_tests/bundler_test.go
function es (line 29) | func es(version int) compat.JSFeature {
function assertLog (line 35) | func assertLog(t *testing.T, msgs []logger.Msg, expected string) {
function hasErrors (line 44) | func hasErrors(msgs []logger.Msg) bool {
type bundled (line 53) | type bundled struct
type suite (line 64) | type suite struct
method expectBundled (line 72) | func (s *suite) expectBundled(t *testing.T, args bundled) {
method expectBundledUnix (line 119) | func (s *suite) expectBundledUnix(t *testing.T, args bundled) {
method expectBundledWindows (line 124) | func (s *suite) expectBundledWindows(t *testing.T, args bundled) {
method __expectBundledImpl (line 130) | func (s *suite) __expectBundledImpl(t *testing.T, args bundled, fsKind...
method compareSnapshot (line 232) | func (s *suite) compareSnapshot(t *testing.T, testName string, generat...
method updateSnapshots (line 279) | func (s *suite) updateSnapshots() {
method validateSnapshots (line 298) | func (s *suite) validateSnapshots() bool {
constant snapshotsDir (line 225) | snapshotsDir = "snapshots"
constant snapshotSplitter (line 226) | snapshotSplitter = "\n==================================================...
function TestMain (line 312) | func TestMain(m *testing.M) {
function win2unix (line 330) | func win2unix(p string) string {
function unix2win (line 338) | func unix2win(p string) string {
FILE: internal/bundler_tests/bundler_ts_test.go
function TestTSDeclareConst (line 15) | func TestTSDeclareConst(t *testing.T) {
function TestTSDeclareLet (line 35) | func TestTSDeclareLet(t *testing.T) {
function TestTSDeclareVar (line 55) | func TestTSDeclareVar(t *testing.T) {
function TestTSDeclareClass (line 75) | func TestTSDeclareClass(t *testing.T) {
function TestTSDeclareClassFields (line 95) | func TestTSDeclareClassFields(t *testing.T) {
function TestTSDeclareFunction (line 147) | func TestTSDeclareFunction(t *testing.T) {
function TestTSDeclareNamespace (line 167) | func TestTSDeclareNamespace(t *testing.T) {
function TestTSDeclareEnum (line 187) | func TestTSDeclareEnum(t *testing.T) {
function TestTSDeclareConstEnum (line 207) | func TestTSDeclareConstEnum(t *testing.T) {
function TestTSConstEnumComments (line 227) | func TestTSConstEnumComments(t *testing.T) {
function TestTSImportEmptyNamespace (line 262) | func TestTSImportEmptyNamespace(t *testing.T) {
function TestTSImportMissingES6 (line 282) | func TestTSImportMissingES6(t *testing.T) {
function TestTSImportMissingUnusedES6 (line 304) | func TestTSImportMissingUnusedES6(t *testing.T) {
function TestTSExportMissingES6 (line 322) | func TestTSExportMissingES6(t *testing.T) {
function TestTSImportMissingFile (line 345) | func TestTSImportMissingFile(t *testing.T) {
function TestTSImportTypeOnlyFile (line 364) | func TestTSImportTypeOnlyFile(t *testing.T) {
function TestTSExportEquals (line 381) | func TestTSExportEquals(t *testing.T) {
function TestTSExportNamespace (line 401) | func TestTSExportNamespace(t *testing.T) {
function TestTSNamespaceKeepNames (line 426) | func TestTSNamespaceKeepNames(t *testing.T) {
function TestTSNamespaceKeepNamesTargetES2015 (line 446) | func TestTSNamespaceKeepNamesTargetES2015(t *testing.T) {
function TestTSMinifyEnum (line 467) | func TestTSMinifyEnum(t *testing.T) {
function TestTSMinifyNestedEnum (line 487) | func TestTSMinifyNestedEnum(t *testing.T) {
function TestTSMinifyNestedEnumNoLogicalAssignment (line 507) | func TestTSMinifyNestedEnumNoLogicalAssignment(t *testing.T) {
function TestTSMinifyNestedEnumNoArrow (line 528) | func TestTSMinifyNestedEnumNoArrow(t *testing.T) {
function TestTSMinifyNamespace (line 549) | func TestTSMinifyNamespace(t *testing.T) {
function TestTSMinifyNamespaceNoLogicalAssignment (line 577) | func TestTSMinifyNamespaceNoLogicalAssignment(t *testing.T) {
function TestTSMinifyNamespaceNoArrow (line 606) | func TestTSMinifyNamespaceNoArrow(t *testing.T) {
function TestTSMinifyDerivedClass (line 635) | func TestTSMinifyDerivedClass(t *testing.T) {
function TestTSMinifyEnumPropertyNames (line 664) | func TestTSMinifyEnumPropertyNames(t *testing.T) {
function TestTSMinifyEnumCrossFileInlineStringsIntoTemplates (line 736) | func TestTSMinifyEnumCrossFileInlineStringsIntoTemplates(t *testing.T) {
function TestTSImportVsLocalCollisionAllTypes (line 768) | func TestTSImportVsLocalCollisionAllTypes(t *testing.T) {
function TestTSImportVsLocalCollisionMixed (line 791) | func TestTSImportVsLocalCollisionMixed(t *testing.T) {
function TestTSImportEqualsEliminationTest (line 815) | func TestTSImportEqualsEliminationTest(t *testing.T) {
function TestTSImportEqualsTreeShakingFalse (line 838) | func TestTSImportEqualsTreeShakingFalse(t *testing.T) {
function TestTSImportEqualsTreeShakingTrue (line 857) | func TestTSImportEqualsTreeShakingTrue(t *testing.T) {
function TestTSImportEqualsBundle (line 876) | func TestTSImportEqualsBundle(t *testing.T) {
function TestTSImportEqualsUndefinedImport (line 901) | func TestTSImportEqualsUndefinedImport(t *testing.T) {
function TestTSMinifiedBundleES6 (line 931) | func TestTSMinifiedBundleES6(t *testing.T) {
function TestTSMinifiedBundleCommonJS (line 955) | func TestTSMinifiedBundleCommonJS(t *testing.T) {
function TestTSExperimentalDecoratorsNoConfig (line 982) | func TestTSExperimentalDecoratorsNoConfig(t *testing.T) {
function TestTSExperimentalDecorators (line 1029) | func TestTSExperimentalDecorators(t *testing.T) {
function TestTSExperimentalDecoratorsKeepNames (line 1183) | func TestTSExperimentalDecoratorsKeepNames(t *testing.T) {
function TestTSExperimentalDecoratorScopeIssue2147 (line 1206) | func TestTSExperimentalDecoratorScopeIssue2147(t *testing.T) {
function TestTSExportDefaultTypeIssue316 (line 1248) | func TestTSExportDefaultTypeIssue316(t *testing.T) {
function TestTSImplicitExtensions (line 1381) | func TestTSImplicitExtensions(t *testing.T) {
function TestTSImplicitExtensionsMissing (line 1460) | func TestTSImplicitExtensionsMissing(t *testing.T) {
function TestExportTypeIssue379 (line 1489) | func TestExportTypeIssue379(t *testing.T) {
function TestThisInsideFunctionTS (line 1535) | func TestThisInsideFunctionTS(t *testing.T) {
function TestThisInsideFunctionTSUseDefineForClassFields (line 1576) | func TestThisInsideFunctionTSUseDefineForClassFields(t *testing.T) {
function TestThisInsideFunctionTSNoBundle (line 1617) | func TestThisInsideFunctionTSNoBundle(t *testing.T) {
function TestThisInsideFunctionTSNoBundleUseDefineForClassFields (line 1660) | func TestThisInsideFunctionTSNoBundleUseDefineForClassFields(t *testing....
function TestTSComputedClassFieldUseDefineFalse (line 1701) | func TestTSComputedClassFieldUseDefineFalse(t *testing.T) {
function TestTSComputedClassFieldUseDefineTrue (line 1730) | func TestTSComputedClassFieldUseDefineTrue(t *testing.T) {
function TestTSComputedClassFieldUseDefineTrueLower (line 1759) | func TestTSComputedClassFieldUseDefineTrueLower(t *testing.T) {
function TestTSAbstractClassFieldUseAssign (line 1789) | func TestTSAbstractClassFieldUseAssign(t *testing.T) {
function TestTSAbstractClassFieldUseDefine (line 1816) | func TestTSAbstractClassFieldUseDefine(t *testing.T) {
function TestTSImportMTS (line 1843) | func TestTSImportMTS(t *testing.T) {
function TestTSImportCTS (line 1862) | func TestTSImportCTS(t *testing.T) {
function TestTSSideEffectsFalseWarningTypeDeclarations (line 1881) | func TestTSSideEffectsFalseWarningTypeDeclarations(t *testing.T) {
function TestTSSiblingNamespace (line 1920) | func TestTSSiblingNamespace(t *testing.T) {
function TestTSSiblingEnum (line 1958) | func TestTSSiblingEnum(t *testing.T) {
function TestTSEnumTreeShaking (line 2039) | func TestTSEnumTreeShaking(t *testing.T) {
function TestTSEnumJSX (line 2097) | func TestTSEnumJSX(t *testing.T) {
function TestTSEnumDefine (line 2130) | func TestTSEnumDefine(t *testing.T) {
function TestTSEnumSameModuleInliningAccess (line 2154) | func TestTSEnumSameModuleInliningAccess(t *testing.T) {
function TestTSEnumCrossModuleInliningAccess (line 2197) | func TestTSEnumCrossModuleInliningAccess(t *testing.T) {
function TestTSEnumCrossModuleInliningDefinitions (line 2246) | func TestTSEnumCrossModuleInliningDefinitions(t *testing.T) {
function TestTSEnumCrossModuleInliningReExport (line 2275) | func TestTSEnumCrossModuleInliningReExport(t *testing.T) {
function TestTSEnumCrossModuleInliningMinifyIndexIntoDot (line 2308) | func TestTSEnumCrossModuleInliningMinifyIndexIntoDot(t *testing.T) {
function TestTSEnumCrossModuleTreeShaking (line 2350) | func TestTSEnumCrossModuleTreeShaking(t *testing.T) {
function TestTSEnumExportClause (line 2402) | func TestTSEnumExportClause(t *testing.T) {
function TestTSThisIsUndefinedWarning (line 2442) | func TestTSThisIsUndefinedWarning(t *testing.T) {
function TestTSCommonJSVariableInESMTypeModule (line 2475) | func TestTSCommonJSVariableInESMTypeModule(t *testing.T) {
function TestEnumRulesFrom_TypeScript_5_0 (line 2493) | func TestEnumRulesFrom_TypeScript_5_0(t *testing.T) {
function TestTSEnumUseBeforeDeclare (line 2667) | func TestTSEnumUseBeforeDeclare(t *testing.T) {
function TestTSPreferJSOverTSInsideNodeModules (line 2688) | func TestTSPreferJSOverTSInsideNodeModules(t *testing.T) {
function TestTSExperimentalDecoratorsManglePropsDefineSemantics (line 2722) | func TestTSExperimentalDecoratorsManglePropsDefineSemantics(t *testing.T) {
function TestTSExperimentalDecoratorsManglePropsAssignSemantics (line 2751) | func TestTSExperimentalDecoratorsManglePropsAssignSemantics(t *testing.T) {
function TestTSExperimentalDecoratorsManglePropsMethods (line 2780) | func TestTSExperimentalDecoratorsManglePropsMethods(t *testing.T) {
function TestTSExperimentalDecoratorsManglePropsStaticDefineSemantics (line 2808) | func TestTSExperimentalDecoratorsManglePropsStaticDefineSemantics(t *tes...
function TestTSExperimentalDecoratorsManglePropsStaticAssignSemantics (line 2837) | func TestTSExperimentalDecoratorsManglePropsStaticAssignSemantics(t *tes...
function TestTSExperimentalDecoratorsManglePropsStaticMethods (line 2866) | func TestTSExperimentalDecoratorsManglePropsStaticMethods(t *testing.T) {
function TestTSPrintNonFiniteNumberInsideWith (line 2894) | func TestTSPrintNonFiniteNumberInsideWith(t *testing.T) {
function TestTSImportInNodeModulesNameCollisionWithCSS (line 2940) | func TestTSImportInNodeModulesNameCollisionWithCSS(t *testing.T) {
FILE: internal/bundler_tests/bundler_tsconfig_test.go
function TestTsconfigPaths (line 13) | func TestTsconfigPaths(t *testing.T) {
function TestTsconfigPathsNoBaseURL (line 186) | func TestTsconfigPathsNoBaseURL(t *testing.T) {
function TestTsconfigBadPathsNoBaseURL (line 326) | func TestTsconfigBadPathsNoBaseURL(t *testing.T) {
function TestTsconfigPathsOverriddenBaseURL (line 384) | func TestTsconfigPathsOverriddenBaseURL(t *testing.T) {
function TestTsconfigPathsOverriddenBaseURLDifferentDir (line 420) | func TestTsconfigPathsOverriddenBaseURLDifferentDir(t *testing.T) {
function TestTsconfigPathsMissingBaseURL (line 456) | func TestTsconfigPathsMissingBaseURL(t *testing.T) {
function TestTsconfigPathsTypeOnly (line 494) | func TestTsconfigPathsTypeOnly(t *testing.T) {
function TestTsconfigJSX (line 532) | func TestTsconfigJSX(t *testing.T) {
function TestTsconfigNestedJSX (line 555) | func TestTsconfigNestedJSX(t *testing.T) {
function TestTsconfigPreserveJSX (line 604) | func TestTsconfigPreserveJSX(t *testing.T) {
function TestTsconfigPreserveJSXAutomatic (line 626) | func TestTsconfigPreserveJSXAutomatic(t *testing.T) {
function TestTsconfigReactJSX (line 656) | func TestTsconfigReactJSX(t *testing.T) {
function TestTsconfigReactJSXDev (line 684) | func TestTsconfigReactJSXDev(t *testing.T) {
function TestTsconfigReactJSXWithDevInMainConfig (line 711) | func TestTsconfigReactJSXWithDevInMainConfig(t *testing.T) {
function TestTsconfigJsonBaseUrl (line 741) | func TestTsconfigJsonBaseUrl(t *testing.T) {
function TestJsconfigJsonBaseUrl (line 769) | func TestJsconfigJsonBaseUrl(t *testing.T) {
function TestTsconfigJsonAbsoluteBaseUrl (line 797) | func TestTsconfigJsonAbsoluteBaseUrl(t *testing.T) {
function TestTsconfigJsonCommentAllowed (line 825) | func TestTsconfigJsonCommentAllowed(t *testing.T) {
function TestTsconfigJsonTrailingCommaAllowed (line 854) | func TestTsconfigJsonTrailingCommaAllowed(t *testing.T) {
function TestTsconfigJsonExtends (line 882) | func TestTsconfigJsonExtends(t *testing.T) {
function TestTsconfigJsonExtendsAbsolute (line 913) | func TestTsconfigJsonExtendsAbsolute(t *testing.T) {
function TestTsconfigJsonExtendsThreeLevels (line 973) | func TestTsconfigJsonExtendsThreeLevels(t *testing.T) {
function TestTsconfigJsonExtendsLoop (line 1017) | func TestTsconfigJsonExtendsLoop(t *testing.T) {
function TestTsconfigJsonExtendsPackage (line 1044) | func TestTsconfigJsonExtendsPackage(t *testing.T) {
function TestTsconfigJsonOverrideMissing (line 1071) | func TestTsconfigJsonOverrideMissing(t *testing.T) {
function TestTsconfigJsonOverrideNodeModules (line 1113) | func TestTsconfigJsonOverrideNodeModules(t *testing.T) {
function TestTsconfigJsonOverrideInvalid (line 1158) | func TestTsconfigJsonOverrideInvalid(t *testing.T) {
function TestTsconfigJsonNodeModulesImplicitFile (line 1174) | func TestTsconfigJsonNodeModulesImplicitFile(t *testing.T) {
function TestTsconfigJsonNodeModulesTsconfigPathExact (line 1202) | func TestTsconfigJsonNodeModulesTsconfigPathExact(t *testing.T) {
function TestTsconfigJsonNodeModulesTsconfigPathImplicitJson (line 1235) | func TestTsconfigJsonNodeModulesTsconfigPathImplicitJson(t *testing.T) {
function TestTsconfigJsonNodeModulesTsconfigPathDirectory (line 1268) | func TestTsconfigJsonNodeModulesTsconfigPathDirectory(t *testing.T) {
function TestTsconfigJsonNodeModulesTsconfigPathBad (line 1301) | func TestTsconfigJsonNodeModulesTsconfigPathBad(t *testing.T) {
function TestTsconfigJsonInsideNodeModules (line 1336) | func TestTsconfigJsonInsideNodeModules(t *testing.T) {
function TestTsconfigWarningsInsideNodeModules (line 1361) | func TestTsconfigWarningsInsideNodeModules(t *testing.T) {
function TestTsconfigRemoveUnusedImports (line 1385) | func TestTsconfigRemoveUnusedImports(t *testing.T) {
function TestTsconfigPreserveUnusedImports (line 1406) | func TestTsconfigPreserveUnusedImports(t *testing.T) {
function TestTsconfigImportsNotUsedAsValuesPreserve (line 1432) | func TestTsconfigImportsNotUsedAsValuesPreserve(t *testing.T) {
function TestTsconfigPreserveValueImports (line 1461) | func TestTsconfigPreserveValueImports(t *testing.T) {
function TestTsconfigPreserveValueImportsAndImportsNotUsedAsValuesPreserve (line 1496) | func TestTsconfigPreserveValueImportsAndImportsNotUsedAsValuesPreserve(t...
function TestTsconfigUseDefineForClassFieldsES2020 (line 1532) | func TestTsconfigUseDefineForClassFieldsES2020(t *testing.T) {
function TestTsconfigUseDefineForClassFieldsESNext (line 1555) | func TestTsconfigUseDefineForClassFieldsESNext(t *testing.T) {
function TestTsconfigUnrecognizedTargetWarning (line 1578) | func TestTsconfigUnrecognizedTargetWarning(t *testing.T) {
function TestTsconfigIgnoredTargetSilent (line 1608) | func TestTsconfigIgnoredTargetSilent(t *testing.T) {
function TestTsconfigNoBaseURLExtendsPaths (line 1638) | func TestTsconfigNoBaseURLExtendsPaths(t *testing.T) {
function TestTsconfigBaseURLExtendsPaths (line 1671) | func TestTsconfigBaseURLExtendsPaths(t *testing.T) {
function TestTsconfigPathsExtendsBaseURL (line 1703) | func TestTsconfigPathsExtendsBaseURL(t *testing.T) {
function TestTsconfigPathsInNodeModulesIssue2386 (line 1735) | func TestTsconfigPathsInNodeModulesIssue2386(t *testing.T) {
function TestTsconfigWithStatementAlwaysStrictFalse (line 1782) | func TestTsconfigWithStatementAlwaysStrictFalse(t *testing.T) {
function TestTsconfigWithStatementAlwaysStrictTrue (line 1803) | func TestTsconfigWithStatementAlwaysStrictTrue(t *testing.T) {
function TestTsconfigWithStatementStrictFalse (line 1826) | func TestTsconfigWithStatementStrictFalse(t *testing.T) {
function TestTsconfigWithStatementStrictTrue (line 1847) | func TestTsconfigWithStatementStrictTrue(t *testing.T) {
function TestTsconfigWithStatementStrictFalseAlwaysStrictTrue (line 1870) | func TestTsconfigWithStatementStrictFalseAlwaysStrictTrue(t *testing.T) {
function TestTsconfigWithStatementStrictTrueAlwaysStrictFalse (line 1894) | func TestTsconfigWithStatementStrictTrueAlwaysStrictFalse(t *testing.T) {
function TestTsconfigAlwaysStrictTrueEmitDirectivePassThrough (line 1916) | func TestTsconfigAlwaysStrictTrueEmitDirectivePassThrough(t *testing.T) {
function TestTsconfigAlwaysStrictTrueEmitDirectiveFormat (line 1943) | func TestTsconfigAlwaysStrictTrueEmitDirectiveFormat(t *testing.T) {
function TestTsconfigAlwaysStrictTrueEmitDirectiveBundleIIFE (line 1970) | func TestTsconfigAlwaysStrictTrueEmitDirectiveBundleIIFE(t *testing.T) {
function TestTsconfigAlwaysStrictTrueEmitDirectiveBundleCJS (line 1998) | func TestTsconfigAlwaysStrictTrueEmitDirectiveBundleCJS(t *testing.T) {
function TestTsconfigAlwaysStrictTrueEmitDirectiveBundleESM (line 2026) | func TestTsconfigAlwaysStrictTrueEmitDirectiveBundleESM(t *testing.T) {
function TestTsconfigExtendsDotWithoutSlash (line 2054) | func TestTsconfigExtendsDotWithoutSlash(t *testing.T) {
function TestTsconfigExtendsDotDotWithoutSlash (line 2079) | func TestTsconfigExtendsDotDotWithoutSlash(t *testing.T) {
function TestTsconfigExtendsDotWithSlash (line 2103) | func TestTsconfigExtendsDotWithSlash(t *testing.T) {
function TestTsconfigExtendsDotDotWithSlash (line 2130) | func TestTsconfigExtendsDotDotWithSlash(t *testing.T) {
function TestTsconfigExtendsWithExports (line 2156) | func TestTsconfigExtendsWithExports(t *testing.T) {
function TestTsconfigExtendsWithExportsStar (line 2185) | func TestTsconfigExtendsWithExportsStar(t *testing.T) {
function TestTsconfigExtendsWithExportsStarTrailing (line 2214) | func TestTsconfigExtendsWithExportsStarTrailing(t *testing.T) {
function TestTsconfigExtendsWithExportsRequire (line 2243) | func TestTsconfigExtendsWithExportsRequire(t *testing.T) {
function TestTsconfigVerbatimModuleSyntaxTrue (line 2278) | func TestTsconfigVerbatimModuleSyntaxTrue(t *testing.T) {
function TestTsconfigVerbatimModuleSyntaxFalse (line 2304) | func TestTsconfigVerbatimModuleSyntaxFalse(t *testing.T) {
function TestTsconfigExtendsArray (line 2330) | func TestTsconfigExtendsArray(t *testing.T) {
function TestTsconfigExtendsArrayNested (line 2363) | func TestTsconfigExtendsArrayNested(t *testing.T) {
function TestTsconfigIgnoreInsideNodeModules (line 2417) | func TestTsconfigIgnoreInsideNodeModules(t *testing.T) {
function TestTsconfigJsonPackagesExternal (line 2461) | func TestTsconfigJsonPackagesExternal(t *testing.T) {
function TestTsconfigJsonTopLevelMistakeWarning (line 2492) | func TestTsconfigJsonTopLevelMistakeWarning(t *testing.T) {
function TestTsconfigJsonBaseUrlIssue3307 (line 2516) | func TestTsconfigJsonBaseUrlIssue3307(t *testing.T) {
function TestTsconfigJsonAsteriskNameCollisionIssue3354 (line 2543) | func TestTsconfigJsonAsteriskNameCollisionIssue3354(t *testing.T) {
function TestTsconfigJsonConfigDirBaseURL (line 2585) | func TestTsconfigJsonConfigDirBaseURL(t *testing.T) {
function TestTsconfigJsonConfigDirPaths (line 2615) | func TestTsconfigJsonConfigDirPaths(t *testing.T) {
function TestTsconfigJsonConfigDirBaseURLInheritedPaths (line 2647) | func TestTsconfigJsonConfigDirBaseURLInheritedPaths(t *testing.T) {
function TestTsconfigJsonExtendsArrayIssue3898 (line 2680) | func TestTsconfigJsonExtendsArrayIssue3898(t *testing.T) {
function TestTsconfigDecoratorsUseDefineForClassFieldsFalse (line 2732) | func TestTsconfigDecoratorsUseDefineForClassFieldsFalse(t *testing.T) {
FILE: internal/bundler_tests/bundler_yarnpnp_test.go
function TestTsconfigPackageJsonExportsYarnPnP (line 14) | func TestTsconfigPackageJsonExportsYarnPnP(t *testing.T) {
function TestTsconfigStackOverflowYarnPnP (line 87) | func TestTsconfigStackOverflowYarnPnP(t *testing.T) {
function TestWindowsCrossVolumeReferenceYarnPnP (line 153) | func TestWindowsCrossVolumeReferenceYarnPnP(t *testing.T) {
FILE: internal/cache/cache.go
type CacheSet (line 33) | type CacheSet struct
function MakeCacheSet (line 41) | func MakeCacheSet() *CacheSet {
type SourceIndexCache (line 63) | type SourceIndexCache struct
method LenHint (line 82) | func (c *SourceIndexCache) LenHint() uint32 {
method Get (line 91) | func (c *SourceIndexCache) Get(path logger.Path, kind SourceIndexKind)...
method GetGlob (line 104) | func (c *SourceIndexCache) GetGlob(parentSourceIndex uint32, globIndex...
type SourceIndexKind (line 70) | type SourceIndexKind
constant SourceIndexNormal (line 73) | SourceIndexNormal SourceIndexKind = iota
constant SourceIndexJSStubForCSS (line 74) | SourceIndexJSStubForCSS
type sourceIndexKey (line 77) | type sourceIndexKey struct
FILE: internal/cache/cache_ast.go
type CSSCache (line 29) | type CSSCache struct
method Parse (line 41) | func (c *CSSCache) Parse(log logger.Log, source logger.Source, options...
type cssCacheEntry (line 34) | type cssCacheEntry struct
type JSONCache (line 83) | type JSONCache struct
method Parse (line 96) | func (c *JSONCache) Parse(log logger.Log, source logger.Source, option...
type jsonCacheEntry (line 88) | type jsonCacheEntry struct
type JSCache (line 139) | type JSCache struct
method Parse (line 152) | func (c *JSCache) Parse(log logger.Log, source logger.Source, options ...
type jsCacheEntry (line 144) | type jsCacheEntry struct
FILE: internal/cache/cache_fs.go
type FSCache (line 14) | type FSCache struct
method ReadFile (line 25) | func (c *FSCache) ReadFile(fs fs.FS, path string) (contents string, ca...
type fsEntry (line 19) | type fsEntry struct
FILE: internal/cli_helpers/cli_helpers.go
type ErrorWithNote (line 12) | type ErrorWithNote struct
function MakeErrorWithNote (line 17) | func MakeErrorWithNote(text string, note string) *ErrorWithNote {
function ParseLoader (line 24) | func ParseLoader(text string) (api.Loader, *ErrorWithNote) {
FILE: internal/compat/compat.go
type v (line 10) | type v struct
type Semver (line 16) | type Semver struct
method String (line 22) | func (v Semver) String() string {
function compareVersions (line 37) | func compareVersions(a v, b Semver) int {
type versionRange (line 61) | type versionRange struct
function isVersionSupported (line 66) | func isVersionSupported(ranges []versionRange, version Semver) bool {
function SymbolFeature (line 75) | func SymbolFeature(kind ast.SymbolKind) JSFeature {
FILE: internal/compat/compat_test.go
function TestCompareVersions (line 10) | func TestCompareVersions(t *testing.T) {
FILE: internal/compat/css_table.go
type CSSFeature (line 9) | type CSSFeature
method Has (line 43) | func (features CSSFeature) Has(feature CSSFeature) bool {
method ApplyOverrides (line 47) | func (features CSSFeature) ApplyOverrides(overrides CSSFeature, mask C...
constant ColorFunctions (line 12) | ColorFunctions CSSFeature = 1 << iota
constant GradientDoublePosition (line 13) | GradientDoublePosition
constant GradientInterpolation (line 14) | GradientInterpolation
constant GradientMidpoints (line 15) | GradientMidpoints
constant HWB (line 16) | HWB
constant HexRGBA (line 17) | HexRGBA
constant InlineStyle (line 18) | InlineStyle
constant InsetProperty (line 19) | InsetProperty
constant IsPseudoClass (line 20) | IsPseudoClass
constant MediaRange (line 21) | MediaRange
constant Modern_RGB_HSL (line 22) | Modern_RGB_HSL
constant Nesting (line 23) | Nesting
constant RebeccaPurple (line 24) | RebeccaPurple
function UnsupportedCSSFeatures (line 153) | func UnsupportedCSSFeatures(constraints map[Engine]Semver) (unsupported ...
type CSSPrefix (line 171) | type CSSPrefix
constant KhtmlPrefix (line 174) | KhtmlPrefix CSSPrefix = 1 << iota
constant MozPrefix (line 175) | MozPrefix
constant MsPrefix (line 176) | MsPrefix
constant OPrefix (line 177) | OPrefix
constant WebkitPrefix (line 178) | WebkitPrefix
constant NoPrefix (line 180) | NoPrefix CSSPrefix = 0
type prefixData (line 183) | type prefixData struct
function CSSPrefixData (line 400) | func CSSPrefixData(constraints map[Engine]Semver) (entries map[css_ast.D...
FILE: internal/compat/js_table.go
type Engine (line 5) | type Engine
method String (line 22) | func (e Engine) String() string {
method IsBrowser (line 52) | func (e Engine) IsBrowser() bool {
constant Chrome (line 8) | Chrome Engine = iota
constant Deno (line 9) | Deno
constant Edge (line 10) | Edge
constant ES (line 11) | ES
constant Firefox (line 12) | Firefox
constant Hermes (line 13) | Hermes
constant IE (line 14) | IE
constant IOS (line 15) | IOS
constant Node (line 16) | Node
constant Opera (line 17) | Opera
constant Rhino (line 18) | Rhino
constant Safari (line 19) | Safari
type JSFeature (line 60) | type JSFeature
method Has (line 190) | func (features JSFeature) Has(feature JSFeature) bool {
method ApplyOverrides (line 194) | func (features JSFeature) ApplyOverrides(overrides JSFeature, mask JSF...
constant ArbitraryModuleNamespaceNames (line 63) | ArbitraryModuleNamespaceNames JSFeature = 1 << iota
constant ArraySpread (line 64) | ArraySpread
constant Arrow (line 65) | Arrow
constant AsyncAwait (line 66) | AsyncAwait
constant AsyncGenerator (line 67) | AsyncGenerator
constant Bigint (line 68) | Bigint
constant Class (line 69) | Class
constant ClassField (line 70) | ClassField
constant ClassPrivateAccessor (line 71) | ClassPrivateAccessor
constant ClassPrivateBrandCheck (line 72) | ClassPrivateBrandCheck
constant ClassPrivateField (line 73) | ClassPrivateField
constant ClassPrivateMethod (line 74) | ClassPrivateMethod
constant ClassPrivateStaticAccessor (line 75) | ClassPrivateStaticAccessor
constant ClassPrivateStaticField (line 76) | ClassPrivateStaticField
constant ClassPrivateStaticMethod (line 77) | ClassPrivateStaticMethod
constant ClassStaticBlocks (line 78) | ClassStaticBlocks
constant ClassStaticField (line 79) | ClassStaticField
constant ConstAndLet (line 80) | ConstAndLet
constant Decorators (line 81) | Decorators
constant DefaultArgument (line 82) | DefaultArgument
constant Destructuring (line 83) | Destructuring
constant DynamicImport (line 84) | DynamicImport
constant ExponentOperator (line 85) | ExponentOperator
constant ExportStarAs (line 86) | ExportStarAs
constant ForAwait (line 87) | ForAwait
constant ForOf (line 88) | ForOf
constant FromBase64 (line 89) | FromBase64
constant FunctionNameConfigurable (line 90) | FunctionNameConfigurable
constant FunctionOrClassPropertyAccess (line 91) | FunctionOrClassPropertyAccess
constant Generator (line 92) | Generator
constant Hashbang (line 93) | Hashbang
constant ImportAssertions (line 94) | ImportAssertions
constant ImportAttributes (line 95) | ImportAttributes
constant ImportDefer (line 96) | ImportDefer
constant ImportMeta (line 97) | ImportMeta
constant ImportSource (line 98) | ImportSource
constant InlineScript (line 99) | InlineScript
constant LogicalAssignment (line 100) | LogicalAssignment
constant NestedRestBinding (line 101) | NestedRestBinding
constant NewTarget (line 102) | NewTarget
constant NodeColonPrefixImport (line 103) | NodeColonPrefixImport
constant NodeColonPrefixRequire (line 104) | NodeColonPrefixRequire
constant NullishCoalescing (line 105) | NullishCoalescing
constant ObjectAccessors (line 106) | ObjectAccessors
constant ObjectExtensions (line 107) | ObjectExtensions
constant ObjectRestSpread (line 108) | ObjectRestSpread
constant OptionalCatchBinding (line 109) | OptionalCatchBinding
constant OptionalChain (line 110) | OptionalChain
constant RegexpDotAllFlag (line 111) | RegexpDotAllFlag
constant RegexpLookbehindAssertions (line 112) | RegexpLookbehindAssertions
constant RegexpMatchIndices (line 113) | RegexpMatchIndices
constant RegexpNamedCaptureGroups (line 114) | RegexpNamedCaptureGroups
constant RegexpSetNotation (line 115) | RegexpSetNotation
constant RegexpStickyAndUnicodeFlags (line 116) | RegexpStickyAndUnicodeFlags
constant RegexpUnicodePropertyEscapes (line 117) | RegexpUnicodePropertyEscapes
constant RestArgument (line 118) | RestArgument
constant TemplateLiteral (line 119) | TemplateLiteral
constant TopLevelAwait (line 120) | TopLevelAwait
constant TypeofExoticObjectIsObject (line 121) | TypeofExoticObjectIsObject
constant UnicodeEscapes (line 122) | UnicodeEscapes
constant Using (line 123) | Using
function UnsupportedJSFeatures (line 924) | func UnsupportedJSFeatures(constraints map[Engine]Semver) (unsupported J...
FILE: internal/config/config.go
type JSXOptions (line 17) | type JSXOptions struct
type TSJSX (line 28) | type TSJSX
constant TSJSXNone (line 31) | TSJSXNone TSJSX = iota
constant TSJSXPreserve (line 32) | TSJSXPreserve
constant TSJSXReactNative (line 33) | TSJSXReactNative
constant TSJSXReact (line 34) | TSJSXReact
constant TSJSXReactJSX (line 35) | TSJSXReactJSX
constant TSJSXReactJSXDev (line 36) | TSJSXReactJSXDev
type TSOptions (line 39) | type TSOptions struct
type TSConfigJSX (line 45) | type TSConfigJSX struct
method ApplyExtendedConfig (line 54) | func (derived *TSConfigJSX) ApplyExtendedConfig(base TSConfigJSX) {
method ApplyTo (line 69) | func (tsConfig *TSConfigJSX) ApplyTo(jsxOptions *JSXOptions) {
type TSConfig (line 108) | type TSConfig struct
method ApplyExtendedConfig (line 118) | func (derived *TSConfig) ApplyExtendedConfig(base TSConfig) {
method UnusedImportFlags (line 139) | func (cfg *TSConfig) UnusedImportFlags() (flags TSUnusedImportFlags) {
type Platform (line 152) | type Platform
constant PlatformBrowser (line 155) | PlatformBrowser Platform = iota
constant PlatformNode (line 156) | PlatformNode
constant PlatformNeutral (line 157) | PlatformNeutral
type SourceMap (line 160) | type SourceMap
constant SourceMapNone (line 163) | SourceMapNone SourceMap = iota
constant SourceMapInline (line 164) | SourceMapInline
constant SourceMapLinkedWithComment (line 165) | SourceMapLinkedWithComment
constant SourceMapExternalWithoutComment (line 166) | SourceMapExternalWithoutComment
constant SourceMapInlineAndExternal (line 167) | SourceMapInlineAndExternal
type LegalComments (line 170) | type LegalComments
method HasExternalFile (line 180) | func (lc LegalComments) HasExternalFile() bool {
constant LegalCommentsInline (line 173) | LegalCommentsInline LegalComments = iota
constant LegalCommentsNone (line 174) | LegalCommentsNone
constant LegalCommentsEndOfFile (line 175) | LegalCommentsEndOfFile
constant LegalCommentsLinkedWithComment (line 176) | LegalCommentsLinkedWithComment
constant LegalCommentsExternalWithoutComment (line 177) | LegalCommentsExternalWithoutComment
type Loader (line 184) | type Loader
method IsTypeScript (line 230) | func (loader Loader) IsTypeScript() bool {
method IsCSS (line 238) | func (loader Loader) IsCSS() bool {
method CanHaveSourceMap (line 247) | func (loader Loader) CanHaveSourceMap() bool {
constant LoaderNone (line 187) | LoaderNone Loader = iota
constant LoaderBase64 (line 188) | LoaderBase64
constant LoaderBinary (line 189) | LoaderBinary
constant LoaderCopy (line 190) | LoaderCopy
constant LoaderCSS (line 191) | LoaderCSS
constant LoaderDataURL (line 192) | LoaderDataURL
constant LoaderDefault (line 193) | LoaderDefault
constant LoaderEmpty (line 194) | LoaderEmpty
constant LoaderFile (line 195) | LoaderFile
constant LoaderGlobalCSS (line 196) | LoaderGlobalCSS
constant LoaderJS (line 197) | LoaderJS
constant LoaderJSON (line 198) | LoaderJSON
constant LoaderWithTypeJSON (line 199) | LoaderWithTypeJSON
constant LoaderJSX (line 200) | LoaderJSX
constant LoaderLocalCSS (line 201) | LoaderLocalCSS
constant LoaderText (line 202) | LoaderText
constant LoaderTS (line 203) | LoaderTS
constant LoaderTSNoAmbiguousLessThan (line 204) | LoaderTSNoAmbiguousLessThan
constant LoaderTSX (line 205) | LoaderTSX
function LoaderFromFileExtension (line 259) | func LoaderFromFileExtension(extensionToLoader map[string]Loader, base s...
type Format (line 283) | type Format
method KeepESMImportExportSyntax (line 322) | func (f Format) KeepESMImportExportSyntax() bool {
method String (line 326) | func (f Format) String() string {
constant FormatPreserve (line 289) | FormatPreserve Format = iota
constant FormatIIFE (line 305) | FormatIIFE
constant FormatCommonJS (line 312) | FormatCommonJS
constant FormatESModule (line 319) | FormatESModule
type StdinInfo (line 338) | type StdinInfo struct
type WildcardPattern (line 345) | type WildcardPattern struct
type ExternalMatchers (line 350) | type ExternalMatchers struct
method HasMatchers (line 355) | func (matchers ExternalMatchers) HasMatchers() bool {
type ExternalSettings (line 359) | type ExternalSettings struct
type APICall (line 364) | type APICall
constant BuildCall (line 367) | BuildCall APICall = iota
constant TransformCall (line 368) | TransformCall
type Mode (line 371) | type Mode
constant ModePassThrough (line 374) | ModePassThrough Mode = iota
constant ModeConvertFormat (line 375) | ModeConvertFormat
constant ModeBundle (line 376) | ModeBundle
type MaybeBool (line 379) | type MaybeBool
constant Unspecified (line 382) | Unspecified MaybeBool = iota
constant True (line 383) | True
constant False (line 384) | False
type CancelFlag (line 387) | type CancelFlag struct
method Cancel (line 391) | func (flag *CancelFlag) Cancel() {
method DidCancel (line 396) | func (flag *CancelFlag) DidCancel() bool {
type Options (line 400) | type Options struct
type TSImportsNotUsedAsValues (line 516) | type TSImportsNotUsedAsValues
constant TSImportsNotUsedAsValues_None (line 519) | TSImportsNotUsedAsValues_None TSImportsNotUsedAsValues = iota
constant TSImportsNotUsedAsValues_Remove (line 520) | TSImportsNotUsedAsValues_Remove
constant TSImportsNotUsedAsValues_Preserve (line 521) | TSImportsNotUsedAsValues_Preserve
constant TSImportsNotUsedAsValues_Error (line 522) | TSImportsNotUsedAsValues_Error
type TSUnusedImportFlags (line 534) | type TSUnusedImportFlags
constant TSUnusedImport_KeepStmt (line 564) | TSUnusedImport_KeepStmt TSUnusedImportFlags = 1 << iota
constant TSUnusedImport_KeepValues (line 565) | TSUnusedImport_KeepValues
type TSTarget (line 568) | type TSTarget
constant TSTargetUnspecified (line 571) | TSTargetUnspecified TSTarget = iota
constant TSTargetBelowES2022 (line 572) | TSTargetBelowES2022
constant TSTargetAtOrAboveES2022 (line 573) | TSTargetAtOrAboveES2022
type TSAlwaysStrict (line 576) | type TSAlwaysStrict struct
type PathPlaceholder (line 586) | type PathPlaceholder
constant NoPlaceholder (line 589) | NoPlaceholder PathPlaceholder = iota
constant DirPlaceholder (line 593) | DirPlaceholder
constant NamePlaceholder (line 597) | NamePlaceholder
constant HashPlaceholder (line 601) | HashPlaceholder
constant ExtPlaceholder (line 605) | ExtPlaceholder
type PathTemplate (line 608) | type PathTemplate struct
type PathPlaceholders (line 613) | type PathPlaceholders struct
method Get (line 620) | func (placeholders PathPlaceholders) Get(placeholder PathPlaceholder) ...
function TemplateToString (line 634) | func TemplateToString(template []PathTemplate) string {
function HasPlaceholder (line 656) | func HasPlaceholder(template []PathTemplate, placeholder PathPlaceholder...
function SubstituteTemplate (line 665) | func SubstituteTemplate(template []PathTemplate, placeholders PathPlaceh...
function ShouldCallRuntimeRequire (line 696) | func ShouldCallRuntimeRequire(mode Mode, outputFormat Format) bool {
type InjectedDefine (line 700) | type InjectedDefine struct
type InjectedFile (line 706) | type InjectedFile struct
type InjectableExport (line 713) | type InjectableExport struct
function compileFilter (line 721) | func compileFilter(filter string) (result *regexp.Regexp) {
function CompileFilterForPlugin (line 756) | func CompileFilterForPlugin(pluginName string, kind string, filter strin...
function PluginAppliesToPath (line 769) | func PluginAppliesToPath(path logger.Path, filter *regexp.Regexp, namesp...
type Plugin (line 776) | type Plugin struct
type OnStart (line 783) | type OnStart struct
type OnStartResult (line 788) | type OnStartResult struct
type OnResolve (line 793) | type OnResolve struct
type OnResolveArgs (line 800) | type OnResolveArgs struct
type OnResolveResult (line 809) | type OnResolveResult struct
type OnLoad (line 824) | type OnLoad struct
type OnLoadArgs (line 831) | type OnLoadArgs struct
type OnLoadResult (line 836) | type OnLoadResult struct
function PrettyPrintTargetEnvironment (line 852) | func PrettyPrintTargetEnvironment(originalTargetEnv string, unsupportedJ...
type MetafileFormat (line 876) | type MetafileFormat
method MaybeRemoveWhitespace (line 883) | func (mf MetafileFormat) MaybeRemoveWhitespace(fmt string) string {
constant UnminifiedMetafile (line 879) | UnminifiedMetafile MetafileFormat = iota
constant MinifiedMetafile (line 880) | MinifiedMetafile
FILE: internal/config/globals.go
type DefineExpr (line 917) | type DefineExpr struct
type DefineData (line 923) | type DefineData struct
type DefineFlags (line 929) | type DefineFlags
method Has (line 953) | func (flags DefineFlags) Has(flag DefineFlags) bool {
constant CanBeRemovedIfUnused (line 935) | CanBeRemovedIfUnused DefineFlags = 1 << iota
constant CallCanBeUnwrappedIfUnused (line 940) | CallCanBeUnwrappedIfUnused
constant MethodCallsMustBeReplacedWithUndefined (line 946) | MethodCallsMustBeReplacedWithUndefined
constant IsSymbolInstance (line 950) | IsSymbolInstance
function mergeDefineData (line 957) | func mergeDefineData(old DefineData, new DefineData) DefineData {
type ProcessedDefines (line 962) | type ProcessedDefines struct
function ProcessDefines (line 972) | func ProcessDefines(userDefines []DefineData) ProcessedDefines {
FILE: internal/css_ast/css_ast.go
type AST (line 27) | type AST struct
type Composes (line 47) | type Composes struct
type ImportedComposesName (line 75) | type ImportedComposesName struct
type Token (line 85) | type Token struct
method Equal (line 163) | func (a Token) Equal(b Token, check *CrossFileEqualityCheck) bool {
method EqualIgnoringWhitespace (line 246) | func (a Token) EqualIgnoringWhitespace(b Token) bool {
method NumberOrFractionForPercentage (line 292) | func (t Token) NumberOrFractionForPercentage(percentReferenceRange flo...
method ClampedFractionForPercentage (line 314) | func (t Token) ClampedFractionForPercentage() (float64, bool) {
method TurnLengthIntoNumberIfZero (line 333) | func (t *Token) TurnLengthIntoNumberIfZero() bool {
method TurnLengthOrPercentageIntoNumberIfZero (line 342) | func (t *Token) TurnLengthOrPercentageIntoNumberIfZero() bool {
method PercentageValue (line 351) | func (t Token) PercentageValue() string {
method DimensionValue (line 355) | func (t Token) DimensionValue() string {
method DimensionUnit (line 359) | func (t Token) DimensionUnit() string {
method DimensionUnitIsSafeLength (line 363) | func (t Token) DimensionUnitIsSafeLength() bool {
method IsZero (line 373) | func (t Token) IsZero() bool {
method IsOne (line 377) | func (t Token) IsOne() bool {
method IsAngle (line 381) | func (t Token) IsAngle() bool {
type WhitespaceFlags (line 130) | type WhitespaceFlags
constant WhitespaceBefore (line 133) | WhitespaceBefore WhitespaceFlags = 1 << iota
constant WhitespaceAfter (line 134) | WhitespaceAfter
type CrossFileEqualityCheck (line 138) | type CrossFileEqualityCheck struct
method RefsAreEquivalent (line 146) | func (check *CrossFileEqualityCheck) RefsAreEquivalent(a ast.Ref, b as...
function TokensEqual (line 218) | func TokensEqual(a []Token, b []Token, check *CrossFileEqualityCheck) bo...
function HashTokens (line 230) | func HashTokens(hash uint32, tokens []Token) uint32 {
function TokensEqualIgnoringWhitespace (line 260) | func TokensEqualIgnoringWhitespace(a []Token, b []Token) bool {
function TokensAreCommaSeparated (line 272) | func TokensAreCommaSeparated(tokens []Token) bool {
type PercentageFlags (line 284) | type PercentageFlags
constant AllowPercentageBelow0 (line 287) | AllowPercentageBelow0 PercentageFlags = 1 << iota
constant AllowPercentageAbove100 (line 288) | AllowPercentageAbove100
constant AllowAnyPercentage (line 289) | AllowAnyPercentage = AllowPercentageBelow0 | AllowPercentageAbove100
function CloneTokensWithoutImportRecords (line 389) | func CloneTokensWithoutImportRecords(tokensIn []Token) (tokensOut []Toke...
function CloneTokensWithImportRecords (line 400) | func CloneTokensWithImportRecords(
function CloneMediaQueriesWithImportRecords (line 433) | func CloneMediaQueriesWithImportRecords(
type Rule (line 451) | type Rule struct
type R (line 456) | type R interface
function RulesEqual (line 461) | func RulesEqual(a []Rule, b []Rule, check *CrossFileEqualityCheck) bool {
function HashRules (line 473) | func HashRules(hash uint32, rules []Rule) uint32 {
type RAtCharset (line 485) | type RAtCharset struct
method Equal (line 489) | func (a *RAtCharset) Equal(rule R, check *CrossFileEqualityCheck) bool {
method Hash (line 494) | func (r *RAtCharset) Hash() (uint32, bool) {
type ImportConditions (line 500) | type ImportConditions struct
method CloneWithImportRecords (line 525) | func (c *ImportConditions) CloneWithImportRecords(importRecordsIn []as...
type RAtImport (line 533) | type RAtImport struct
method Equal (line 538) | func (*RAtImport) Equal(rule R, check *CrossFileEqualityCheck) bool {
method Hash (line 542) | func (r *RAtImport) Hash() (uint32, bool) {
type RAtKeyframes (line 546) | type RAtKeyframes struct
method Equal (line 560) | func (a *RAtKeyframes) Equal(rule R, check *CrossFileEqualityCheck) bo...
method Hash (line 581) | func (r *RAtKeyframes) Hash() (uint32, bool) {
type KeyframeBlock (line 553) | type KeyframeBlock struct
type RKnownAt (line 595) | type RKnownAt struct
method Equal (line 602) | func (a *RKnownAt) Equal(rule R, check *CrossFileEqualityCheck) bool {
method Hash (line 607) | func (r *RKnownAt) Hash() (uint32, bool) {
type RUnknownAt (line 615) | type RUnknownAt struct
method Equal (line 621) | func (a *RUnknownAt) Equal(rule R, check *CrossFileEqualityCheck) bool {
method Hash (line 626) | func (r *RUnknownAt) Hash() (uint32, bool) {
type RSelector (line 634) | type RSelector struct
method Equal (line 640) | func (a *RSelector) Equal(rule R, check *CrossFileEqualityCheck) bool {
method Hash (line 645) | func (r *RSelector) Hash() (uint32, bool) {
type RQualified (line 653) | type RQualified struct
method Equal (line 659) | func (a *RQualified) Equal(rule R, check *CrossFileEqualityCheck) bool {
method Hash (line 664) | func (r *RQualified) Hash() (uint32, bool) {
type RDeclaration (line 671) | type RDeclaration struct
method Equal (line 679) | func (a *RDeclaration) Equal(rule R, check *CrossFileEqualityCheck) bo...
method Hash (line 684) | func (r *RDeclaration) Hash() (uint32, bool) {
type RBadDeclaration (line 705) | type RBadDeclaration struct
method Equal (line 709) | func (a *RBadDeclaration) Equal(rule R, check *CrossFileEqualityCheck)...
method Hash (line 714) | func (r *RBadDeclaration) Hash() (uint32, bool) {
type RComment (line 720) | type RComment struct
method Equal (line 724) | func (a *RComment) Equal(rule R, check *CrossFileEqualityCheck) bool {
method Hash (line 729) | func (r *RComment) Hash() (uint32, bool) {
type RAtLayer (line 735) | type RAtLayer struct
method Equal (line 741) | func (a *RAtLayer) Equal(rule R, check *CrossFileEqualityCheck) bool {
method Hash (line 761) | func (r *RAtLayer) Hash() (uint32, bool) {
type RAtMedia (line 774) | type RAtMedia struct
method Equal (line 780) | func (a *RAtMedia) Equal(rule R, check *CrossFileEqualityCheck) bool {
method Hash (line 785) | func (r *RAtMedia) Hash() (uint32, bool) {
type MediaQuery (line 792) | type MediaQuery struct
type MQ (line 797) | type MQ interface
function MediaQueriesEqual (line 804) | func MediaQueriesEqual(a []MediaQuery, b []MediaQuery, check *CrossFileE...
function MediaQueriesEqualIgnoringWhitespace (line 816) | func MediaQueriesEqualIgnoringWhitespace(a []MediaQuery, b []MediaQuery)...
function HashMediaQueries (line 828) | func HashMediaQueries(hash uint32, queries []MediaQuery) uint32 {
type MQTypeOp (line 836) | type MQTypeOp
constant MQTypeOpNone (line 839) | MQTypeOpNone MQTypeOp = iota
constant MQTypeOpNot (line 840) | MQTypeOpNot
constant MQTypeOpOnly (line 841) | MQTypeOpOnly
type MQType (line 844) | type MQType struct
method Equal (line 850) | func (q *MQType) Equal(query MQ, check *CrossFileEqualityCheck) bool {
method EqualIgnoringWhitespace (line 858) | func (q *MQType) EqualIgnoringWhitespace(query MQ) bool {
method Hash (line 866) | func (q *MQType) Hash() uint32 {
method CloneWithImportRecords (line 876) | func (q *MQType) CloneWithImportRecords(importRecordsIn []ast.ImportRe...
type MQNot (line 884) | type MQNot struct
method Equal (line 888) | func (q *MQNot) Equal(query MQ, check *CrossFileEqualityCheck) bool {
method EqualIgnoringWhitespace (line 893) | func (q *MQNot) EqualIgnoringWhitespace(query MQ) bool {
method Hash (line 898) | func (q *MQNot) Hash() uint32 {
method CloneWithImportRecords (line 904) | func (q *MQNot) CloneWithImportRecords(importRecordsIn []ast.ImportRec...
type MQBinaryOp (line 909) | type MQBinaryOp
constant MQBinaryOpAnd (line 912) | MQBinaryOpAnd MQBinaryOp = iota
constant MQBinaryOpOr (line 913) | MQBinaryOpOr
type MQBinary (line 916) | type MQBinary struct
method Equal (line 921) | func (q *MQBinary) Equal(query MQ, check *CrossFileEqualityCheck) bool {
method EqualIgnoringWhitespace (line 926) | func (q *MQBinary) EqualIgnoringWhitespace(query MQ) bool {
method Hash (line 931) | func (q *MQBinary) Hash() uint32 {
method CloneWithImportRecords (line 938) | func (q *MQBinary) CloneWithImportRecords(importRecordsIn []ast.Import...
type MQArbitraryTokens (line 948) | type MQArbitraryTokens struct
method Equal (line 952) | func (q *MQArbitraryTokens) Equal(query MQ, check *CrossFileEqualityCh...
method EqualIgnoringWhitespace (line 957) | func (q *MQArbitraryTokens) EqualIgnoringWhitespace(query MQ) bool {
method Hash (line 962) | func (q *MQArbitraryTokens) Hash() uint32 {
method CloneWithImportRecords (line 968) | func (q *MQArbitraryTokens) CloneWithImportRecords(importRecordsIn []a...
type MQPlainOrBoolean (line 973) | type MQPlainOrBoolean struct
method Equal (line 978) | func (q *MQPlainOrBoolean) Equal(query MQ, check *CrossFileEqualityChe...
method EqualIgnoringWhitespace (line 983) | func (q *MQPlainOrBoolean) EqualIgnoringWhitespace(query MQ) bool {
method Hash (line 988) | func (q *MQPlainOrBoolean) Hash() uint32 {
method CloneWithImportRecords (line 995) | func (q *MQPlainOrBoolean) CloneWithImportRecords(importRecordsIn []as...
type MQRange (line 1003) | type MQRange struct
method Equal (line 1012) | func (q *MQRange) Equal(query MQ, check *CrossFileEqualityCheck) bool {
method EqualIgnoringWhitespace (line 1018) | func (q *MQRange) EqualIgnoringWhitespace(query MQ) bool {
method Hash (line 1024) | func (q *MQRange) Hash() uint32 {
method CloneWithImportRecords (line 1034) | func (q *MQRange) CloneWithImportRecords(importRecordsIn []ast.ImportR...
type MQCmp (line 1046) | type MQCmp
method String (line 1057) | func (cmp MQCmp) String() string {
method Dir (line 1071) | func (cmp MQCmp) Dir() int {
method Flip (line 1081) | func (cmp MQCmp) Flip() MQCmp {
method Reverse (line 1095) | func (cmp MQCmp) Reverse() MQCmp {
constant MQCmpNone (line 1049) | MQCmpNone MQCmp = iota
constant MQCmpEq (line 1050) | MQCmpEq
constant MQCmpLt (line 1051) | MQCmpLt
constant MQCmpLe (line 1052) | MQCmpLe
constant MQCmpGt (line 1053) | MQCmpGt
constant MQCmpGe (line 1054) | MQCmpGe
type RAtScope (line 1109) | type RAtScope struct
method Equal (line 1116) | func (a *RAtScope) Equal(rule R, check *CrossFileEqualityCheck) bool {
method Hash (line 1121) | func (r *RAtScope) Hash() (uint32, bool) {
type ComplexSelector (line 1129) | type ComplexSelector struct
method Clone (line 1164) | func (s ComplexSelector) Clone() ComplexSelector {
method ContainsNestingCombinator (line 1172) | func (sel ComplexSelector) ContainsNestingCombinator() bool {
method IsRelative (line 1190) | func (sel ComplexSelector) IsRelative() bool {
method UsesPseudoElement (line 1213) | func (sel ComplexSelector) UsesPseudoElement() bool {
method Equal (line 1236) | func (a ComplexSelector) Equal(b ComplexSelector, check *CrossFileEqua...
function ComplexSelectorsEqual (line 1133) | func ComplexSelectorsEqual(a []ComplexSelector, b []ComplexSelector, che...
function HashComplexSelectors (line 1145) | func HashComplexSelectors(hash uint32, selectors []ComplexSelector) uint...
function tokensContainAmpersandRecursive (line 1201) | func tokensContainAmpersandRecursive(tokens []Token) bool {
type Combinator (line 1266) | type Combinator struct
type CompoundSelector (line 1271) | type CompoundSelector struct
method IsSingleAmpersand (line 1281) | func (sel CompoundSelector) IsSingleAmpersand() bool {
method IsInvalidBecauseEmpty (line 1285) | func (sel CompoundSelector) IsInvalidBecauseEmpty() bool {
method Range (line 1289) | func (sel CompoundSelector) Range() (r logger.Range) {
method Clone (line 1307) | func (sel CompoundSelector) Clone() CompoundSelector {
type NameToken (line 1327) | type NameToken struct
method Equal (line 1333) | func (a NameToken) Equal(b NameToken) bool {
type NamespacedName (line 1337) | type NamespacedName struct
method Range (line 1345) | func (n NamespacedName) Range() logger.Range {
method Clone (line 1353) | func (n NamespacedName) Clone() NamespacedName {
method Equal (line 1362) | func (a NamespacedName) Equal(b NamespacedName) bool {
type SubclassSelector (line 1367) | type SubclassSelector struct
type SS (line 1372) | type SS interface
type SSHash (line 1378) | type SSHash struct
method Equal (line 1382) | func (a *SSHash) Equal(ss SS, check *CrossFileEqualityCheck) bool {
method Hash (line 1387) | func (ss *SSHash) Hash() uint32 {
method Clone (line 1392) | func (ss *SSHash) Clone() SS {
type SSClass (line 1397) | type SSClass struct
method Equal (line 1401) | func (a *SSClass) Equal(ss SS, check *CrossFileEqualityCheck) bool {
method Hash (line 1406) | func (ss *SSClass) Hash() uint32 {
method Clone (line 1411) | func (ss *SSClass) Clone() SS {
type SSAttribute (line 1416) | type SSAttribute struct
method Equal (line 1423) | func (a *SSAttribute) Equal(ss SS, check *CrossFileEqualityCheck) bool {
method Hash (line 1429) | func (ss *SSAttribute) Hash() uint32 {
method Clone (line 1437) | func (ss *SSAttribute) Clone() SS {
type SSPseudoClass (line 1443) | type SSPseudoClass struct
method Equal (line 1449) | func (a *SSPseudoClass) Equal(ss SS, check *CrossFileEqualityCheck) bo...
method Hash (line 1454) | func (ss *SSPseudoClass) Hash() uint32 {
method Clone (line 1461) | func (ss *SSPseudoClass) Clone() SS {
type PseudoClassKind (line 1469) | type PseudoClassKind
method HasNthIndex (line 1484) | func (kind PseudoClassKind) HasNthIndex() bool {
method String (line 1488) | func (kind PseudoClassKind) String() string {
constant PseudoClassGlobal (line 1472) | PseudoClassGlobal PseudoClassKind = iota
constant PseudoClassHas (line 1473) | PseudoClassHas
constant PseudoClassIs (line 1474) | PseudoClassIs
constant PseudoClassLocal (line 1475) | PseudoClassLocal
constant PseudoClassNot (line 1476) | PseudoClassNot
constant PseudoClassNthChild (line 1477) | PseudoClassNthChild
constant PseudoClassNthLastChild (line 1478) | PseudoClassNthLastChild
constant PseudoClassNthLastOfType (line 1479) | PseudoClassNthLastOfType
constant PseudoClassNthOfType (line 1480) | PseudoClassNthOfType
constant PseudoClassWhere (line 1481) | PseudoClassWhere
type NthIndex (line 1516) | type NthIndex struct
method Minify (line 1521) | func (index *NthIndex) Minify() {
type SSPseudoClassWithSelectorList (line 1553) | type SSPseudoClassWithSelectorList struct
method Equal (line 1559) | func (a *SSPseudoClassWithSelectorList) Equal(ss SS, check *CrossFileE...
method Hash (line 1564) | func (ss *SSPseudoClassWithSelectorList) Hash() uint32 {
method Clone (line 1573) | func (ss *SSPseudoClassWithSelectorList) Clone() SS {
FILE: internal/css_ast/css_decl_table.go
type D (line 10) | type D
constant DUnknown (line 13) | DUnknown D = iota
constant DAlignContent (line 14) | DAlignContent
constant DAlignItems (line 15) | DAlignItems
constant DAlignSelf (line 16) | DAlignSelf
constant DAlignmentBaseline (line 17) | DAlignmentBaseline
constant DAll (line 18) | DAll
constant DAnimation (line 19) | DAnimation
constant DAnimationDelay (line 20) | DAnimationDelay
constant DAnimationDirection (line 21) | DAnimationDirection
constant DAnimationDuration (line 22) | DAnimationDuration
constant DAnimationFillMode (line 23) | DAnimationFillMode
constant DAnimationIterationCount (line 24) | DAnimationIterationCount
constant DAnimationName (line 25) | DAnimationName
constant DAnimationPlayState (line 26) | DAnimationPlayState
constant DAnimationTimingFunction (line 27) | DAnimationTimingFunction
constant DAppearance (line 28) | DAppearance
constant DBackdropFilter (line 29) | DBackdropFilter
constant DBackfaceVisibility (line 30) | DBackfaceVisibility
constant DBackground (line 31) | DBackground
constant DBackgroundAttachment (line 32) | DBackgroundAttachment
constant DBackgroundClip (line 33) | DBackgroundClip
constant DBackgroundColor (line 34) | DBackgroundColor
constant DBackgroundImage (line 35) | DBackgroundImage
constant DBackgroundOrigin (line 36) | DBackgroundOrigin
constant DBackgroundPosition (line 37) | DBackgroundPosition
constant DBackgroundPositionX (line 38) | DBackgroundPositionX
constant DBackgroundPositionY (line 39) | DBackgroundPositionY
constant DBackgroundRepeat (line 40) | DBackgroundRepeat
constant DBackgroundSize (line 41) | DBackgroundSize
constant DBaselineShift (line 42) | DBaselineShift
constant DBlockSize (line 43) | DBlockSize
constant DBorder (line 44) | DBorder
constant DBorderBlockEnd (line 45) | DBorderBlockEnd
constant DBorderBlockEndColor (line 46) | DBorderBlockEndColor
constant DBorderBlockEndStyle (line 47) | DBorderBlockEndStyle
constant DBorderBlockEndWidth (line 48) | DBorderBlockEndWidth
constant DBorderBlockStart (line 49) | DBorderBlockStart
constant DBorderBlockStartColor (line 50) | DBorderBlockStartColor
constant DBorderBlockStartStyle (line 51) | DBorderBlockStartStyle
constant DBorderBlockStartWidth (line 52) | DBorderBlockStartWidth
constant DBorderBottom (line 53) | DBorderBottom
constant DBorderBottomColor (line 54) | DBorderBottomColor
constant DBorderBottomLeftRadius (line 55) | DBorderBottomLeftRadius
constant DBorderBottomRightRadius (line 56) | DBorderBottomRightRadius
constant DBorderBottomStyle (line 57) | DBorderBottomStyle
constant DBorderBottomWidth (line 58) | DBorderBottomWidth
constant DBorderCollapse (line 59) | DBorderCollapse
constant DBorderColor (line 60) | DBorderColor
constant DBorderImage (line 61) | DBorderImage
constant DBorderImageOutset (line 62) | DBorderImageOutset
constant DBorderImageRepeat (line 63) | DBorderImageRepeat
constant DBorderImageSlice (line 64) | DBorderImageSlice
constant DBorderImageSource (line 65) | DBorderImageSource
constant DBorderImageWidth (line 66) | DBorderImageWidth
constant DBorderInlineEnd (line 67) | DBorderInlineEnd
constant DBorderInlineEndColor (line 68) | DBorderInlineEndColor
constant DBorderInlineEndStyle (line 69) | DBorderInlineEndStyle
constant DBorderInlineEndWidth (line 70) | DBorderInlineEndWidth
constant DBorderInlineStart (line 71) | DBorderInlineStart
constant DBorderInlineStartColor (line 72) | DBorderInlineStartColor
constant DBorderInlineStartStyle (line 73) | DBorderInlineStartStyle
constant DBorderInlineStartWidth (line 74) | DBorderInlineStartWidth
constant DBorderLeft (line 75) | DBorderLeft
constant DBorderLeftColor (line 76) | DBorderLeftColor
constant DBorderLeftStyle (line 77) | DBorderLeftStyle
constant DBorderLeftWidth (line 78) | DBorderLeftWidth
constant DBorderRadius (line 79) | DBorderRadius
constant DBorderRight (line 80) | DBorderRight
constant DBorderRightColor (line 81) | DBorderRightColor
constant DBorderRightStyle (line 82) | DBorderRightStyle
constant DBorderRightWidth (line 83) | DBorderRightWidth
constant DBorderSpacing (line 84) | DBorderSpacing
constant DBorderStyle (line 85) | DBorderStyle
constant DBorderTop (line 86) | DBorderTop
constant DBorderTopColor (line 87) | DBorderTopColor
constant DBorderTopLeftRadius (line 88) | DBorderTopLeftRadius
constant DBorderTopRightRadius (line 89) | DBorderTopRightRadius
constant DBorderTopStyle (line 90) | DBorderTopStyle
constant DBorderTopWidth (line 91) | DBorderTopWidth
constant DBorderWidth (line 92) | DBorderWidth
constant DBottom (line 93) | DBottom
constant DBoxDecorationBreak (line 94) | DBoxDecorationBreak
constant DBoxShadow (line 95) | DBoxShadow
constant DBoxSizing (line 96) | DBoxSizing
constant DBreakAfter (line 97) | DBreakAfter
constant DBreakBefore (line 98) | DBreakBefore
constant DBreakInside (line 99) | DBreakInside
constant DCaptionSide (line 100) | DCaptionSide
constant DCaretColor (line 101) | DCaretColor
constant DClear (line 102) | DClear
constant DClip (line 103) | DClip
constant DClipPath (line 104) | DClipPath
constant DClipRule (line 105) | DClipRule
constant DColor (line 106) | DColor
constant DColorInterpolation (line 107) | DColorInterpolation
constant DColorInterpolationFilters (line 108) | DColorInterpolationFilters
constant DColumnCount (line 109) | DColumnCount
constant DColumnFill (line 110) | DColumnFill
constant DColumnGap (line 111) | DColumnGap
constant DColumnRule (line 112) | DColumnRule
constant DColumnRuleColor (line 113) | DColumnRuleColor
constant DColumnRuleStyle (line 114) | DColumnRuleStyle
constant DColumnRuleWidth (line 115) | DColumnRuleWidth
constant DColumnSpan (line 116) | DColumnSpan
constant DColumnWidth (line 117) | DColumnWidth
constant DColumns (line 118) | DColumns
constant DComposes (line 119) | DComposes
constant DContainer (line 120) | DContainer
constant DContainerName (line 121) | DContainerName
constant DContainerType (line 122) | DContainerType
constant DContent (line 123) | DContent
constant DCounterIncrement (line 124) | DCounterIncrement
constant DCounterReset (line 125) | DCounterReset
constant DCssFloat (line 126) | DCssFloat
constant DCssText (line 127) | DCssText
constant DCursor (line 128) | DCursor
constant DDirection (line 129) | DDirection
constant DDisplay (line 130) | DDisplay
constant DDominantBaseline (line 131) | DDominantBaseline
constant DEmptyCells (line 132) | DEmptyCells
constant DFill (line 133) | DFill
constant DFillOpacity (line 134) | DFillOpacity
constant DFillRule (line 135) | DFillRule
constant DFilter (line 136) | DFilter
constant DFlex (line 137) | DFlex
constant DFlexBasis (line 138) | DFlexBasis
constant DFlexDirection (line 139) | DFlexDirection
constant DFlexFlow (line 140) | DFlexFlow
constant DFlexGrow (line 141) | DFlexGrow
constant DFlexShrink (line 142) | DFlexShrink
constant DFlexWrap (line 143) | DFlexWrap
constant DFloat (line 144) | DFloat
constant DFloodColor (line 145) | DFloodColor
constant DFloodOpacity (line 146) | DFloodOpacity
constant DFont (line 147) | DFont
constant DFontFamily (line 148) | DFontFamily
constant DFontFeatureSettings (line 149) | DFontFeatureSettings
constant DFontKerning (line 150) | DFontKerning
constant DFontSize (line 151) | DFontSize
constant DFontSizeAdjust (line 152) | DFontSizeAdjust
constant DFontStretch (line 153) | DFontStretch
constant DFontStyle (line 154) | DFontStyle
constant DFontSynthesis (line 155) | DFontSynthesis
constant DFontVariant (line 156) | DFontVariant
constant DFontVariantCaps (line 157) | DFontVariantCaps
constant DFontVariantEastAsian (line 158) | DFontVariantEastAsian
constant DFontVariantLigatures (line 159) | DFontVariantLigatures
constant DFontVariantNumeric (line 160) | DFontVariantNumeric
constant DFontVariantPosition (line 161) | DFontVariantPosition
constant DFontWeight (line 162) | DFontWeight
constant DGap (line 163) | DGap
constant DGlyphOrientationVertical (line 164) | DGlyphOrientationVertical
constant DGrid (line 165) | DGrid
constant DGridArea (line 166) | DGridArea
constant DGridAutoColumns (line 167) | DGridAutoColumns
constant DGridAutoFlow (line 168) | DGridAutoFlow
constant DGridAutoRows (line 169) | DGridAutoRows
constant DGridColumn (line 170) | DGridColumn
constant DGridColumnEnd (line 171) | DGridColumnEnd
constant DGridColumnGap (line 172) | DGridColumnGap
constant DGridColumnStart (line 173) | DGridColumnStart
constant DGridGap (line 174) | DGridGap
constant DGridRow (line 175) | DGridRow
constant DGridRowEnd (line 176) | DGridRowEnd
constant DGridRowGap (line 177) | DGridRowGap
constant DGridRowStart (line 178) | DGridRowStart
constant DGridTemplate (line 179) | DGridTemplate
constant DGridTemplateAreas (line 180) | DGridTemplateAreas
constant DGridTemplateColumns (line 181) | DGridTemplateColumns
constant DGridTemplateRows (line 182) | DGridTemplateRows
constant DHeight (line 183) | DHeight
constant DHyphens (line 184) | DHyphens
constant DImageOrientation (line 185) | DImageOrientation
constant DImageRendering (line 186) | DImageRendering
constant DInitialLetter (line 187) | DInitialLetter
constant DInlineSize (line 188) | DInlineSize
constant DInset (line 189) | DInset
constant DJustifyContent (line 190) | DJustifyContent
constant DJustifyItems (line 191) | DJustifyItems
constant DJustifySelf (line 192) | DJustifySelf
constant DLeft (line 193) | DLeft
constant DLetterSpacing (line 194) | DLetterSpacing
constant DLightingColor (line 195) | DLightingColor
constant DLineBreak (line 196) | DLineBreak
constant DLineHeight (line 197) | DLineHeight
constant DListStyle (line 198) | DListStyle
constant DListStyleImage (line 199) | DListStyleImage
constant DListStylePosition (line 200) | DListStylePosition
constant DListStyleType (line 201) | DListStyleType
constant DMargin (line 202) | DMargin
constant DMarginBlockEnd (line 203) | DMarginBlockEnd
constant DMarginBlockStart (line 204) | DMarginBlockStart
constant DMarginBottom (line 205) | DMarginBottom
constant DMarginInlineEnd (line 206) | DMarginInlineEnd
constant DMarginInlineStart (line 207) | DMarginInlineStart
constant DMarginLeft (line 208) | DMarginLeft
constant DMarginRight (line 209) | DMarginRight
constant DMarginTop (line 210) | DMarginTop
constant DMarker (line 211) | DMarker
constant DMarkerEnd (line 212) | DMarkerEnd
constant DMarkerMid (line 213) | DMarkerMid
constant DMarkerStart (line 214) | DMarkerStart
constant DMask (line 215) | DMask
constant DMaskComposite (line 216) | DMaskComposite
constant DMaskImage (line 217) | DMaskImage
constant DMaskOrigin (line 218) | DMaskOrigin
constant DMaskPosition (line 219) | DMaskPosition
constant DMaskRepeat (line 220) | DMaskRepeat
constant DMaskSize (line 221) | DMaskSize
constant DMaskType (line 222) | DMaskType
constant DMaxBlockSize (line 223) | DMaxBlockSize
constant DMaxHeight (line 224) | DMaxHeight
constant DMaxInlineSize (line 225) | DMaxInlineSize
constant DMaxWidth (line 226) | DMaxWidth
constant DMinBlockSize (line 227) | DMinBlockSize
constant DMinHeight (line 228) | DMinHeight
constant DMinInlineSize (line 229) | DMinInlineSize
constant DMinWidth (line 230) | DMinWidth
constant DObjectFit (line 231) | DObjectFit
constant DObjectPosition (line 232) | DObjectPosition
constant DOpacity (line 233) | DOpacity
constant DOrder (line 234) | DOrder
constant DOrphans (line 235) | DOrphans
constant DOutline (line 236) | DOutline
constant DOutlineColor (line 237) | DOutlineColor
constant DOutlineOffset (line 238) | DOutlineOffset
constant DOutlineStyle (line 239) | DOutlineStyle
constant DOutlineWidth (line 240) | DOutlineWidth
constant DOverflow (line 241) | DOverflow
constant DOverflowAnchor (line 242) | DOverflowAnchor
constant DOverflowWrap (line 243) | DOverflowWrap
constant DOverflowX (line 244) | DOverflowX
constant DOverflowY (line 245) | DOverflowY
constant DOverscrollBehavior (line 246) | DOverscrollBehavior
constant DOverscrollBehaviorBlock (line 247) | DOverscrollBehaviorBlock
constant DOverscrollBehaviorInline (line 248) | DOverscrollBehaviorInline
constant DOverscrollBehaviorX (line 249) | DOverscrollBehaviorX
constant DOverscrollBehaviorY (line 250) | DOverscrollBehaviorY
constant DPadding (line 251) | DPadding
constant DPaddingBlockEnd (line 252) | DPaddingBlockEnd
constant DPaddingBlockStart (line 253) | DPaddingBlockStart
constant DPaddingBottom (line 254) | DPaddingBottom
constant DPaddingInlineEnd (line 255) | DPaddingInlineEnd
constant DPaddingInlineStart (line 256) | DPaddingInlineStart
constant DPaddingLeft (line 257) | DPaddingLeft
constant DPaddingRight (line 258) | DPaddingRight
constant DPaddingTop (line 259) | DPaddingTop
constant DPageBreakAfter (line 260) | DPageBreakAfter
constant DPageBreakBefore (line 261) | DPageBreakBefore
constant DPageBreakInside (line 262) | DPageBreakInside
constant DPaintOrder (line 263) | DPaintOrder
constant DPerspective (line 264) | DPerspective
constant DPerspectiveOrigin (line 265) | DPerspectiveOrigin
constant DPlaceContent (line 266) | DPlaceContent
constant DPlaceItems (line 267) | DPlaceItems
constant DPlaceSelf (line 268) | DPlaceSelf
constant DPointerEvents (line 269) | DPointerEvents
constant DPosition (line 270) | DPosition
constant DPrintColorAdjust (line 271) | DPrintColorAdjust
constant DQuotes (line 272) | DQuotes
constant DResize (line 273) | DResize
constant DRight (line 274) | DRight
constant DRotate (line 275) | DRotate
constant DRowGap (line 276) | DRowGap
constant DRubyAlign (line 277) | DRubyAlign
constant DRubyPosition (line 278) | DRubyPosition
constant DScale (line 279) | DScale
constant DScrollBehavior (line 280) | DScrollBehavior
constant DShapeRendering (line 281) | DShapeRendering
constant DStopColor (line 282) | DStopColor
constant DStopOpacity (line 283) | DStopOpacity
constant DStroke (line 284) | DStroke
constant DStrokeDasharray (line 285) | DStrokeDasharray
constant DStrokeDashoffset (line 286) | DStrokeDashoffset
constant DStrokeLinecap (line 287) | DStrokeLinecap
constant DStrokeLinejoin (line 288) | DStrokeLinejoin
constant DStrokeMiterlimit (line 289) | DStrokeMiterlimit
constant DStrokeOpacity (line 290) | DStrokeOpacity
constant DStrokeWidth (line 291) | DStrokeWidth
constant DTabSize (line 292) | DTabSize
constant DTableLayout (line 293) | DTableLayout
constant DTextAlign (line 294) | DTextAlign
constant DTextAlignLast (line 295) | DTextAlignLast
constant DTextAnchor (line 296) | DTextAnchor
constant DTextCombineUpright (line 297) | DTextCombineUpright
constant DTextDecoration (line 298) | DTextDecoration
constant DTextDecorationColor (line 299) | DTextDecorationColor
constant DTextDecorationLine (line 300) | DTextDecorationLine
constant DTextDecorationSkip (line 301) | DTextDecorationSkip
constant DTextDecorationStyle (line 302) | DTextDecorationStyle
constant DTextEmphasis (line 303) | DTextEmphasis
constant DTextEmphasisColor (line 304) | DTextEmphasisColor
constant DTextEmphasisPosition (line 305) | DTextEmphasisPosition
constant DTextEmphasisStyle (line 306) | DTextEmphasisStyle
constant DTextIndent (line 307) | DTextIndent
constant DTextJustify (line 308) | DTextJustify
constant DTextOrientation (line 309) | DTextOrientation
constant DTextOverflow (line 310) | DTextOverflow
constant DTextRendering (line 311) | DTextRendering
constant DTextShadow (line 312) | DTextShadow
constant DTextSizeAdjust (line 313) | DTextSizeAdjust
constant DTextTransform (line 314) | DTextTransform
constant DTextUnderlinePosition (line 315) | DTextUnderlinePosition
constant DTop (line 316) | DTop
constant DTouchAction (line 317) | DTouchAction
constant DTransform (line 318) | DTransform
constant DTransformBox (line 319) | DTransformBox
constant DTransformOrigin (line 320) | DTransformOrigin
constant DTransformStyle (line 321) | DTransformStyle
constant DTransition (line 322) | DTransition
constant DTransitionDelay (line 323) | DTransitionDelay
constant DTransitionDuration (line 324) | DTransitionDuration
constant DTransitionProperty (line 325) | DTransitionProperty
constant DTransitionTimingFunction (line 326) | DTransitionTimingFunction
constant DTranslate (line 327) | DTranslate
constant DUnicodeBidi (line 328) | DUnicodeBidi
constant DUserSelect (line 329) | DUserSelect
constant DVerticalAlign (line 330) | DVerticalAlign
constant DVisibility (line 331) | DVisibility
constant DWhiteSpace (line 332) | DWhiteSpace
constant DWidows (line 333) | DWidows
constant DWidth (line 334) | DWidth
constant DWillChange (line 335) | DWillChange
constant DWordBreak (line 336) | DWordBreak
constant DWordSpacing (line 337) | DWordSpacing
constant DWordWrap (line 338) | DWordWrap
constant DWritingMode (line 339) | DWritingMode
constant DZIndex (line 340) | DZIndex
constant DZoom (line 341) | DZoom
function MaybeCorrectDeclarationTypo (line 678) | func MaybeCorrectDeclarationTypo(text string) (string, bool) {
FILE: internal/css_lexer/css_lexer.go
type T (line 14) | type T
method String (line 110) | func (t T) String() string {
method IsNumeric (line 114) | func (t T) IsNumeric() bool {
constant eof (line 16) | eof = -1
constant TEndOfFile (line 19) | TEndOfFile T = iota
constant TAtKeyword (line 21) | TAtKeyword
constant TUnterminatedString (line 22) | TUnterminatedString
constant TBadURL (line 23) | TBadURL
constant TCDC (line 24) | TCDC
constant TCDO (line 25) | TCDO
constant TCloseBrace (line 26) | TCloseBrace
constant TCloseBracket (line 27) | TCloseBracket
constant TCloseParen (line 28) | TCloseParen
constant TColon (line 29) | TColon
constant TComma (line 30) | TComma
constant TDelim (line 31) | TDelim
constant TDelimAmpersand (line 32) | TDelimAmpersand
constant TDelimAsterisk (line 33) | TDelimAsterisk
constant TDelimBar (line 34) | TDelimBar
constant TDelimCaret (line 35) | TDelimCaret
constant TDelimDollar (line 36) | TDelimDollar
constant TDelimDot (line 37) | TDelimDot
constant TDelimEquals (line 38) | TDelimEquals
constant TDelimExclamation (line 39) | TDelimExclamation
constant TDelimGreaterThan (line 40) | TDelimGreaterThan
constant TDelimLessThan (line 41) | TDelimLessThan
constant TDelimMinus (line 42) | TDelimMinus
constant TDelimPlus (line 43) | TDelimPlus
constant TDelimSlash (line 44) | TDelimSlash
constant TDelimTilde (line 45) | TDelimTilde
constant TDimension (line 46) | TDimension
constant TFunction (line 47) | TFunction
constant THash (line 48) | THash
constant TIdent (line 49) | TIdent
constant TNumber (line 50) | TNumber
constant TOpenBrace (line 51) | TOpenBrace
constant TOpenBracket (line 52) | TOpenBracket
constant TOpenParen (line 53) | TOpenParen
constant TPercentage (line 54) | TPercentage
constant TSemicolon (line 55) | TSemicolon
constant TString (line 56) | TString
constant TURL (line 57) | TURL
constant TWhitespace (line 58) | TWhitespace
constant TSymbol (line 63) | TSymbol
type TokenFlags (line 118) | type TokenFlags
constant IsID (line 121) | IsID TokenFlags = 1 << iota
constant DidWarnAboutSingleLineComment (line 122) | DidWarnAboutSingleLineComment
type Token (line 128) | type Token struct
method DecodedText (line 135) | func (token Token) DecodedText(contents string) string {
type lexer (line 174) | type lexer struct
method step (line 256) | func (lexer *lexer) step() {
method next (line 279) | func (lexer *lexer) next() {
method consumeToEndOfMultiLineComment (line 493) | func (lexer *lexer) consumeToEndOfMultiLineComment(startRange logger.R...
method isValidEscape (line 563) | func (lexer *lexer) isValidEscape() bool {
method wouldStartIdentifier (line 571) | func (lexer *lexer) wouldStartIdentifier() bool {
method wouldStartNumber (line 663) | func (lexer *lexer) wouldStartNumber() bool {
method consumeName (line 690) | func (lexer *lexer) consumeName() string {
method consumeEscape (line 728) | func (lexer *lexer) consumeEscape() rune {
method consumeIdentLike (line 759) | func (lexer *lexer) consumeIdentLike() T {
method consumeURL (line 795) | func (lexer *lexer) consumeURL(matchingLoc logger.Loc) T {
method consumeString (line 866) | func (lexer *lexer) consumeString() T {
method consumeNumeric (line 900) | func (lexer *lexer) consumeNumeric() T {
type Comment (line 189) | type Comment struct
type TokenizeResult (line 195) | type TokenizeResult struct
type Options (line 203) | type Options struct
function Tokenize (line 207) | func Tokenize(log logger.Log, source logger.Source, options Options) Tok...
function containsAtPreserveOrAtLicense (line 554) | func containsAtPreserveOrAtLicense(text string) bool {
function WouldStartIdentifierWithoutEscapes (line 594) | func WouldStartIdentifierWithoutEscapes(text string) bool {
function RangeOfIdentifier (line 615) | func RangeOfIdentifier(source logger.Source, loc logger.Loc) logger.Range {
function IsNameStart (line 956) | func IsNameStart(c rune) bool {
function IsNameContinue (line 960) | func IsNameContinue(c rune) bool {
function isNewline (line 964) | func isNewline(c rune) bool {
function isWhitespace (line 972) | func isWhitespace(c rune) bool {
function isHex (line 980) | func isHex(c rune) (int, bool) {
function isNonPrintable (line 993) | func isNonPrintable(c rune) bool {
function decodeEscapesInToken (line 997) | func decodeEscapesInToken(inner string) string {
FILE: internal/css_lexer/css_lexer_test.go
function lexToken (line 11) | func lexToken(contents string) (T, string) {
function lexerError (line 21) | func lexerError(contents string) string {
function TestTokens (line 31) | func TestTokens(t *testing.T) {
function TestStringParsing (line 85) | func TestStringParsing(t *testing.T) {
function TestURLParsing (line 107) | func TestURLParsing(t *testing.T) {
function TestComment (line 125) | func TestComment(t *testing.T) {
function TestString (line 132) | func TestString(t *testing.T) {
function TestBOM (line 141) | func TestBOM(t *testing.T) {
FILE: internal/css_parser/css_color_spaces.go
type colorSpace (line 14) | type colorSpace
method isPolar (line 34) | func (colorSpace colorSpace) isPolar() bool {
constant colorSpace_a98_rgb (line 17) | colorSpace_a98_rgb colorSpace = iota
constant colorSpace_display_p3 (line 18) | colorSpace_display_p3
constant colorSpace_hsl (line 19) | colorSpace_hsl
constant colorSpace_hwb (line 20) | colorSpace_hwb
constant colorSpace_lab (line 21) | colorSpace_lab
constant colorSpace_lch (line 22) | colorSpace_lch
constant colorSpace_oklab (line 23) | colorSpace_oklab
constant colorSpace_oklch (line 24) | colorSpace_oklch
constant colorSpace_prophoto_rgb (line 25) | colorSpace_prophoto_rgb
constant colorSpace_rec2020 (line 26) | colorSpace_rec2020
constant colorSpace_srgb (line 27) | colorSpace_srgb
constant colorSpace_srgb_linear (line 28) | colorSpace_srgb_linear
constant colorSpace_xyz (line 29) | colorSpace_xyz
constant colorSpace_xyz_d50 (line 30) | colorSpace_xyz_d50
constant colorSpace_xyz_d65 (line 31) | colorSpace_xyz_d65
type hueMethod (line 42) | type hueMethod
constant shorterHue (line 45) | shorterHue hueMethod = iota
constant longerHue (line 46) | longerHue
constant increasingHue (line 47) | increasingHue
constant decreasingHue (line 48) | decreasingHue
function lin_srgb (line 51) | func lin_srgb(r F64, g F64, b F64) (F64, F64, F64) {
function gam_srgb (line 62) | func gam_srgb(r F64, g F64, b F64) (F64, F64, F64) {
function lin_srgb_to_xyz (line 73) | func lin_srgb_to_xyz(r F64, g F64, b F64) (F64, F64, F64) {
function xyz_to_lin_srgb (line 82) | func xyz_to_lin_srgb(x F64, y F64, z F64) (F64, F64, F64) {
function lin_p3 (line 91) | func lin_p3(r F64, g F64, b F64) (F64, F64, F64) {
function gam_p3 (line 95) | func gam_p3(r F64, g F64, b F64) (F64, F64, F64) {
function lin_p3_to_xyz (line 99) | func lin_p3_to_xyz(r F64, g F64, b F64) (F64, F64, F64) {
function xyz_to_lin_p3 (line 108) | func xyz_to_lin_p3(x F64, y F64, z F64) (F64, F64, F64) {
function lin_prophoto (line 117) | func lin_prophoto(r F64, g F64, b F64) (F64, F64, F64) {
function gam_prophoto (line 129) | func gam_prophoto(r F64, g F64, b F64) (F64, F64, F64) {
function lin_prophoto_to_xyz (line 141) | func lin_prophoto_to_xyz(r F64, g F64, b F64) (F64, F64, F64) {
function xyz_to_lin_prophoto (line 150) | func xyz_to_lin_prophoto(x F64, y F64, z F64) (F64, F64, F64) {
function lin_a98rgb (line 159) | func lin_a98rgb(r F64, g F64, b F64) (F64, F64, F64) {
function gam_a98rgb (line 166) | func gam_a98rgb(r F64, g F64, b F64) (F64, F64, F64) {
function lin_a98rgb_to_xyz (line 173) | func lin_a98rgb_to_xyz(r F64, g F64, b F64) (F64, F64, F64) {
function xyz_to_lin_a98rgb (line 182) | func xyz_to_lin_a98rgb(x F64, y F64, z F64) (F64, F64, F64) {
function lin_2020 (line 191) | func lin_2020(r F64, g F64, b F64) (F64, F64, F64) {
function gam_2020 (line 204) | func gam_2020(r F64, g F64, b F64) (F64, F64, F64) {
function lin_2020_to_xyz (line 217) | func lin_2020_to_xyz(r F64, g F64, b F64) (F64, F64, F64) {
Condensed preview — 326 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (9,553K chars).
[
{
"path": ".editorconfig",
"chars": 94,
"preview": "[*]\nindent_style = tab\nindent_size = 2\n\n[*.{js,json,ts}]\nindent_style = space\nindent_size = 2\n"
},
{
"path": ".github/ISSUE_TEMPLATE/new-issue.md",
"chars": 586,
"preview": "---\nname: New issue\nabout: This is the template for new issues.\ntitle: ''\nlabels: ''\nassignees: ''\n\n---\n\n<!--\nWhen repor"
},
{
"path": ".github/workflows/ci.yml",
"chars": 11402,
"preview": "name: CI\n\non:\n push:\n branches: ['*']\n pull_request:\n branches: ['*']\n workflow_dispatch:\n\npermissions:\n conte"
},
{
"path": ".github/workflows/e2e.yml",
"chars": 1151,
"preview": "name: End-to-end install tests\n\non:\n schedule:\n - cron: '0 */6 * * *'\n workflow_dispatch:\n\npermissions:\n contents:"
},
{
"path": ".github/workflows/publish.yml",
"chars": 2506,
"preview": "name: Publish\n\npermissions:\n id-token: write\n contents: write\n\non:\n push:\n branches:\n - main\n paths:\n "
},
{
"path": ".github/workflows/validate.yml",
"chars": 589,
"preview": "name: Validate release builds\n\non:\n push:\n tags: ['v*']\n workflow_dispatch:\n\npermissions:\n contents: read # to f"
},
{
"path": ".gitignore",
"chars": 829,
"preview": ".DS_Store\n.idea/\n.vscode/\n/bench/\n/demo/\n/deno/\n/esbuild\n/github/\n/go/\n/lib/deno/lib.deno.d.ts\n/npm/@esbuild/android-arm"
},
{
"path": "CHANGELOG-2020.md",
"chars": 232269,
"preview": "# Changelog: 2020\n\nThis changelog documents all esbuild versions published in the year 2020 (versions 0.3.0 through 0.8."
},
{
"path": "CHANGELOG-2021.md",
"chars": 440460,
"preview": "# Changelog: 2021\n\nThis changelog documents all esbuild versions published in the year 2021 (versions 0.8.29 through 0.1"
},
{
"path": "CHANGELOG-2022.md",
"chars": 270950,
"preview": "# Changelog: 2022\n\nThis changelog documents all esbuild versions published in the year 2022 (versions 0.14.11 through 0."
},
{
"path": "CHANGELOG-2023.md",
"chars": 229466,
"preview": "# Changelog: 2023\n\nThis changelog documents all esbuild versions published in the year 2023 (versions 0.16.13 through 0."
},
{
"path": "CHANGELOG-2024.md",
"chars": 66406,
"preview": "# Changelog: 2024\n\nThis changelog documents all esbuild versions published in the year 2024 (versions 0.19.12 through 0."
},
{
"path": "CHANGELOG.md",
"chars": 76555,
"preview": "# Changelog\n\n## 0.27.4\n\n* Fix a regression with CSS media queries ([#4395](https://github.com/evanw/esbuild/issues/4395)"
},
{
"path": "LICENSE.md",
"chars": 1069,
"preview": "MIT License\n\nCopyright (c) 2020 Evan Wallace\n\nPermission is hereby granted, free of charge, to any person obtaining a co"
},
{
"path": "Makefile",
"chars": 57557,
"preview": "ESBUILD_VERSION = $(shell cat version.txt)\nGO_VERSION = $(shell cat go.version)\n\n# Stash the \"node\" executable because o"
},
{
"path": "README.md",
"chars": 2104,
"preview": "<p align=\"center\">\n <picture>\n <source media=\"(prefers-color-scheme: dark)\" srcset=\"./images/wordmark-dark.svg\">\n "
},
{
"path": "RUNBOOK.md",
"chars": 3966,
"preview": "# Runbook\n\nThis documents some maintenance tasks for esbuild so I don't forget how they\nwork. There are a lot of moving "
},
{
"path": "cmd/esbuild/main.go",
"chars": 17448,
"preview": "package main\n\nimport (\n\t\"fmt\"\n\t\"io\"\n\t\"os\"\n\t\"runtime/debug\"\n\t\"strings\"\n\t\"time\"\n\n\t\"github.com/evanw/esbuild/internal/api_h"
},
{
"path": "cmd/esbuild/main_other.go",
"chars": 1268,
"preview": "//go:build !js || !wasm\n// +build !js !wasm\n\npackage main\n\nimport (\n\t\"fmt\"\n\t\"os\"\n\t\"runtime/pprof\"\n\t\"runtime/trace\"\n\n\t\"gi"
},
{
"path": "cmd/esbuild/main_wasm.go",
"chars": 807,
"preview": "//go:build js && wasm\n// +build js,wasm\n\npackage main\n\nimport (\n\t\"github.com/evanw/esbuild/internal/logger\"\n)\n\n// Remove"
},
{
"path": "cmd/esbuild/service.go",
"chars": 41620,
"preview": "// This implements a simple long-running service over stdin/stdout. Each\n// incoming request is an array of strings, and"
},
{
"path": "cmd/esbuild/stdio_protocol.go",
"chars": 4462,
"preview": "// The JavaScript API communicates with the Go child process over stdin/stdout\n// using this protocol. It's a very simpl"
},
{
"path": "cmd/esbuild/version.go",
"chars": 46,
"preview": "package main\n\nconst esbuildVersion = \"0.27.4\"\n"
},
{
"path": "compat-table/.gitignore",
"chars": 28,
"preview": "/out.js\n/out.js.map\n/repos/\n"
},
{
"path": "compat-table/README.md",
"chars": 283,
"preview": "# compat-table\n\nThis code generates esbuild's internal browser compatibility tables from 3rd-party browser compatibility"
},
{
"path": "compat-table/package.json",
"chars": 276,
"preview": "{\n \"githubDependencies\": {\n \"compat-table/compat-table\": \"f12538fe11c48c4fd35d6cdc7789653e10871b90\"\n },\n \"dependen"
},
{
"path": "compat-table/src/caniuse.ts",
"chars": 4497,
"preview": "// This file processes data from https://caniuse.com\n\nimport lite = require('caniuse-lite')\nimport { CSSFeature, CSSPref"
},
{
"path": "compat-table/src/compat-table.ts",
"chars": 7923,
"preview": "// This file processes the data contained in https://github.com/kangax/compat-table\n\nimport fs = require('fs')\nimport pa"
},
{
"path": "compat-table/src/css_table.ts",
"chars": 5456,
"preview": "// This file generates \"internal/compat/css_table.go\"\n\nimport fs = require('fs')\nimport { Engine, CSSFeature, VersionRan"
},
{
"path": "compat-table/src/index.ts",
"chars": 20334,
"preview": "// Run \"make compat-table\" to run this code\n// Run \"make update-compat-table\" to update the data sources\n\nimport child_p"
},
{
"path": "compat-table/src/js_table.ts",
"chars": 5035,
"preview": "// This file generates \"internal/compat/js_table.go\"\n\nimport fs = require('fs')\nimport { Engine, JSFeature, VersionRange"
},
{
"path": "compat-table/src/mdn.ts",
"chars": 11925,
"preview": "// This file processes data from https://developer.mozilla.org/en-US/docs/Web\n\nimport bcd, { BrowserName, SimpleSupportS"
},
{
"path": "compat-table/src/types.d.ts",
"chars": 106,
"preview": "// Allow TypeScript to import untyped \".js\" files\ndeclare module '*.js' {\n let any: any\n export = any\n}\n"
},
{
"path": "compat-table/tsconfig.json",
"chars": 161,
"preview": "{\n \"compilerOptions\": {\n \"esModuleInterop\": true,\n \"module\": \"CommonJS\",\n \"resolveJsonModule\": true,\n \"stri"
},
{
"path": "dl.sh",
"chars": 1249,
"preview": "#!/bin/sh\nset -eu\ndir=$(mktemp -d)\nplatform=$(uname -ms)\ntgz=\"$dir/esbuild-$ESBUILD_VERSION.tgz\"\n\n# Download the binary "
},
{
"path": "docs/architecture.md",
"chars": 33346,
"preview": "* [Architecture](#architecture)\n * [Design principles](#design-principles)\n* [Overview](#overview)\n * [Scan phase]"
},
{
"path": "docs/development.md",
"chars": 1488,
"preview": "# Development\n\nHere are some quick notes about how I develop esbuild.\n\n## Primary workflow\n\nMy development workflow revo"
},
{
"path": "go.mod",
"chars": 428,
"preview": "module github.com/evanw/esbuild\n\n// Support for Go 1.13 is deliberate so people can build esbuild\n// themselves for old "
},
{
"path": "go.sum",
"chars": 207,
"preview": "golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8 h1:0A+M6Uqn+Eje4kHMK80dtF3JCXC4ykBgQG4Fe06QRhQ=\ngolang.org/x/sys v0."
},
{
"path": "go.version",
"chars": 7,
"preview": "1.25.7\n"
},
{
"path": "internal/api_helpers/use_timer.go",
"chars": 346,
"preview": "package api_helpers\n\n// This flag is set by the CLI to activate the timer. It's put here instead of\n// by the timer to d"
},
{
"path": "internal/ast/ast.go",
"chars": 23717,
"preview": "package ast\n\n// This file contains data structures that are used with the AST packages for\n// both JavaScript and CSS. T"
},
{
"path": "internal/bundler/bundler.go",
"chars": 128001,
"preview": "package bundler\n\n// The bundler is the core of the \"build\" and \"transform\" API calls. Each\n// operation has two phases. "
},
{
"path": "internal/bundler_tests/bundler_css_test.go",
"chars": 83798,
"preview": "package bundler_tests\n\nimport (\n\t\"testing\"\n\n\t\"github.com/evanw/esbuild/internal/compat\"\n\t\"github.com/evanw/esbuild/inter"
},
{
"path": "internal/bundler_tests/bundler_dce_test.go",
"chars": 133721,
"preview": "package bundler_tests\n\nimport (\n\t\"regexp\"\n\t\"testing\"\n\n\t\"github.com/evanw/esbuild/internal/compat\"\n\t\"github.com/evanw/esb"
},
{
"path": "internal/bundler_tests/bundler_default_test.go",
"chars": 267788,
"preview": "package bundler_tests\n\nimport (\n\t\"regexp\"\n\t\"strings\"\n\t\"testing\"\n\n\t\"github.com/evanw/esbuild/internal/bundler\"\n\t\"github.c"
},
{
"path": "internal/bundler_tests/bundler_glob_test.go",
"chars": 7391,
"preview": "package bundler_tests\n\nimport (\n\t\"testing\"\n\n\t\"github.com/evanw/esbuild/internal/config\"\n)\n\nvar glob_suite = suite{\n\tname"
},
{
"path": "internal/bundler_tests/bundler_importphase_test.go",
"chars": 15546,
"preview": "package bundler_tests\n\nimport (\n\t\"testing\"\n\n\t\"github.com/evanw/esbuild/internal/config\"\n)\n\nvar importphase_suite = suite"
},
{
"path": "internal/bundler_tests/bundler_importstar_test.go",
"chars": 44125,
"preview": "package bundler_tests\n\nimport (\n\t\"testing\"\n\n\t\"github.com/evanw/esbuild/internal/config\"\n)\n\nvar importstar_suite = suite{"
},
{
"path": "internal/bundler_tests/bundler_importstar_ts_test.go",
"chars": 10572,
"preview": "package bundler_tests\n\nimport (\n\t\"testing\"\n\n\t\"github.com/evanw/esbuild/internal/config\"\n)\n\nvar importstar_ts_suite = sui"
},
{
"path": "internal/bundler_tests/bundler_loader_test.go",
"chars": 53290,
"preview": "package bundler_tests\n\nimport (\n\t\"testing\"\n\n\t\"github.com/evanw/esbuild/internal/bundler\"\n\t\"github.com/evanw/esbuild/inte"
},
{
"path": "internal/bundler_tests/bundler_lower_test.go",
"chars": 79454,
"preview": "package bundler_tests\n\n// This file contains tests for \"lowering\" syntax, which means converting it to\n// older JavaScri"
},
{
"path": "internal/bundler_tests/bundler_packagejson_test.go",
"chars": 99537,
"preview": "package bundler_tests\n\nimport (\n\t\"testing\"\n\n\t\"github.com/evanw/esbuild/internal/config\"\n)\n\nvar packagejson_suite = suite"
},
{
"path": "internal/bundler_tests/bundler_splitting_test.go",
"chars": 13860,
"preview": "package bundler_tests\n\nimport (\n\t\"testing\"\n\n\t\"github.com/evanw/esbuild/internal/config\"\n)\n\nvar splitting_suite = suite{\n"
},
{
"path": "internal/bundler_tests/bundler_test.go",
"chars": 9880,
"preview": "package bundler_tests\n\n// Bundling test results are stored in snapshot files, located in the\n// \"snapshots\" directory. T"
},
{
"path": "internal/bundler_tests/bundler_ts_test.go",
"chars": 69777,
"preview": "package bundler_tests\n\nimport (\n\t\"regexp\"\n\t\"testing\"\n\n\t\"github.com/evanw/esbuild/internal/compat\"\n\t\"github.com/evanw/esb"
},
{
"path": "internal/bundler_tests/bundler_tsconfig_test.go",
"chars": 72485,
"preview": "package bundler_tests\n\nimport (\n\t\"testing\"\n\n\t\"github.com/evanw/esbuild/internal/config\"\n)\n\nvar tsconfig_suite = suite{\n\t"
},
{
"path": "internal/bundler_tests/bundler_yarnpnp_test.go",
"chars": 4815,
"preview": "package bundler_tests\n\nimport (\n\t\"testing\"\n\n\t\"github.com/evanw/esbuild/internal/config\"\n)\n\nvar yarnpnp_suite = suite{\n\tn"
},
{
"path": "internal/bundler_tests/snapshots/snapshots_css.txt",
"chars": 58190,
"preview": "TestBase64ImportURLInCSS\n---------- /out/entry.css ----------\n/* entry.css */\na {\n background: url(data:image/png;base6"
},
{
"path": "internal/bundler_tests/snapshots/snapshots_dce.txt",
"chars": 73176,
"preview": "TestBase64LoaderRemoveUnused\n---------- /out.js ----------\n// entry.js\nconsole.log(\"unused import\");\n\n=================="
},
{
"path": "internal/bundler_tests/snapshots/snapshots_default.txt",
"chars": 161561,
"preview": "TestAmbiguousReexportMsg\n---------- /out/entry.js ----------\n// a.js\nvar a = 1;\n\n// b.js\nvar b = 3;\n\n// c.js\nvar c = 4;\n"
},
{
"path": "internal/bundler_tests/snapshots/snapshots_glob.txt",
"chars": 9477,
"preview": "TestGlobBasicNoBundle\n---------- /out.js ----------\nconst ab = Math.random() < 0.5 ? \"a.js\" : \"b.js\";\nconsole.log({\n co"
},
{
"path": "internal/bundler_tests/snapshots/snapshots_importphase.txt",
"chars": 1411,
"preview": "TestImportDeferExternalESM\n---------- /out.js ----------\n// entry.js\nimport defer * as foo0 from \"./foo.json\";\nimport de"
},
{
"path": "internal/bundler_tests/snapshots/snapshots_importstar.txt",
"chars": 24269,
"preview": "TestExportOtherAsNamespaceCommonJS\n---------- /out.js ----------\n// foo.js\nvar require_foo = __commonJS({\n \"foo.js\"(exp"
},
{
"path": "internal/bundler_tests/snapshots/snapshots_importstar_ts.txt",
"chars": 5850,
"preview": "TestTSImportStarAndCommonJS\n---------- /out.js ----------\n// foo.ts\nvar foo_exports = {};\n__export(foo_exports, {\n foo:"
},
{
"path": "internal/bundler_tests/snapshots/snapshots_loader.txt",
"chars": 32527,
"preview": "TestAutoDetectMimeTypeFromExtension\n---------- /out.js ----------\n// test.svg\nvar require_test = __commonJS({\n \"test.sv"
},
{
"path": "internal/bundler_tests/snapshots/snapshots_lower.txt",
"chars": 130364,
"preview": "TestClassSuperThisIssue242NoBundle\n---------- /out.js ----------\nvar _e;\nexport class A {\n}\nexport class B extends A {\n "
},
{
"path": "internal/bundler_tests/snapshots/snapshots_packagejson.txt",
"chars": 29902,
"preview": "TestCommonJSVariableInESMTypeModule\n---------- /out.js ----------\n// entry.js\nmodule.exports = null;\n\n=================="
},
{
"path": "internal/bundler_tests/snapshots/snapshots_splitting.txt",
"chars": 11238,
"preview": "TestEdgeCaseIssue2793WithSplitting\n---------- /out/index.js ----------\n// src/a.js\nvar A = 42;\n\n// src/b.js\nvar B = asyn"
},
{
"path": "internal/bundler_tests/snapshots/snapshots_ts.txt",
"chars": 46371,
"preview": "TestEnumRulesFrom_TypeScript_5_0\n---------- /out/supported.js ----------\n// supported.ts\nconsole.log(\n // a number or s"
},
{
"path": "internal/bundler_tests/snapshots/snapshots_tsconfig.txt",
"chars": 29236,
"preview": "TestJsconfigJsonBaseUrl\n---------- /Users/user/project/out.js ----------\n// Users/user/project/src/lib/util.js\nvar requi"
},
{
"path": "internal/bundler_tests/snapshots/snapshots_yarnpnp.txt",
"chars": 739,
"preview": "TestTsconfigPackageJsonExportsYarnPnP\n---------- /Users/user/project/out.js ----------\n// packages/app/index.tsx\nconsole"
},
{
"path": "internal/cache/cache.go",
"chars": 3660,
"preview": "package cache\n\nimport (\n\t\"sync\"\n\n\t\"github.com/evanw/esbuild/internal/logger\"\n\t\"github.com/evanw/esbuild/internal/runtime"
},
{
"path": "internal/cache/cache_ast.go",
"chars": 4642,
"preview": "package cache\n\nimport (\n\t\"sync\"\n\n\t\"github.com/evanw/esbuild/internal/css_ast\"\n\t\"github.com/evanw/esbuild/internal/css_pa"
},
{
"path": "internal/cache/cache_fs.go",
"chars": 1330,
"preview": "package cache\n\nimport (\n\t\"sync\"\n\n\t\"github.com/evanw/esbuild/internal/fs\"\n)\n\n// This cache uses information from the \"sta"
},
{
"path": "internal/cli_helpers/cli_helpers.go",
"chars": 1479,
"preview": "// This package contains internal CLI-related code that must be shared with\n// other internal code outside of the CLI pa"
},
{
"path": "internal/compat/compat.go",
"chars": 1924,
"preview": "package compat\n\nimport (\n\t\"strconv\"\n\t\"strings\"\n\n\t\"github.com/evanw/esbuild/internal/ast\"\n)\n\ntype v struct {\n\tmajor uint1"
},
{
"path": "internal/compat/compat_test.go",
"chars": 1858,
"preview": "package compat\n\nimport (\n\t\"fmt\"\n\t\"testing\"\n\n\t\"github.com/evanw/esbuild/internal/test\"\n)\n\nfunc TestCompareVersions(t *tes"
},
{
"path": "internal/compat/css_table.go",
"chars": 15642,
"preview": "// This file was automatically generated by \"css_table.ts\"\n\npackage compat\n\nimport (\n\t\"github.com/evanw/esbuild/internal"
},
{
"path": "internal/compat/js_table.go",
"chars": 36451,
"preview": "// This file was automatically generated by \"js_table.ts\"\n\npackage compat\n\ntype Engine uint8\n\nconst (\n\tChrome Engine = i"
},
{
"path": "internal/config/config.go",
"chars": 22108,
"preview": "package config\n\nimport (\n\t\"fmt\"\n\t\"regexp\"\n\t\"strings\"\n\t\"sync\"\n\t\"sync/atomic\"\n\n\t\"github.com/evanw/esbuild/internal/ast\"\n\t\""
},
{
"path": "internal/config/globals.go",
"chars": 26282,
"preview": "package config\n\nimport (\n\t\"math\"\n\t\"sync\"\n\n\t\"github.com/evanw/esbuild/internal/ast\"\n\t\"github.com/evanw/esbuild/internal/h"
},
{
"path": "internal/css_ast/css_ast.go",
"chars": 42934,
"preview": "package css_ast\n\nimport (\n\t\"strconv\"\n\t\"strings\"\n\n\t\"github.com/evanw/esbuild/internal/ast\"\n\t\"github.com/evanw/esbuild/int"
},
{
"path": "internal/css_ast/css_decl_table.go",
"chars": 21498,
"preview": "package css_ast\n\nimport (\n\t\"strings\"\n\t\"sync\"\n\n\t\"github.com/evanw/esbuild/internal/helpers\"\n)\n\ntype D uint16\n\nconst (\n\tDU"
},
{
"path": "internal/css_lexer/css_lexer.go",
"chars": 25330,
"preview": "package css_lexer\n\nimport (\n\t\"strings\"\n\t\"unicode/utf8\"\n\n\t\"github.com/evanw/esbuild/internal/logger\"\n)\n\n// The lexer conv"
},
{
"path": "internal/css_lexer/css_lexer_test.go",
"chars": 5412,
"preview": "package css_lexer\n\nimport (\n\t\"strings\"\n\t\"testing\"\n\n\t\"github.com/evanw/esbuild/internal/logger\"\n\t\"github.com/evanw/esbuil"
},
{
"path": "internal/css_parser/css_color_spaces.go",
"chars": 16179,
"preview": "package css_parser\n\nimport (\n\t\"math\"\n\n\t\"github.com/evanw/esbuild/internal/helpers\"\n)\n\n// Wrap float64 math to avoid comp"
},
{
"path": "internal/css_parser/css_decls.go",
"chars": 17794,
"preview": "package css_parser\n\nimport (\n\t\"strings\"\n\n\t\"github.com/evanw/esbuild/internal/compat\"\n\t\"github.com/evanw/esbuild/internal"
},
{
"path": "internal/css_parser/css_decls_animation.go",
"chars": 3125,
"preview": "package css_parser\n\nimport (\n\t\"strings\"\n\n\t\"github.com/evanw/esbuild/internal/css_ast\"\n\t\"github.com/evanw/esbuild/interna"
},
{
"path": "internal/css_parser/css_decls_border_radius.go",
"chars": 6669,
"preview": "package css_parser\n\nimport (\n\t\"github.com/evanw/esbuild/internal/css_ast\"\n\t\"github.com/evanw/esbuild/internal/css_lexer\""
},
{
"path": "internal/css_parser/css_decls_box.go",
"chars": 5643,
"preview": "package css_parser\n\nimport (\n\t\"strings\"\n\n\t\"github.com/evanw/esbuild/internal/css_ast\"\n\t\"github.com/evanw/esbuild/interna"
},
{
"path": "internal/css_parser/css_decls_box_shadow.go",
"chars": 2804,
"preview": "package css_parser\n\nimport (\n\t\"strings\"\n\n\t\"github.com/evanw/esbuild/internal/css_ast\"\n\t\"github.com/evanw/esbuild/interna"
},
{
"path": "internal/css_parser/css_decls_color.go",
"chars": 28216,
"preview": "package css_parser\n\nimport (\n\t\"fmt\"\n\t\"math\"\n\t\"strconv\"\n\t\"strings\"\n\n\t\"github.com/evanw/esbuild/internal/compat\"\n\t\"github."
},
{
"path": "internal/css_parser/css_decls_composes.go",
"chars": 3017,
"preview": "package css_parser\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n\n\t\"github.com/evanw/esbuild/internal/ast\"\n\t\"github.com/evanw/esbuild/inte"
},
{
"path": "internal/css_parser/css_decls_container.go",
"chars": 1207,
"preview": "package css_parser\n\nimport (\n\t\"strings\"\n\n\t\"github.com/evanw/esbuild/internal/css_ast\"\n\t\"github.com/evanw/esbuild/interna"
},
{
"path": "internal/css_parser/css_decls_font.go",
"chars": 3792,
"preview": "package css_parser\n\nimport (\n\t\"strconv\"\n\t\"strings\"\n\n\t\"github.com/evanw/esbuild/internal/css_ast\"\n\t\"github.com/evanw/esbu"
},
{
"path": "internal/css_parser/css_decls_font_family.go",
"chars": 4943,
"preview": "package css_parser\n\nimport (\n\t\"strings\"\n\n\t\"github.com/evanw/esbuild/internal/css_ast\"\n\t\"github.com/evanw/esbuild/interna"
},
{
"path": "internal/css_parser/css_decls_font_weight.go",
"chars": 459,
"preview": "package css_parser\n\nimport (\n\t\"strings\"\n\n\t\"github.com/evanw/esbuild/internal/css_ast\"\n\t\"github.com/evanw/esbuild/interna"
},
{
"path": "internal/css_parser/css_decls_gradient.go",
"chars": 28444,
"preview": "package css_parser\n\nimport (\n\t\"fmt\"\n\t\"math\"\n\t\"strconv\"\n\t\"strings\"\n\n\t\"github.com/evanw/esbuild/internal/compat\"\n\t\"github."
},
{
"path": "internal/css_parser/css_decls_list_style.go",
"chars": 4743,
"preview": "package css_parser\n\nimport (\n\t\"strings\"\n\n\t\"github.com/evanw/esbuild/internal/css_ast\"\n\t\"github.com/evanw/esbuild/interna"
},
{
"path": "internal/css_parser/css_decls_transform.go",
"chars": 11704,
"preview": "package css_parser\n\nimport (\n\t\"strings\"\n\n\t\"github.com/evanw/esbuild/internal/css_ast\"\n\t\"github.com/evanw/esbuild/interna"
},
{
"path": "internal/css_parser/css_nesting.go",
"chars": 18320,
"preview": "package css_parser\n\nimport (\n\t\"fmt\"\n\n\t\"github.com/evanw/esbuild/internal/compat\"\n\t\"github.com/evanw/esbuild/internal/css"
},
{
"path": "internal/css_parser/css_parser.go",
"chars": 75931,
"preview": "package css_parser\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n\n\t\"github.com/evanw/esbuild/internal/ast\"\n\t\"github.com/evanw/esbuild/inte"
},
{
"path": "internal/css_parser/css_parser_media.go",
"chars": 12822,
"preview": "package css_parser\n\nimport (\n\t\"strings\"\n\n\t\"github.com/evanw/esbuild/internal/compat\"\n\t\"github.com/evanw/esbuild/internal"
},
{
"path": "internal/css_parser/css_parser_selector.go",
"chars": 27980,
"preview": "package css_parser\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n\n\t\"github.com/evanw/esbuild/internal/css_ast\"\n\t\"github.com/evanw/esbuild/"
},
{
"path": "internal/css_parser/css_parser_test.go",
"chars": 234748,
"preview": "package css_parser\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n\t\"testing\"\n\n\t\"github.com/evanw/esbuild/internal/ast\"\n\t\"github.com/evanw/e"
},
{
"path": "internal/css_parser/css_reduce_calc.go",
"chars": 18043,
"preview": "package css_parser\n\nimport (\n\t\"fmt\"\n\t\"math\"\n\t\"strconv\"\n\t\"strings\"\n\n\t\"github.com/evanw/esbuild/internal/css_ast\"\n\t\"github"
},
{
"path": "internal/css_printer/css_printer.go",
"chars": 33747,
"preview": "package css_printer\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n\t\"unicode/utf8\"\n\n\t\"github.com/evanw/esbuild/internal/ast\"\n\t\"github.com/e"
},
{
"path": "internal/css_printer/css_printer_test.go",
"chars": 24668,
"preview": "package css_printer\n\nimport (\n\t\"strings\"\n\t\"testing\"\n\n\t\"github.com/evanw/esbuild/internal/ast\"\n\t\"github.com/evanw/esbuild"
},
{
"path": "internal/fs/error_other.go",
"chars": 151,
"preview": "//go:build (!js || !wasm) && !windows\n// +build !js !wasm\n// +build !windows\n\npackage fs\n\nfunc is_ERROR_INVALID_NAME(err"
},
{
"path": "internal/fs/error_wasm+windows.go",
"chars": 537,
"preview": "//go:build (js && wasm) || windows\n// +build js,wasm windows\n\npackage fs\n\nimport \"syscall\"\n\n// This check is here in a c"
},
{
"path": "internal/fs/filepath.go",
"chars": 18251,
"preview": "// Code in this file has been forked from the \"filepath\" module in the Go\n// source code to work around bugs with the We"
},
{
"path": "internal/fs/fs.go",
"chars": 8449,
"preview": "package fs\n\n// Most of esbuild's internals use this file system abstraction instead of\n// using native file system APIs."
},
{
"path": "internal/fs/fs_mock.go",
"chars": 6928,
"preview": "package fs\n\n// This is a mock implementation of the \"fs\" module for use with tests. It does\n// not actually read from th"
},
{
"path": "internal/fs/fs_mock_test.go",
"chars": 6916,
"preview": "package fs\n\nimport (\n\t\"fmt\"\n\t\"testing\"\n)\n\nfunc TestMockFSBasicUnix(t *testing.T) {\n\tfs := MockFS(map[string]string{\n\t\t\"/"
},
{
"path": "internal/fs/fs_real.go",
"chars": 14465,
"preview": "package fs\n\nimport (\n\t\"fmt\"\n\t\"io\"\n\t\"io/ioutil\"\n\t\"os\"\n\t\"sort\"\n\t\"strings\"\n\t\"sync\"\n\t\"syscall\"\n)\n\ntype realFS struct {\n\t// S"
},
{
"path": "internal/fs/fs_zip.go",
"chars": 10621,
"preview": "package fs\n\n// The Yarn package manager (https://yarnpkg.com/) has a custom installation\n// strategy called \"Plug'n'Play"
},
{
"path": "internal/fs/iswin_other.go",
"chars": 135,
"preview": "//go:build (!js || !wasm) && !windows\n// +build !js !wasm\n// +build !windows\n\npackage fs\n\nfunc CheckIfWindows() bool {\n\t"
},
{
"path": "internal/fs/iswin_wasm.go",
"chars": 507,
"preview": "//go:build js && wasm\n// +build js,wasm\n\npackage fs\n\nimport (\n\t\"os\"\n)\n\nvar checkedIfWindows bool\nvar cachedIfWindows boo"
},
{
"path": "internal/fs/iswin_windows.go",
"chars": 94,
"preview": "//go:build windows\n// +build windows\n\npackage fs\n\nfunc CheckIfWindows() bool {\n\treturn true\n}\n"
},
{
"path": "internal/fs/modkey_other.go",
"chars": 717,
"preview": "//go:build !darwin && !freebsd && !linux\n// +build !darwin,!freebsd,!linux\n\npackage fs\n\nimport (\n\t\"os\"\n\t\"time\"\n)\n\nvar ze"
},
{
"path": "internal/fs/modkey_unix.go",
"chars": 950,
"preview": "//go:build darwin || freebsd || linux\n// +build darwin freebsd linux\n\npackage fs\n\nimport (\n\t\"time\"\n\n\t\"golang.org/x/sys/u"
},
{
"path": "internal/graph/graph.go",
"chars": 14557,
"preview": "package graph\n\n// This graph represents the set of files that the linker operates on. Each\n// linker has a separate one "
},
{
"path": "internal/graph/input.go",
"chars": 3857,
"preview": "package graph\n\n// The code in this file mainly represents data that passes from the scan phase\n// to the compile phase o"
},
{
"path": "internal/graph/meta.go",
"chars": 8372,
"preview": "package graph\n\n// The code in this file represents data that is required by the compile phase\n// of the bundler but that"
},
{
"path": "internal/helpers/bitset.go",
"chars": 491,
"preview": "package helpers\n\nimport \"bytes\"\n\ntype BitSet struct {\n\tentries []byte\n}\n\nfunc NewBitSet(bitCount uint) BitSet {\n\treturn "
},
{
"path": "internal/helpers/comment.go",
"chars": 493,
"preview": "package helpers\n\nimport (\n\t\"strings\"\n)\n\nfunc EscapeClosingTag(text string, slashTag string) string {\n\tif slashTag == \"\" "
},
{
"path": "internal/helpers/dataurl.go",
"chars": 1760,
"preview": "package helpers\n\nimport (\n\t\"encoding/base64\"\n\t\"fmt\"\n\t\"strings\"\n\t\"unicode/utf8\"\n)\n\n// Returns the shorter of either a bas"
},
{
"path": "internal/helpers/dataurl_test.go",
"chars": 1432,
"preview": "package helpers_test\n\nimport (\n\t\"fmt\"\n\t\"testing\"\n\n\t\"github.com/evanw/esbuild/internal/helpers\"\n)\n\nfunc TestEncodeDataURL"
},
{
"path": "internal/helpers/float.go",
"chars": 3613,
"preview": "package helpers\n\nimport \"math\"\n\n// This wraps float64 math operations. Why does this exist? The Go compiler\n// contains "
},
{
"path": "internal/helpers/glob.go",
"chars": 1402,
"preview": "package helpers\n\nimport \"strings\"\n\ntype GlobWildcard uint8\n\nconst (\n\tGlobNone GlobWildcard = iota\n\tGlobAllExceptSlash\n\tG"
},
{
"path": "internal/helpers/hash.go",
"chars": 391,
"preview": "package helpers\n\n// From: http://boost.sourceforge.net/doc/html/boost/hash_combine.html\nfunc HashCombine(seed uint32, ha"
},
{
"path": "internal/helpers/joiner.go",
"chars": 1802,
"preview": "package helpers\n\nimport (\n\t\"bytes\"\n\t\"strings\"\n)\n\n// This provides an efficient way to join lots of big string and byte s"
},
{
"path": "internal/helpers/mime.go",
"chars": 1385,
"preview": "package helpers\n\nimport \"strings\"\n\nvar builtinTypesLower = map[string]string{\n\t// Text\n\t\".css\": \"text/css; charset="
},
{
"path": "internal/helpers/path.go",
"chars": 1775,
"preview": "package helpers\n\nimport (\n\t\"net/url\"\n\t\"strings\"\n\n\t\"github.com/evanw/esbuild/internal/fs\"\n)\n\nfunc IsInsideNodeModules(pat"
},
{
"path": "internal/helpers/quote.go",
"chars": 2917,
"preview": "package helpers\n\nimport \"unicode/utf8\"\n\nconst hexChars = \"0123456789ABCDEF\"\nconst firstASCII = 0x20\nconst lastASCII = 0x"
},
{
"path": "internal/helpers/serializer.go",
"chars": 458,
"preview": "package helpers\n\nimport \"sync\"\n\n// Each call to \"Enter(i)\" doesn't start until \"Leave(i-1)\" is called\ntype Serializer st"
},
{
"path": "internal/helpers/stack.go",
"chars": 1103,
"preview": "package helpers\n\nimport (\n\t\"runtime/debug\"\n\t\"strings\"\n)\n\nfunc PrettyPrintedStack() string {\n\tlines := strings.Split(stri"
},
{
"path": "internal/helpers/strings.go",
"chars": 645,
"preview": "package helpers\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n)\n\nfunc StringArraysEqual(a []string, b []string) bool {\n\tif len(a) != len(b"
},
{
"path": "internal/helpers/timer.go",
"chars": 1634,
"preview": "package helpers\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n\t\"sync\"\n\t\"time\"\n\n\t\"github.com/evanw/esbuild/internal/logger\"\n)\n\ntype Timer s"
},
{
"path": "internal/helpers/typos.go",
"chars": 903,
"preview": "package helpers\n\nimport \"unicode/utf8\"\n\ntype TypoDetector struct {\n\toneCharTypos map[string]string\n}\n\nfunc MakeTypoDetec"
},
{
"path": "internal/helpers/utf.go",
"chars": 4913,
"preview": "package helpers\n\nimport (\n\t\"strings\"\n\t\"unicode/utf8\"\n)\n\nfunc ContainsNonBMPCodePoint(text string) bool {\n\tfor _, c := ra"
},
{
"path": "internal/helpers/waitgroup.go",
"chars": 980,
"preview": "package helpers\n\nimport \"sync/atomic\"\n\n// Go's \"sync.WaitGroup\" is not thread-safe. Specifically it's not safe to call\n/"
},
{
"path": "internal/js_ast/js_ast.go",
"chars": 50796,
"preview": "package js_ast\n\nimport (\n\t\"strconv\"\n\n\t\"github.com/evanw/esbuild/internal/ast\"\n\t\"github.com/evanw/esbuild/internal/logger"
},
{
"path": "internal/js_ast/js_ast_helpers.go",
"chars": 89329,
"preview": "package js_ast\n\nimport (\n\t\"math\"\n\t\"strconv\"\n\t\"strings\"\n\n\t\"github.com/evanw/esbuild/internal/ast\"\n\t\"github.com/evanw/esbu"
},
{
"path": "internal/js_ast/js_ast_test.go",
"chars": 1103,
"preview": "package js_ast\n\nimport \"testing\"\n\nfunc assertEqual(t *testing.T, a interface{}, b interface{}) {\n\tif a != b {\n\t\tt.Fatalf"
},
{
"path": "internal/js_ast/js_ident.go",
"chars": 5756,
"preview": "package js_ast\n\nimport (\n\t\"strings\"\n\t\"unicode\"\n\t\"unicode/utf8\"\n)\n\nfunc IsIdentifier(text string) bool {\n\tif len(text) =="
},
{
"path": "internal/js_ast/unicode.go",
"chars": 79483,
"preview": "// This file was automatically generated by gen-unicode-table.js. Do not edit.\npackage js_ast\n\nimport \"unicode\"\n\nvar idS"
},
{
"path": "internal/js_lexer/js_lexer.go",
"chars": 66486,
"preview": "package js_lexer\n\n// The lexer converts a source file to a stream of tokens. Unlike many\n// compilers, esbuild does not "
},
{
"path": "internal/js_lexer/js_lexer_test.go",
"chars": 22842,
"preview": "package js_lexer\n\nimport (\n\t\"fmt\"\n\t\"math\"\n\t\"strings\"\n\t\"testing\"\n\t\"unicode/utf8\"\n\n\t\"github.com/evanw/esbuild/internal/con"
},
{
"path": "internal/js_lexer/tables.go",
"chars": 9934,
"preview": "package js_lexer\n\nvar tokenToString = map[T]string{\n\tTEndOfFile: \"end of file\",\n\tTSyntaxError: \"syntax error\",\n\tTHashb"
},
{
"path": "internal/js_parser/global_name_parser.go",
"chars": 1450,
"preview": "package js_parser\n\nimport (\n\t\"github.com/evanw/esbuild/internal/helpers\"\n\t\"github.com/evanw/esbuild/internal/js_lexer\"\n\t"
},
{
"path": "internal/js_parser/js_parser.go",
"chars": 656672,
"preview": "package js_parser\n\nimport (\n\t\"fmt\"\n\t\"math\"\n\t\"math/big\"\n\t\"regexp\"\n\t\"sort\"\n\t\"strings\"\n\t\"unicode/utf8\"\n\n\t\"github.com/evanw/"
},
{
"path": "internal/js_parser/js_parser_lower.go",
"chars": 74085,
"preview": "// This file contains code for \"lowering\" syntax, which means converting it to\n// older JavaScript. For example, \"a ** b"
},
{
"path": "internal/js_parser/js_parser_lower_class.go",
"chars": 98177,
"preview": "package js_parser\n\nimport (\n\t\"fmt\"\n\n\t\"github.com/evanw/esbuild/internal/ast\"\n\t\"github.com/evanw/esbuild/internal/compat\""
},
{
"path": "internal/js_parser/js_parser_lower_test.go",
"chars": 56137,
"preview": "package js_parser\n\nimport (\n\t\"fmt\"\n\t\"testing\"\n\n\t\"github.com/evanw/esbuild/internal/compat\"\n)\n\nfunc TestLowerFunctionArgu"
},
{
"path": "internal/js_parser/js_parser_test.go",
"chars": 490400,
"preview": "package js_parser\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n\t\"testing\"\n\n\t\"github.com/evanw/esbuild/internal/ast\"\n\t\"github.com/evanw/es"
},
{
"path": "internal/js_parser/json_parser.go",
"chars": 6580,
"preview": "package js_parser\n\nimport (\n\t\"fmt\"\n\n\t\"github.com/evanw/esbuild/internal/compat\"\n\t\"github.com/evanw/esbuild/internal/help"
},
{
"path": "internal/js_parser/json_parser_test.go",
"chars": 9254,
"preview": "package js_parser\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n\t\"testing\"\n\n\t\"github.com/evanw/esbuild/internal/ast\"\n\t\"github.com/evanw/es"
},
{
"path": "internal/js_parser/sourcemap_parser.go",
"chars": 12958,
"preview": "package js_parser\n\nimport (\n\t\"fmt\"\n\t\"net/url\"\n\t\"sort\"\n\t\"strings\"\n\n\t\"github.com/evanw/esbuild/internal/ast\"\n\t\"github.com/"
},
{
"path": "internal/js_parser/ts_parser.go",
"chars": 64482,
"preview": "// This file contains code for parsing TypeScript syntax. The parser just skips\n// over type expressions as if they are "
},
{
"path": "internal/js_parser/ts_parser_test.go",
"chars": 180670,
"preview": "package js_parser\n\nimport (\n\t\"testing\"\n\n\t\"github.com/evanw/esbuild/internal/compat\"\n\t\"github.com/evanw/esbuild/internal/"
},
{
"path": "internal/js_printer/js_printer.go",
"chars": 135143,
"preview": "package js_printer\n\nimport (\n\t\"bytes\"\n\t\"fmt\"\n\t\"math\"\n\t\"math/big\"\n\t\"strconv\"\n\t\"strings\"\n\t\"unicode/utf8\"\n\n\t\"github.com/eva"
},
{
"path": "internal/js_printer/js_printer_test.go",
"chars": 58005,
"preview": "package js_printer\n\nimport (\n\t\"strings\"\n\t\"testing\"\n\n\t\"github.com/evanw/esbuild/internal/ast\"\n\t\"github.com/evanw/esbuild/"
},
{
"path": "internal/linker/debug.go",
"chars": 4064,
"preview": "package linker\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n\n\t\"github.com/evanw/esbuild/internal/ast\"\n\t\"github.com/evanw/esbuild/internal"
},
{
"path": "internal/linker/linker.go",
"chars": 269567,
"preview": "package linker\n\n// This package implements the second phase of the bundling operation that\n// generates the output files"
},
{
"path": "internal/logger/logger.go",
"chars": 50427,
"preview": "package logger\n\n// Logging is either done to stderr (via \"NewStderrLog\") or to an in-memory\n// array (via \"NewDeferLog\")"
},
{
"path": "internal/logger/logger_darwin.go",
"chars": 664,
"preview": "//go:build darwin\n// +build darwin\n\npackage logger\n\nimport (\n\t\"os\"\n\n\t\"golang.org/x/sys/unix\"\n)\n\nconst SupportsColorEscap"
},
{
"path": "internal/logger/logger_linux.go",
"chars": 660,
"preview": "//go:build linux\n// +build linux\n\npackage logger\n\nimport (\n\t\"os\"\n\n\t\"golang.org/x/sys/unix\"\n)\n\nconst SupportsColorEscapes"
},
{
"path": "internal/logger/logger_other.go",
"chars": 295,
"preview": "//go:build !darwin && !linux && !windows\n// +build !darwin,!linux,!windows\n\npackage logger\n\nimport \"os\"\n\nconst SupportsC"
},
{
"path": "internal/logger/logger_test.go",
"chars": 643,
"preview": "package logger_test\n\nimport (\n\t\"testing\"\n\n\t\"github.com/evanw/esbuild/internal/logger\"\n\t\"github.com/evanw/esbuild/interna"
},
{
"path": "internal/logger/logger_windows.go",
"chars": 4015,
"preview": "//go:build windows\n// +build windows\n\npackage logger\n\nimport (\n\t\"os\"\n\t\"strings\"\n\t\"syscall\"\n\t\"unsafe\"\n)\n\nconst SupportsCo"
},
{
"path": "internal/logger/msg_ids.go",
"chars": 12009,
"preview": "package logger\n\n// Most non-error log messages are given a message ID that can be used to set\n// the log level for that "
},
{
"path": "internal/renamer/renamer.go",
"chars": 20775,
"preview": "package renamer\n\nimport (\n\t\"fmt\"\n\t\"sort\"\n\t\"strconv\"\n\t\"sync\"\n\t\"sync/atomic\"\n\n\t\"github.com/evanw/esbuild/internal/ast\"\n\t\"g"
},
{
"path": "internal/resolver/dataurl.go",
"chars": 1695,
"preview": "package resolver\n\nimport (\n\t\"encoding/base64\"\n\t\"fmt\"\n\t\"net/url\"\n\t\"strings\"\n)\n\ntype DataURL struct {\n\tmimeType string\n\tda"
},
{
"path": "internal/resolver/package_json.go",
"chars": 48798,
"preview": "package resolver\n\nimport (\n\t\"fmt\"\n\t\"net/url\"\n\t\"path\"\n\t\"regexp\"\n\t\"sort\"\n\t\"strings\"\n\n\t\"github.com/evanw/esbuild/internal/c"
},
{
"path": "internal/resolver/resolver.go",
"chars": 112991,
"preview": "package resolver\n\nimport (\n\t\"errors\"\n\t\"fmt\"\n\t\"path\"\n\t\"regexp\"\n\t\"sort\"\n\t\"strings\"\n\t\"sync\"\n\t\"syscall\"\n\n\t\"github.com/evanw/"
},
{
"path": "internal/resolver/testExpectations.json",
"chars": 9571,
"preview": "[{\n \"manifest\": {\n \"__info\": [],\n \"dependencyTreeRoots\": [{\n \"name\": \"root\",\n \"reference\": \"workspace:."
},
{
"path": "internal/resolver/tsconfig_json.go",
"chars": 15280,
"preview": "package resolver\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n\n\t\"github.com/evanw/esbuild/internal/cache\"\n\t\"github.com/evanw/esbuild/inte"
},
{
"path": "internal/resolver/yarnpnp.go",
"chars": 24924,
"preview": "package resolver\n\n// This file implements the Yarn PnP specification: https://yarnpkg.com/advanced/pnp-spec/\n\nimport (\n\t"
},
{
"path": "internal/resolver/yarnpnp_test.go",
"chars": 3298,
"preview": "package resolver\n\nimport (\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"io/ioutil\"\n\t\"strings\"\n\t\"testing\"\n\n\t\"github.com/evanw/esbuild/intern"
},
{
"path": "internal/runtime/runtime.go",
"chars": 24046,
"preview": "package runtime\n\n// This is esbuild's runtime code. It contains helper functions that are\n// automatically injected into"
},
{
"path": "internal/runtime/runtime_test.go",
"chars": 910,
"preview": "package runtime_test\n\nimport (\n\t\"testing\"\n\n\t\"github.com/evanw/esbuild/internal/compat\"\n\t\"github.com/evanw/esbuild/intern"
},
{
"path": "internal/sourcemap/sourcemap.go",
"chars": 25258,
"preview": "package sourcemap\n\nimport (\n\t\"bytes\"\n\t\"strings\"\n\t\"unicode/utf8\"\n\n\t\"github.com/evanw/esbuild/internal/ast\"\n\t\"github.com/e"
},
{
"path": "internal/test/diff.go",
"chars": 1908,
"preview": "package test\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n\n\t\"github.com/evanw/esbuild/internal/logger\"\n)\n\nfunc diff(old string, new strin"
},
{
"path": "internal/test/util.go",
"chars": 860,
"preview": "package test\n\nimport (\n\t\"fmt\"\n\t\"testing\"\n\n\t\"github.com/evanw/esbuild/internal/fs\"\n\t\"github.com/evanw/esbuild/internal/lo"
},
{
"path": "internal/xxhash/LICENSE.txt",
"chars": 1068,
"preview": "Copyright (c) 2016 Caleb Spare\n\nMIT License\n\nPermission is hereby granted, free of charge, to any person obtaining\na cop"
},
{
"path": "internal/xxhash/README.md",
"chars": 76,
"preview": "This Go implementation of xxHash is from https://github.com/cespare/xxhash.\n"
},
{
"path": "internal/xxhash/xxhash.go",
"chars": 5411,
"preview": "// Package xxhash implements the 64-bit variant of xxHash (XXH64) as described\n// at http://cyan4973.github.io/xxHash/.\n"
},
{
"path": "internal/xxhash/xxhash_other.go",
"chars": 1516,
"preview": "package xxhash\n\n// Sum64 computes the 64-bit xxHash digest of b.\nfunc Sum64(b []byte) uint64 {\n\t// A simpler version wou"
},
{
"path": "lib/README.md",
"chars": 276,
"preview": "This directory contains the TypeScript code that becomes the JavaScript API code in the `esbuild` and `esbuild-wasm` pac"
},
{
"path": "lib/deno/external.d.ts",
"chars": 196,
"preview": "declare module \"https://deno.land/x/denoflate@1.2.1/mod.ts\" {\n export function gunzip(input: Uint8Array): Uint8Array\n}\n"
},
{
"path": "lib/deno/mod.ts",
"chars": 14588,
"preview": "import type * as types from \"../shared/types\"\nimport * as common from \"../shared/common\"\nimport * as ourselves from \"./m"
},
{
"path": "lib/deno/wasm.ts",
"chars": 6829,
"preview": "import type * as types from \"../shared/types\"\nimport * as common from \"../shared/common\"\nimport * as ourselves from \"./w"
},
{
"path": "lib/npm/browser.ts",
"chars": 7698,
"preview": "import type * as types from \"../shared/types\"\nimport * as common from \"../shared/common\"\nimport * as ourselves from \"./b"
},
{
"path": "lib/npm/node-install.ts",
"chars": 13389,
"preview": "import { downloadedBinPath, ESBUILD_BINARY_PATH, isValidBinaryPath, pkgAndSubpathForCurrentPlatform } from './node-platf"
},
{
"path": "lib/npm/node-platform.ts",
"chars": 12914,
"preview": "import fs = require('fs')\nimport os = require('os')\nimport path = require('path')\n\ndeclare const ESBUILD_VERSION: string"
},
{
"path": "lib/npm/node-shim.ts",
"chars": 347,
"preview": "#!/usr/bin/env node\n\nimport { generateBinPath } from \"./node-platform\"\nconst { binPath, isWASM } = generateBinPath()\nif "
},
{
"path": "lib/npm/node.ts",
"chars": 22747,
"preview": "import type * as types from \"../shared/types\"\nimport * as common from \"../shared/common\"\nimport * as ourselves from \"./n"
},
{
"path": "lib/package.json",
"chars": 102,
"preview": "{\n \"private\": true,\n \"dependencies\": {\n \"@types/node\": \"17.0.2\",\n \"typescript\": \"4.5.4\"\n }\n}\n"
}
]
// ... and 126 more files (download for full content)
About this extraction
This page contains the full source code of the evanw/esbuild GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 326 files (8.4 MB), approximately 2.2M tokens, and a symbol index with 6848 extracted functions, classes, methods, constants, and types. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.
Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.