Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

webpack 5 migration #1251

Merged
merged 62 commits into from
Apr 18, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
62 commits
Select commit Hold shift + click to select a range
f710e4a
start webpack 5 migration
johnnyreilly Feb 4, 2021
64d0362
fixes
johnnyreilly Feb 4, 2021
9c0053b
Merge branch 'master' of https://github.com/TypeStrong/ts-loader into…
johnnyreilly Feb 18, 2021
ad9b5da
compiles now
johnnyreilly Feb 18, 2021
18fc051
upgrade karma webpack
johnnyreilly Feb 18, 2021
f7dbab6
drop webpack 4 code branches
johnnyreilly Feb 18, 2021
f1cb0b3
regenerate test output
johnnyreilly Feb 18, 2021
6735192
Stop testing TypeScript 3.6 and 3.7
johnnyreilly Feb 18, 2021
48189c5
Merge branch 'master' into feat/webpack-5
johnnyreilly Feb 18, 2021
aca4d56
remove flaky test
johnnyreilly Feb 19, 2021
fbf77c1
delete ignored tests
johnnyreilly Feb 19, 2021
f5f822f
Merge branch 'feat/webpack-5' of https://github.com/TypeStrong/ts-loa…
johnnyreilly Feb 19, 2021
0cdd722
upgrade chrome laungcher
johnnyreilly Feb 19, 2021
98ad6c8
upgrade to 4.1.5
johnnyreilly Feb 19, 2021
a3141f0
Merge branch 'master' of https://github.com/TypeStrong/ts-loader into…
johnnyreilly Mar 16, 2021
4bcc5c9
implement @alexandar-akait's suggestion
johnnyreilly Mar 16, 2021
27da1c0
use webpack.sources.RawSource as suggested by @JonWallsten
johnnyreilly Mar 16, 2021
5d0e875
upgrade webpack introduce flaky test mechanism for platform
johnnyreilly Mar 20, 2021
5da1eef
execution tests on windows execute in c:\source\ts-loader
johnnyreilly Mar 20, 2021
50b6c1a
ignore test failures on windows
johnnyreilly Mar 20, 2021
39ccab8
Update create-and-execute-test.js
johnnyreilly Mar 20, 2021
4b978c2
Update create-and-execute-test.js
johnnyreilly Mar 20, 2021
3809936
Update create-and-execute-test.js
johnnyreilly Mar 21, 2021
975d57b
Update create-and-execute-test.js
johnnyreilly Mar 21, 2021
c37e1b1
Update create-and-execute-test.js
johnnyreilly Mar 21, 2021
869420e
Update create-and-execute-test.js
johnnyreilly Mar 21, 2021
f4a895a
Update create-and-execute-test.js
johnnyreilly Mar 21, 2021
531880e
Update create-and-execute-test.js
johnnyreilly Mar 21, 2021
193b79b
Update create-and-execute-test.js
johnnyreilly Mar 21, 2021
64b5048
Update create-and-execute-test.js
johnnyreilly Mar 23, 2021
235747c
fix test cases on windows (#1273)
sokra Mar 24, 2021
427714e
Update after-compile.ts
johnnyreilly Mar 24, 2021
ffbe7bc
Update create-and-execute-test.js
johnnyreilly Mar 24, 2021
40e5a3d
Update CHANGELOG.md
johnnyreilly Mar 25, 2021
2e66ff6
make node 12 the minimum version
johnnyreilly Mar 25, 2021
089a1e8
Update push.yml
johnnyreilly Mar 25, 2021
cec5ddd
Update README.md
johnnyreilly Mar 25, 2021
9d7fe73
remove 3.6 test output
johnnyreilly Mar 27, 2021
486535c
remove 3.7 test output
johnnyreilly Mar 27, 2021
b20f307
remove 3.8 test output
johnnyreilly Mar 27, 2021
357322c
remove 3.9 test output
johnnyreilly Mar 27, 2021
0c2faf4
remove 4.0 test output
johnnyreilly Mar 27, 2021
6aa256c
tidy
johnnyreilly Mar 27, 2021
31cd017
fix
johnnyreilly Mar 27, 2021
3483b1c
lint should compile too
johnnyreilly Mar 27, 2021
46452b6
delete unused
johnnyreilly Mar 28, 2021
c80b5d3
Merge branch 'main' into feat/webpack-5
johnnyreilly Mar 28, 2021
1cf9088
remove unused
johnnyreilly Mar 28, 2021
fec8470
Merge branch 'main' into feat/webpack-5
johnnyreilly Mar 28, 2021
df65353
upgrade karma
johnnyreilly Mar 28, 2021
f3e5d81
upgrade fs-extra
johnnyreilly Mar 28, 2021
0c12003
upgrade types and eslint
johnnyreilly Mar 28, 2021
6c81dae
remove html-webpack-plugin as unused
johnnyreilly Mar 28, 2021
7963eec
Merge branch 'main' into feat/webpack-5
johnnyreilly Apr 7, 2021
9a5c8ae
update changelog
johnnyreilly Apr 15, 2021
997c17d
Merge branch 'feat/webpack-5' of https://github.com/TypeStrong/ts-loa…
johnnyreilly Apr 15, 2021
bada1e4
Merge branch 'main' into feat/webpack-5
johnnyreilly Apr 16, 2021
1df5557
update vanilla example
johnnyreilly Apr 16, 2021
2edf96c
use webpack type
johnnyreilly Apr 16, 2021
f3089d2
Merge branch 'feat/webpack-5' of https://github.com/TypeStrong/ts-loa…
johnnyreilly Apr 16, 2021
acbc71f
enrich WebpackLoaderContext type
johnnyreilly Apr 17, 2021
62558c0
target es2018
johnnyreilly Apr 18, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
The diff you're trying to view is too large. We only load the first 3000 changed files.
3 changes: 2 additions & 1 deletion .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@

// Add the IDs of extensions you want installed when the container is created.
"extensions": [
"dbaeumer.vscode-eslint"
"dbaeumer.vscode-eslint",
"esbenp.prettier-vscode"
],

// Use 'forwardPorts' to make a list of ports inside the container available locally.
Expand Down
5 changes: 2 additions & 3 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
module.exports = {
root: true,
parser: '@typescript-eslint/parser',
extends: ['plugin:node/recommended', 'plugin:prettier/recommended'],
extends: ['plugin:node/recommended'/*, 'plugin:prettier/recommended'*/],
parserOptions: {
ecmaVersion: 2018,
sourceType: 'module',
Expand All @@ -20,8 +20,7 @@ module.exports = {
files: ['*.ts'],
extends: [
'plugin:@typescript-eslint/recommended', // Uses the recommended rules from the @typescript-eslint/eslint-plugin
'prettier/@typescript-eslint', // Uses eslint-config-prettier to disable ESLint rules from @typescript-eslint/eslint-plugin that would conflict with prettier
'plugin:prettier/recommended', // Enables eslint-plugin-prettier and eslint-config-prettier. This will display prettier errors as ESLint errors. Make sure this is always the last configuration in the extends array.
'prettier', // Uses eslint-config-prettier to disable ESLint rules from @typescript-eslint/eslint-plugin that would conflict with prettier
],
rules: {
'node/no-unsupported-features/es-syntax': 'off',
Expand Down
24 changes: 0 additions & 24 deletions .travis.yml

This file was deleted.

9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
# Changelog

## v9.0.0

Breaking changes:
- minimum webpack version: 5
- minimum node version: 12

Changes:
* [webpack 5 migration](https://github.com/TypeStrong/ts-loader/pull/1251) - thanks @johnnyreilly, @jonwallsten, @sokra, @appzuka, @alexandar-akait

## v8.1.0
* [feat: remove top-level typescript import statements](https://github.com/TypeStrong/ts-loader/pull/1259) - thanks @ulivz

Expand Down
16 changes: 3 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -129,23 +129,13 @@ If you'd like to see a simple setup take a look at [our simple example](examples

`ts-loader` works very well in combination with [babel](https://babeljs.io/) and [babel-loader](https://github.com/babel/babel-loader). There is an [example](https://github.com/Microsoft/TypeScriptSamples/tree/master/react-flux-babel-karma) of this in the official [TypeScript Samples](https://github.com/Microsoft/TypeScriptSamples).

### Parallelising Builds

It's possible to parallelise your builds. Historically this was useful from a performance perspective with webpack 2 / 3. [With webpack 4+ there appears to be significantly less benefit and perhaps even cost.](https://blog.johnnyreilly.com/2018/12/you-might-not-need-thread-loader.html)

But if that's what you want to do, there's two ways to achieve this: [happypack](https://github.com/amireh/happypack) and [thread-loader](https://github.com/webpack-contrib/thread-loader). Both should be used in combination with [fork-ts-checker-webpack-plugin](https://github.com/Realytics/fork-ts-checker-webpack-plugin) for typechecking.)

To read more, look at [this post](https://medium.com/webpack/typescript-webpack-super-pursuit-mode-83cc568dea79) by [@johnny_reilly](https://twitter.com/johnny_reilly) on the webpack publication channel.

If you'd like find out further ways to improve your build using the watch API then take a look at [this post](https://medium.com/@kenneth_chau/speeding-up-webpack-typescript-incremental-builds-by-7x-3912ba4c1d15) by [@kenneth_chau](https://twitter.com/kenneth_chau).

### Compatibility

* TypeScript: 3.6.3+
* webpack: 4.x+ (please use `ts-loader` 3.x if you need webpack 2 or 3 support)
* node: 6.11.5 minimum (aligned with webpack 4)
* webpack: 5.x+ (please use `ts-loader` 8.x if you need webpack 4 support)
* node: 12.x+

A full test suite runs each night (and on each pull request). It runs both on [Linux](https://travis-ci.org/TypeStrong/ts-loader) and [Windows](https://ci.appveyor.com/project/JohnReilly/ts-loader), 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. 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
8 changes: 4 additions & 4 deletions examples/vanilla/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@
"start": "webpack-dev-server --mode development --progress --color"
},
"devDependencies": {
"ts-loader": "^5.0.0",
"typescript": "^3.0.0",
"webpack": "^4.0.0",
"webpack-cli": "^3.0.0",
"ts-loader": "^8.0.0",
"typescript": "^4.1.0",
"webpack": "^5.0.0",
"webpack-cli": "^4.6.0",
"webpack-dev-server": "^3.1.14"
}
}
1 change: 1 addition & 0 deletions examples/vanilla/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ const path = require('path');

module.exports = {
devtool: 'inline-source-map',
mode: 'development',
entry: './src/index.ts',
output: {
filename: 'main.js',
Expand Down
Loading