Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
61 commits
Select commit Hold shift + click to select a range
8465fa4
feat: widen webpack peer support
Copilot May 21, 2026
a896f16
chore: plan isWebpack5 refactor
Copilot May 21, 2026
cf368a5
refactor: propagate webpack major version through instance flow
Copilot May 21, 2026
5d7ab2f
refactor: use instance.isWebpack5 consistently for strategy decisions
Copilot May 21, 2026
78fa91f
refactor: localize webpack5 detection to instance setup
Copilot May 21, 2026
7b3cd3e
refactor: use module methods directly in webpack5 error cleanup
Copilot May 21, 2026
c9b011a
Apply suggestion from @johnnyreilly
johnnyreilly May 22, 2026
1e6fccf
refactor: consolidate webpack5 build dependency registration
Copilot May 22, 2026
e438901
fix: add getLoaderOptions webpack 4 changes
johnnyreilly May 22, 2026
e269bbe
fix: resolve src/index.ts webpack4 loader options regression
Copilot May 22, 2026
6ba2080
refactor: make loader-utils optional peer for webpack4 path
Copilot May 22, 2026
b7577b4
fix: investigate and address failing webpack4 and comparison tests
Copilot May 22, 2026
8fa971e
refactor: loaderOptions separate file
johnnyreilly May 22, 2026
44d0ab9
refactor: use isWebpack5 in after-compile module mapping
Copilot May 22, 2026
6d40c52
refactor: derive and reuse isWebpack5 in index loader
Copilot May 22, 2026
c6a7b4c
refactor: pass isWebpack5 into instance creation flow
Copilot May 22, 2026
d26df89
fix: restore comparison outputs and normalize ts-loader module errors
Copilot May 22, 2026
e7b3593
chore: inline require
johnnyreilly May 22, 2026
b2c5420
chore: reduce number of tested versions
johnnyreilly May 22, 2026
bae941a
chore: exclude test to see if fixes webpack 4
johnnyreilly May 22, 2026
7722dcf
chore: introduce minimum webpack version
johnnyreilly May 22, 2026
7878c8f
chore: lockfile
johnnyreilly May 23, 2026
b28261b
fix: build
johnnyreilly May 23, 2026
87647bb
fix: check is object
johnnyreilly May 23, 2026
9ea643d
chore: upgrade eslint
johnnyreilly May 23, 2026
628cab1
fix: tidy
johnnyreilly May 23, 2026
8fe5821
Revert "chore: lockfile"
Copilot May 23, 2026
8aeffa1
fix: restore module error guard in after-compile
Copilot May 23, 2026
5d908f9
chore: drop unintended yarn.lock changes
Copilot May 23, 2026
0bc8ace
Agent-Logs-Url: https://github.com/TypeStrong/ts-loader/sessions/72a9…
Copilot May 23, 2026
e39af9e
fix: pin @types/eslint to unblock CI type checks
Copilot May 23, 2026
c0aafcc
chore: comment some stuff
johnnyreilly May 23, 2026
aab999c
fix: restore moduleHasErrors guard in after-compile
Copilot May 23, 2026
95c3370
chore: revert unintended yarn.lock changes
Copilot May 23, 2026
0c2e730
chore: update progress after moduleHasErrors reply
Copilot May 23, 2026
7590c1b
chore: revert unintended lockfile re-add
Copilot May 23, 2026
c8be7fc
docs(changelog): add 9.6.0 entry for webpack 4 support feature
Copilot May 23, 2026
61d841d
chore: revert unintended yarn.lock changes
Copilot May 23, 2026
51e9fa2
chore: input fiddling
johnnyreilly May 24, 2026
ecf6959
fix: make isWebpack5 a shared constant
johnnyreilly May 24, 2026
1e88635
fix: add back webpack 5 check
johnnyreilly May 24, 2026
6b02b2a
chore: lock file
johnnyreilly May 24, 2026
7e6d119
fix: stabilize nodeModulesMeaningfulErrorWhenImportingTs comparison o…
Copilot May 24, 2026
90b2860
fix: restore lockfile resolution to unblock comparison tests
Copilot May 24, 2026
d66fb20
fix: do not use feature detection
johnnyreilly May 24, 2026
d7b3285
fix: invalid output for test
johnnyreilly May 24, 2026
11ed78d
fix: remove hallucinations
johnnyreilly May 25, 2026
bd3037c
chore: update eslint
johnnyreilly May 25, 2026
5c7376d
fix: remove more hallucinations / add min ts version to matrix
johnnyreilly May 25, 2026
d65fd4f
fix: webpack 4
johnnyreilly May 25, 2026
06def35
chore: drop old
johnnyreilly May 25, 2026
d74e919
fix: make loader-utils * as a peerDependencies
johnnyreilly May 25, 2026
351a12e
fix: watchRun should cater for webpack 4 dates
johnnyreilly May 25, 2026
811d8e5
fix: webpack 4 errors
johnnyreilly May 25, 2026
8e001a6
fix: lint
johnnyreilly May 25, 2026
05d766d
fix: loaderSource -> details
johnnyreilly May 25, 2026
e1fe960
fix: WebpackError wouldn't work for webpack 4
johnnyreilly May 25, 2026
30b3597
fix: nits
johnnyreilly May 25, 2026
c4fb493
fix: whoops
johnnyreilly May 25, 2026
8332763
fix: do not use SourceMapConsumer if correct version not available
johnnyreilly May 25, 2026
b14e37c
chore: experiment removing resourceResolveData
johnnyreilly May 26, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions .eslintignore

