Skip to content
This repository has been archived by the owner on Feb 18, 2024. It is now read-only.

How to modify Heap Memory Limit? #355

Closed
pgh268400 opened this issue Sep 30, 2023 · 1 comment
Closed

How to modify Heap Memory Limit? #355

pgh268400 opened this issue Sep 30, 2023 · 1 comment

Comments

@pgh268400
Copy link

const { defineConfig } = require("@vue/cli-service");
const NodePolyfillPlugin = require("node-polyfill-webpack-plugin");
const ForkTsCheckerWebpackPlugin = require("fork-ts-checker-webpack-plugin");

module.exports = defineConfig({
  transpileDependencies: ["vuetify"],
  configureWebpack: {
    plugins: [
      new NodePolyfillPlugin(),
      new ForkTsCheckerWebpackPlugin({ typescript: { memoryLimit: 14000 } }),
    ],
    target: "electron-renderer",
  },
  pluginOptions: {
    electronBuilder: {
      mainProcessFile: "./src/main/background.ts",
      chainWebpackMainProcess: (config) => {
        config.module
          .rule("babel")
          .before("ts")
          // .test(/C:\\Users\\pgh26\\Lab\\JavaScript\\DCParser\\dcparser\.ts$/)
          .test(/src\\main\\modules\\dcparser\.ts$/)
          .use("babel")
          .loader("babel-loader")
          .options({
            presets: [["@babel/preset-env", { modules: false }]],
            plugins: ["@babel/plugin-proposal-class-properties"],
          });

        config
          .plugin("fork-ts-checker-webpack-plugin")
          .use("fork-ts-checker-webpack-plugin")
          .tap((args) => {
            args.push({
              typescript: {
                memoryLimit: 14000,
              },
            });
            return args;
          });
      },
      chainWebpackRendererProcess: (config) => {
        config
          .plugin("fork-ts-checker-webpack-plugin")
          .use("fork-ts-checker-webpack-plugin")
          .tap((args) => {
            args.push({
              typescript: {
                memoryLimit: 14000,
              },
            });
            return args;
          });
      },
      nsis: {
        shortcutName: "DCExplorer", // Shortcut name
        artifactName: "DCExplorer.${ext}", // Installation package name
      },
      win: {
        target: [
          {
            target: "portable",
            arch: ["ia32", "x64"],
          },
        ],
      },
    },
  },
  pages: {
    index: "./src/renderer/main.ts",
  },
});

Hello, I'm building an electron app using vue-cli-plugin-electron-builder.

I tried several ways to fix the heap memory limit, but all failed.

The only clue is to use the fork-ts-checker plug-in to release the memory limitation in the webpack chain, but the memory limitation will not be fixed.

Please help me... :(((

@edmorley
Copy link
Member

edmorley commented Feb 3, 2024

Closing since this project is no longer maintained:
#358

@edmorley edmorley closed this as not planned Won't fix, can't repro, duplicate, stale Feb 3, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

No branches or pull requests

2 participants