webpack.plugins.ts 685 B

12345678910111213141516171819202122
  1. import type IForkTsCheckerWebpackPlugin from "fork-ts-checker-webpack-plugin";
  2. // eslint-disable-next-line @typescript-eslint/no-var-requires
  3. const ForkTsCheckerWebpackPlugin: typeof IForkTsCheckerWebpackPlugin = require("fork-ts-checker-webpack-plugin");
  4. const relocateLoader = require("@vercel/webpack-asset-relocator-loader");
  5. export const plugins = [
  6. new ForkTsCheckerWebpackPlugin({
  7. logger: "webpack-infrastructure",
  8. }),
  9. {
  10. apply(compiler: any) {
  11. compiler.hooks.compilation.tap(
  12. "webpack-asset-relocator-loader",
  13. (compilation: any) => {
  14. relocateLoader.initAssetCache(compilation, "native_modules");
  15. }
  16. );
  17. },
  18. },
  19. ];