This file was deleted.

37 changes: 0 additions & 37 deletions .eslintrc.js

This file was deleted.

15 changes: 13 additions & 2 deletions .github/workflows/push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,8 @@ jobs:
strategy:
matrix:
node: [26, 24, 22]
ts: [5.0.4, 5.1.3, 5.2.2, 5.3.3, 5.4.2, 5.5.3, 5.6.2, 5.7.2, 5.8.2, 5.9.2, 6.0.2] # next excluded for now
ts: [5.6.2, 5.7.2, 5.8.2, 5.9.2, 6.0.2] # next excluded for now
webpack: [4, 5]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
Expand All @@ -68,6 +69,10 @@ jobs:
- name: install typescript
run: yarn add typescript@${{ matrix.ts }}

- name: install webpack 4
if: matrix.webpack == 4
run: yarn add webpack@^4.47.0 karma-webpack@^4.0.2

- name: test
run: yarn execution-tests

Expand All @@ -76,7 +81,8 @@ jobs:
strategy:
matrix:
node: [26, 24, 22]
ts: [5.0.4, 5.1.3, 5.2.2, 5.3.3, 5.4.2, 5.5.3, 5.6.2, 5.7.2, 5.8.2, 5.9.2, 6.0.2] # next excluded for now
ts: [5.6.2, 5.7.2, 5.8.2, 5.9.2, 6.0.2] # next excluded for now
webpack: [4, 5]
runs-on: windows-latest
steps:
- uses: actions/checkout@v6
Expand Down Expand Up @@ -104,6 +110,11 @@ jobs:
run: yarn add typescript@${{ matrix.ts }}
working-directory: C:\source\ts-loader

- name: install webpack 4
if: matrix.webpack == 4
run: yarn add webpack@^4.47.0 karma-webpack@^4.0.2
working-directory: C:\source\ts-loader

- name: test
run: yarn execution-tests
working-directory: C:\source\ts-loader
Expand Down
1 change: 1 addition & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,6 @@
"git blame": true,
"sed": true,
"yarn": true,
"git check-ignore": true
}
}
4 changes: 3 additions & 1 deletion AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ Use `yarn` (not npm).

## Key commands

Note: test scripts clean test directories first using `git clean -xfd`.

