Skip to content

Commit c2d1ca2

Browse files
johnnyreillysokra
andauthored
webpack 5 migration (#1251)
* start webpack 5 migration * fixes * compiles now * upgrade karma webpack * drop webpack 4 code branches * regenerate test output * Stop testing TypeScript 3.6 and 3.7 * remove flaky test * delete ignored tests * upgrade chrome laungcher * upgrade to 4.1.5 * implement @alexandar-akait's suggestion * use webpack.sources.RawSource as suggested by @JonWallsten * upgrade webpack introduce flaky test mechanism for platform * execution tests on windows execute in c:\source\ts-loader * ignore test failures on windows * Update create-and-execute-test.js * Update create-and-execute-test.js * Update create-and-execute-test.js * Update create-and-execute-test.js * Update create-and-execute-test.js * Update create-and-execute-test.js * Update create-and-execute-test.js * Update create-and-execute-test.js * Update create-and-execute-test.js * Update create-and-execute-test.js * fix test cases on windows (#1273) * Update after-compile.ts * Update create-and-execute-test.js * Update CHANGELOG.md * make node 12 the minimum version * Update push.yml * Update README.md * remove 3.6 test output * remove 3.7 test output * remove 3.8 test output * remove 3.9 test output * remove 4.0 test output * tidy * fix * lint should compile too * delete unused * remove unused * upgrade karma * upgrade fs-extra * upgrade types and eslint * remove html-webpack-plugin as unused * update changelog * update vanilla example * use webpack type * enrich WebpackLoaderContext type * target es2018 Co-authored-by: Tobias Koppers <tobias.koppers@googlemail.com>
1 parent 8a32b04 commit c2d1ca2

File tree

4,772 files changed

+21385
-232412
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

4,772 files changed

+21385
-232412
lines changed

.devcontainer/devcontainer.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@
1111

1212
// Add the IDs of extensions you want installed when the container is created.
1313
"extensions": [
14-
"dbaeumer.vscode-eslint"
14+
"dbaeumer.vscode-eslint",
15+
"esbenp.prettier-vscode"
1516
],
1617

1718
// Use 'forwardPorts' to make a list of ports inside the container available locally.

.eslintrc.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
module.exports = {
22
root: true,
33
parser: '@typescript-eslint/parser',
4-
extends: ['plugin:node/recommended', 'plugin:prettier/recommended'],
4+
extends: ['plugin:node/recommended'/*, 'plugin:prettier/recommended'*/],
55
parserOptions: {
66
ecmaVersion: 2018,
77
sourceType: 'module',
@@ -20,8 +20,7 @@ module.exports = {
2020
files: ['*.ts'],
2121
extends: [
2222
'plugin:@typescript-eslint/recommended', // Uses the recommended rules from the @typescript-eslint/eslint-plugin
23-
'prettier/@typescript-eslint', // Uses eslint-config-prettier to disable ESLint rules from @typescript-eslint/eslint-plugin that would conflict with prettier
24-
'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.
23+
'prettier', // Uses eslint-config-prettier to disable ESLint rules from @typescript-eslint/eslint-plugin that would conflict with prettier
2524
],
2625
rules: {
2726
'node/no-unsupported-features/es-syntax': 'off',

.travis.yml

Lines changed: 0 additions & 24 deletions
This file was deleted.

CHANGELOG.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,14 @@
11
# Changelog
22

3+
## v9.0.0
4+
5+
Breaking changes:
6+
- minimum webpack version: 5
7+
- minimum node version: 12
8+
9+
Changes:
10+
* [webpack 5 migration](https://github.com/TypeStrong/ts-loader/pull/1251) - thanks @johnnyreilly, @jonwallsten, @sokra, @appzuka, @alexandar-akait
11+
312
## v8.1.0
413
* [feat: remove top-level typescript import statements](https://github.com/TypeStrong/ts-loader/pull/1259) - thanks @ulivz
514

README.md

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -129,23 +129,13 @@ If you'd like to see a simple setup take a look at [our simple example](examples
129129

130130
`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).
131131

132-
### Parallelising Builds
133-
134-
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)
135-
136-
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.)
137-
138-
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.
139-
140-
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).
141-
142132
### Compatibility
143133

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

148-
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).
138+
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).
149139

150140
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!
151141

examples/vanilla/package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@
77
"start": "webpack-dev-server --mode development --progress --color"
88
},
99
"devDependencies": {
10-
"ts-loader": "^5.0.0",
11-
"typescript": "^3.0.0",
12-
"webpack": "^4.0.0",
13-
"webpack-cli": "^3.0.0",
10+
"ts-loader": "^8.0.0",
11+
"typescript": "^4.1.0",
12+
"webpack": "^5.0.0",
13+
"webpack-cli": "^4.6.0",
1414
"webpack-dev-server": "^3.1.14"
1515
}
1616
}

examples/vanilla/webpack.config.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ const path = require('path');
33

44
module.exports = {
55
devtool: 'inline-source-map',
6+
mode: 'development',
67
entry: './src/index.ts',
78
output: {
89
filename: 'main.js',

0 commit comments

Comments
 (0)