Skip to content

Commit

Permalink
chore: add fork-ts-checker-webpack-plugin example (#3269)
Browse files Browse the repository at this point in the history
  • Loading branch information
hardfist authored May 23, 2023
1 parent 4be44cc commit e271998
Show file tree
Hide file tree
Showing 6 changed files with 62 additions and 16 deletions.
3 changes: 2 additions & 1 deletion examples/plugin-compat/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
}
2 changes: 2 additions & 0 deletions examples/plugin-compat/rspack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -62,6 +63,7 @@ const config = {
perChunkOutput: true,
outputFilename: `3rdpartylicenses.txt`
}),
new checkPlugin(),
new manifestPlugin({
fileName: "rspack-manifest.json",
generate: (seed, files, entries) => {
Expand Down
4 changes: 2 additions & 2 deletions examples/plugin-compat/src/index.js
Original file line number Diff line number Diff line change
@@ -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 });
1 change: 1 addition & 0 deletions examples/plugin-compat/src/secret.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export const secret = "rspack";
8 changes: 8 additions & 0 deletions examples/plugin-compat/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"compilerOptions": {
"isolatedModules": true,
"module": "ESNext",
"target": "es5"
},
"include": ["src/*"]
}
60 changes: 47 additions & 13 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit e271998

Please sign in to comment.