```bash
yarn build # compile src/ → dist/ (tsc --project "./src")
yarn lint # type-check + ESLint (no separate typecheck script)
Expand Down Expand Up @@ -43,7 +45,7 @@ yarn comparison-tests -- --save-output --single-test <name> # regenerate o

## Execution tests (`test/execution-tests/`)

Each sub-directory is a mini webpack project with a Karma/Jasmine test suite. The harness compiles the project and **runs the compiled code** — useful for asserting correct runtime behaviour. These are matrix-tested in CI across Node 20/22 and TypeScript 5.x versions.
Each sub-directory is a mini webpack project with a Karma/Jasmine test suite. The harness compiles the project and **runs the compiled code** — useful for asserting correct runtime behaviour. These are matrix-tested in CI across multiple Node and TypeScript versions (see `.github/workflows/push.yml` for the current matrix).

Full docs: [`test/execution-tests/README.md`](test/execution-tests/README.md)

Expand Down
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# Changelog

## 9.6.0
* [feat: add webpack 4 support back](https://github.com/TypeStrong/ts-loader/pull/1697) - thanks @johnnyreilly

## 9.5.7
* [fix: TS5011 errors with TypeScript 6.0: transpileModule called with rootDir: undefined](https://github.com/TypeStrong/ts-loader/pull/1679) [#1678] - thanks @julioz and @errorx666
* [feat: migrate to trusted publishing](https://github.com/TypeStrong/ts-loader/pull/1680) - thanks @johnnyreilly
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -133,10 +133,10 @@ If you'd like to see a simple setup take a look at [our example](examples/fork-t
### Compatibility

* TypeScript: 3.6.3+
* webpack: 5.x+ (please use `ts-loader` 8.x if you need webpack 4 support)
* webpack: 4.x+ and 5.x+
* node: 12.x+

A full test suite runs each night (and on each pull request). It runs both on Linux and Windows, testing `ts-loader` against major releases of TypeScript. The test suite also runs against TypeScript@next (because we want to use it as much as you do).
A full test suite runs each night (and on each pull request). It runs both on Linux and Windows, testing `ts-loader` against major releases of TypeScript and against both webpack 4 and webpack 5. Comparison tests run against webpack 5 only; execution tests run against both webpack 4 and webpack 5. The test suite also runs against TypeScript@next (because we want to use it as much as you do).

If you become aware of issues not caught by the test suite then please let us know. Better yet, write a test and submit it in a PR!

Expand Down
45 changes: 45 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
import js from '@eslint/js';
import { defineConfig } from 'eslint/config';
import tseslint from 'typescript-eslint';

export default defineConfig(
js.configs.recommended,
tseslint.configs.recommendedTypeChecked,
{
files: ['eslint.config.mjs'],
extends: [tseslint.configs.disableTypeChecked],
},
{
files: ['**/*.ts', '**/*.tsx'],
languageOptions: {
parserOptions: {
projectService: true
},
},
rules: {
'no-prototype-builtins': 'off',
'@typescript-eslint/no-unsafe-enum-comparison': 'off',
'@typescript-eslint/unbound-method': 'off',
'@typescript-eslint/no-unsafe-call': 'off',
'@typescript-eslint/no-unsafe-assignment': 'off',
'@typescript-eslint/no-unsafe-member-access': 'off',
'@typescript-eslint/no-unsafe-return': 'off',
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/no-require-imports': 'off',
'@typescript-eslint/consistent-type-imports': 'error',
'@typescript-eslint/no-unsafe-argument': 'off',
'@typescript-eslint/no-unused-vars': [
'error',
{
'args': 'all',
'argsIgnorePattern': '^_',
'caughtErrors': 'all',
'caughtErrorsIgnorePattern': '^_',
'destructuredArrayIgnorePattern': '^_',
'varsIgnorePattern': '^_',
'ignoreRestSiblings': true
}
]
},
},
);
22 changes: 14 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"types": "dist",
"scripts": {
"build": "tsc --version && tsc --project \"./src\"",
"lint": "tsc --project \"./src\" --noEmit && eslint -c .eslintrc.js --ext .ts ./src",
"lint": "tsc --project \"./src\" --noEmit && eslint --ext .ts ./src",
"comparison-tests": "git clean -xfd test/comparison-tests && npm link --legacy-peer-deps ./test/comparison-tests/testLib && node test/comparison-tests/run-tests.js",
"execution-tests": "git clean -xfd test/execution-tests && node test/execution-tests/run-tests.js",
"test": "git clean -xfd test/comparison-tests && git clean -xfd test/execution-tests && node test/run-tests.js",
Expand Down Expand Up @@ -60,11 +60,10 @@
"source-map": "^0.7.4"
},
"devDependencies": {
"@eslint/js": "^10.0.1",
"@types/micromatch": "^4.0.0",
"@types/node": "*",
"@types/semver": "^7.3.4",
"@typescript-eslint/eslint-plugin": "^6.0.0",
"@typescript-eslint/parser": "^6.0.0",
"babel": "^6.0.0",
"babel-core": "^6.0.0",
"babel-loader": "^7.0.0",
Expand All @@ -73,10 +72,9 @@
"babel-preset-es2016": "^6.16.0",
"babel-preset-react": "^6.0.0",
"escape-string-regexp": "^2.0.0",
"eslint": "^8.0.0",
"eslint-config-prettier": "^8.0.0",
"eslint-plugin-node": "^11.1.0",
"eslint-plugin-prettier": "^4.0.0",
"eslint": "^10.0.0",
"eslint-config-prettier": "^10.0.0",
"eslint-plugin-n": "^17.0.0",
"fs-extra": "^11.0.0",
"glob": "^7.1.1",
"husky": "^8.0.0",
Expand All @@ -88,18 +86,26 @@
"karma-sourcemap-loader": "^0.4.0",
"karma-webpack": "^5.0.0",
"lint-staged": "^8.0.0",
"loader-utils": "^1.4.2",
"markdown-toc": "^1.2.0",
"mkdirp": "^0.5.1",
"mocha": "^6.0.0",
"prettier": "^2.0.5",
"rimraf": "^2.6.2",
"typescript": "^6.0.2",
"typescript-eslint": "^8.59.4",
"webpack": "^5.74.0",
"webpack-cli": "^4.10.0"
},
"peerDependencies": {
"loader-utils": "*",
"typescript": "*",
"webpack": "^5.0.0"
"webpack": "^4.0.0 || ^5.0.0"
},
"peerDependenciesMeta": {
"loader-utils": {
"optional": true
}
},
"publishConfig": {
"provenance": true
Expand Down
Loading
Loading