diff --git a/examples/plugin-compat/package.json b/examples/plugin-compat/package.json index 852982771c5..027bf347b85 100644 --- a/examples/plugin-compat/package.json +++ b/examples/plugin-compat/package.json @@ -19,6 +19,7 @@ "license-webpack-plugin": "^4.0.2", "webpack-bundle-analyzer": "4.7.0", "webpack-stats-plugin": "1.1.1", - "rspack-manifest-plugin": "5.0.0-alpha0" + "rspack-manifest-plugin": "5.0.0-alpha0", + "fork-ts-checker-webpack-plugin": "8.0.0" } } diff --git a/examples/plugin-compat/rspack.config.js b/examples/plugin-compat/rspack.config.js index e5777d69d1b..02a55ec0f7f 100644 --- a/examples/plugin-compat/rspack.config.js +++ b/examples/plugin-compat/rspack.config.js @@ -7,6 +7,7 @@ const minifyPlugin = require("@rspack/plugin-minify"); const manifestPlugin = require("rspack-manifest-plugin").WebpackManifestPlugin; const GeneratePackageJsonPlugin = require("generate-package-json-webpack-plugin"); const licensePlugin = require("license-webpack-plugin"); +const checkPlugin = require("fork-ts-checker-webpack-plugin"); /** @type {import('@rspack/cli').Configuration} */ const config = { target: "node", @@ -62,6 +63,7 @@ const config = { perChunkOutput: true, outputFilename: `3rdpartylicenses.txt` }), + new checkPlugin(), new manifestPlugin({ fileName: "rspack-manifest.json", generate: (seed, files, entries) => { diff --git a/examples/plugin-compat/src/index.js b/examples/plugin-compat/src/index.js index 5b9acdfe8da..3760540b55e 100644 --- a/examples/plugin-compat/src/index.js +++ b/examples/plugin-compat/src/index.js @@ -1,6 +1,6 @@ import { answer } from "./answer"; +import { secret } from "./secret"; import "./index.css"; // Importing the below dependency to force to create the 3rdpartylicenses.txt file (license-webpack-plugin's output) import { plugin } from "copy-webpack-plugin"; - -console.log({ answer }); +console.log({ answer, secret }); diff --git a/examples/plugin-compat/src/secret.ts b/examples/plugin-compat/src/secret.ts new file mode 100644 index 00000000000..f1b06f7ecb0 --- /dev/null +++ b/examples/plugin-compat/src/secret.ts @@ -0,0 +1 @@ +export const secret = "rspack"; diff --git a/examples/plugin-compat/tsconfig.json b/examples/plugin-compat/tsconfig.json new file mode 100644 index 00000000000..7cc0c272bd4 --- /dev/null +++ b/examples/plugin-compat/tsconfig.json @@ -0,0 +1,8 @@ +{ + "compilerOptions": { + "isolatedModules": true, + "module": "ESNext", + "target": "es5" + }, + "include": ["src/*"] +} diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index b7f6f1a83a7..d62e5d3ddf3 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -413,6 +413,7 @@ importers: '@rspack/plugin-html': workspace:* '@rspack/plugin-minify': workspace:* copy-webpack-plugin: 5.1.2 + fork-ts-checker-webpack-plugin: 8.0.0 generate-package-json-webpack-plugin: ^2.6.0 license-webpack-plugin: ^4.0.2 rspack-manifest-plugin: 5.0.0-alpha0 @@ -423,6 +424,7 @@ importers: '@rspack/plugin-html': link:../../packages/rspack-plugin-html '@rspack/plugin-minify': link:../../packages/rspack-plugin-minify copy-webpack-plugin: 5.1.2 + fork-ts-checker-webpack-plugin: 8.0.0 generate-package-json-webpack-plugin: 2.6.0 license-webpack-plugin: 4.0.2 rspack-manifest-plugin: 5.0.0-alpha0 @@ -4933,7 +4935,7 @@ packages: resolution: {integrity: sha512-ts5FFU/dSUPS13tv8XiEObDu9K+iagEKME9kAbaP7r0Y9KtZJZ+NGndDvWoRAYNpeWafbpFeki3q9QoMD6gxyw==} engines: {node: '>=6.9.0'} dependencies: - '@babel/code-frame': 7.18.6 + '@babel/code-frame': 7.21.4 '@babel/generator': 7.21.1 '@babel/helper-environment-visitor': 7.18.9 '@babel/helper-function-name': 7.21.0 @@ -4950,7 +4952,7 @@ packages: resolution: {integrity: sha512-ts5FFU/dSUPS13tv8XiEObDu9K+iagEKME9kAbaP7r0Y9KtZJZ+NGndDvWoRAYNpeWafbpFeki3q9QoMD6gxyw==} engines: {node: '>=6.9.0'} dependencies: - '@babel/code-frame': 7.18.6 + '@babel/code-frame': 7.21.4 '@babel/generator': 7.21.1 '@babel/helper-environment-visitor': 7.18.9 '@babel/helper-function-name': 7.21.0 @@ -6532,14 +6534,14 @@ packages: engines: {node: ^12.13.0 || ^14.15.0 || >=16.0.0} dependencies: '@gar/promisify': 1.1.3 - semver: 7.4.0 + semver: 7.5.1 dev: true /@npmcli/fs/3.1.0: resolution: {integrity: sha512-7kZUAaLscfgbwBQRbvdMYaZOWyMEcPTH/tJjnyAWJ/dvvs9Ef+CERx/qJb9GExJpl1qipaDGn7KqHnFGGixd0w==} engines: {node: ^14.17.0 || ^16.13.0 || >=18.0.0} dependencies: - semver: 7.4.0 + semver: 7.5.1 dev: true /@npmcli/git/4.0.4: @@ -6552,7 +6554,7 @@ packages: proc-log: 3.0.0 promise-inflight: 1.0.1 promise-retry: 2.0.1 - semver: 7.4.0 + semver: 7.5.1 which: 3.0.0 transitivePeerDependencies: - bluebird @@ -10349,7 +10351,7 @@ packages: /builtins/5.0.1: resolution: {integrity: sha512-qwVpFEHNfhYJIzNRBvd2C1kyo6jz3ZSMPyyuR47OPdiKWlbYnZNyDWuyR175qDnAJLiCo5fBBqPb3RiXgWlkOQ==} dependencies: - semver: 7.4.0 + semver: 7.5.1 dev: true /bundle-stats/4.1.6: @@ -13222,6 +13224,27 @@ packages: signal-exit: 4.0.1 dev: true + /fork-ts-checker-webpack-plugin/8.0.0: + resolution: {integrity: sha512-mX3qW3idpueT2klaQXBzrIM/pHw+T0B/V9KHEvNrqijTq9NFnMZU6oreVxDYcf33P8a5cW+67PjodNHthGnNVg==} + engines: {node: '>=12.13.0', yarn: '>=1.0.0'} + peerDependencies: + typescript: '>3.6.0' + webpack: ^5.11.0 + dependencies: + '@babel/code-frame': 7.21.4 + chalk: 4.1.2 + chokidar: 3.5.3 + cosmiconfig: 7.1.0 + deepmerge: 4.2.2 + fs-extra: 10.1.0 + memfs: 3.4.12 + minimatch: 3.1.2 + node-abort-controller: 3.1.1 + schema-utils: 3.1.2 + semver: 7.5.1 + tapable: 2.2.1 + dev: true + /formdata-polyfill/4.0.10: resolution: {integrity: sha512-buewHzMvYL29jdeQTVILecSaZKnt/RJWjoZCF5OW60Z67/GmSLBkOFM7qh1PI3zFNtJbaZL5eQu1vLfazOwj4g==} engines: {node: '>=12.20.0'} @@ -13267,7 +13290,6 @@ packages: graceful-fs: 4.2.10 jsonfile: 6.1.0 universalify: 2.0.0 - dev: false /fs-extra/11.1.0: resolution: {integrity: sha512-0rcTq621PD5jM/e0a3EJoGC/1TC5ZBCERW82LQuwfGnCa1V8w7dpYH1yNu+SLb6E5dkeCBzKEyLGlFrnr+dUyw==} @@ -15303,7 +15325,7 @@ packages: jest-util: 29.5.0 natural-compare: 1.4.0 pretty-format: 29.5.0 - semver: 7.4.0 + semver: 7.5.1 transitivePeerDependencies: - supports-color dev: true @@ -17115,6 +17137,10 @@ packages: lower-case: 2.0.2 tslib: 2.5.0 + /node-abort-controller/3.1.1: + resolution: {integrity: sha512-AGK2yQKIjRuqnc6VkX2Xj5d+QW8xZ87pa1UK6yA6ouUyuxfHuMP6umE5QK7UmTeOAymo+Zx1Fxiuw9rVx8taHQ==} + dev: true + /node-addon-api/3.2.1: resolution: {integrity: sha512-mmcei9JghVNDYydghQmeDX8KoAm0FAiYyIcUt/N4nhyAipB17pllZQDOJD2fotxABnt4Mdz+dKTO7eftLg4d0A==} dev: true @@ -17173,7 +17199,7 @@ packages: nopt: 6.0.0 npmlog: 6.0.2 rimraf: 3.0.2 - semver: 7.4.0 + semver: 7.5.1 tar: 6.1.13 which: 2.0.2 transitivePeerDependencies: @@ -17223,7 +17249,7 @@ packages: dependencies: hosted-git-info: 6.1.1 is-core-module: 2.12.0 - semver: 7.4.0 + semver: 7.5.1 validate-npm-package-license: 3.0.4 dev: true @@ -17275,7 +17301,7 @@ packages: resolution: {integrity: sha512-dH3GmQL4vsPtld59cOn8uY0iOqRmqKvV+DLGwNXV/Q7MDgD2QfOADWd/mFXcIE5LVhYYGjA3baz6W9JneqnuCw==} engines: {node: ^14.17.0 || ^16.13.0 || >=18.0.0} dependencies: - semver: 7.4.0 + semver: 7.5.1 dev: true /npm-normalize-package-bin/3.0.1: @@ -17816,7 +17842,7 @@ packages: resolution: {integrity: sha512-ayCKvm/phCGxOkYRSCM82iDwct8/EonSEgCSxWxD7ve6jHggsFl4fZVQBPRNgQoKiuV/odhFrGzQXZwbifC8Rg==} engines: {node: '>=8'} dependencies: - '@babel/code-frame': 7.18.6 + '@babel/code-frame': 7.21.4 error-ex: 1.3.2 json-parse-even-better-errors: 2.3.1 lines-and-columns: 1.2.4 @@ -19988,6 +20014,14 @@ packages: lru-cache: 6.0.0 dev: true + /semver/7.5.1: + resolution: {integrity: sha512-Wvss5ivl8TMRZXXESstBA4uR5iXgEN/VC5/sOcuXdVLzcdkz4HWetIoRfG5gb5X+ij/G9rw9YoGn3QoQ8OCSpw==} + engines: {node: '>=10'} + hasBin: true + dependencies: + lru-cache: 6.0.0 + dev: true + /send/0.18.0: resolution: {integrity: sha512-qqWzuOjSFOuqPjFe4NOsMLafToQQwBSOEpS+FwEt3A2V3vKubTquT3vmLTQpFgMXp8AlFWFuP1qKaJZOtPpVXg==} engines: {node: '>= 0.8.0'} @@ -22090,7 +22124,7 @@ packages: is-yarn-global: 0.3.0 latest-version: 5.1.0 pupa: 2.1.1 - semver: 7.4.0 + semver: 7.5.1 semver-diff: 3.1.1 xdg-basedir: 4.0.0 dev: true