How to use the fork-ts-checker-webpack-plugin.ONE_CPU function in fork-ts-checker-webpack-plugin

To help you get started, we’ve selected a few fork-ts-checker-webpack-plugin examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github ng-qt / ng-qt / packages / builders / lib / build / create-webpack-config.js View on Github external
configFile: options.tsConfig,
          extensions,
          mainFields,
        }),
      ],
      mainFields,
    },
    performance: {
      hints: false,
    },
    plugins: [
      new ForkTsCheckerWebpackPlugin({
        tsconfig: options.tsConfig,
        useTypescriptIncrementalApi: options.useTypescriptIncrementalApi,
        workers: options.useTypescriptIncrementalApi
          ? ForkTsCheckerWebpackPlugin.ONE_CPU
          : options.maxWorkers || ForkTsCheckerWebpackPlugin.TWO_CPUS_FREE,
      }),
    ],
    stats: getStatsConfig(options),
  };
  const extraPlugins = [];
  if (options.progress) {
    extraPlugins.push(new webpack_1.ProgressPlugin());
  }
  // process asset entries
  if (options.assets) {
    const copyWebpackPluginPatterns = options.assets.map(asset => {
      return {
        context: asset.input,
        // Now we remove starting slash to make Webpack place it from the output root.
        to: asset.output,
github stardog-union / stardog-language-servers / packages / stardog-graphql-language-server / webpack.config.js View on Github external
},
        ],
        exclude: [/node_modules/],
      }
    ],
  },
  resolve: {
    modules: [SRC_DIR, 'node_modules'],
    extensions: ['.ts', '.js'],
  },
  plugins: [
    new ForkTsCheckerWebpackPlugin({
      tsconfig: path.resolve(__dirname, 'tsconfig.json'),
      watch: SRC_DIR,
      // CI memory limits make building with more than one CPU for type-checking too fragile, unfortunately
      workers: isCI ? ForkTsCheckerWebpackPlugin.ONE_CPU : ForkTsCheckerWebpackPlugin.TWO_CPUS_FREE,
      memoryLimit: 4096,
    }),
  ],
  devtool: 'source-map',
  node: {
    child_process: 'empty',
    net: 'empty',
    fs: 'empty',
    net: 'empty',
  },
  optimization: {
    minimizer: [
      new TerserPlugin({
        sourceMap: true,
        terserOptions: {
          // Chevrotain does not cooperate with webpack mangling (see here: https://sap.github.io/chevrotain/docs/FAQ.html#MINIFIED).
github stardog-union / stardog-language-servers / packages / stardog-language-utils / webpack.config.js View on Github external
],
        exclude: [/node_modules/],
      },
    ],
  },
  resolve: {
    modules: [SRC_DIR, 'node_modules'],
    extensions: ['.ts', '.js'],
  },
  plugins: [
    new ForkTsCheckerWebpackPlugin({
      tsconfig: path.resolve(__dirname, 'tsconfig.json'),
      watch: SRC_DIR,
      // CI memory limits make building with more than one CPU for type-checking too fragile, unfortunately
      workers: isCI
        ? ForkTsCheckerWebpackPlugin.ONE_CPU
        : ForkTsCheckerWebpackPlugin.TWO_CPUS_FREE,
      memoryLimit: 4096,
    }),
    new CopyWebpackPlugin([
      {
        from: `${SRC_DIR}/index.d.ts`,
        to: path.join(DIST_DIR, 'types', 'index.d.ts'),
      },
    ]),
  ],
  devtool: 'source-map',
};

const workerConfig = {
  mode: 'production',
  target: 'webworker',
github stardog-union / stardog-language-servers / packages / shacl-language-server / webpack.config.js View on Github external
],
        exclude: [/node_modules/],
      },
    ],
  },
  resolve: {
    modules: [SRC_DIR, 'node_modules'],
    extensions: ['.ts', '.js'],
  },
  plugins: [
    new ForkTsCheckerWebpackPlugin({
      tsconfig: path.resolve(__dirname, 'tsconfig.json'),
      watch: SRC_DIR,
      // CI memory limits make building with more than one CPU for type-checking too fragile, unfortunately
      workers: isCI
        ? ForkTsCheckerWebpackPlugin.ONE_CPU
        : ForkTsCheckerWebpackPlugin.TWO_CPUS_FREE,
      memoryLimit: 4096,
    }),
  ],
  devtool: 'source-map',
  node: {
    child_process: 'empty',
    net: 'empty',
    fs: 'empty',
    net: 'empty',
  },
  optimization: {
    minimizer: [
      new TerserPlugin({
        sourceMap: true,
        terserOptions: {
github twosigma / beakerx / js / notebook / webpack.config.js View on Github external
{ test: /\.svg(\?v=\d+\.\d+\.\d+)?$/, loader: "url-loader?limit=10000&mimetype=image/svg+xml" },
  { test: /\.html$/, use: 'html-loader' }
];

const plugins = [
  new webpack.IgnorePlugin({ resourceRegExp: /^\.\/locale$/, contextRegExp: /moment$/ }),
  new webpack.ProvidePlugin({
    "$":"jquery",
    "jQuery":"jquery",
    "window.jQuery":"jquery",
    "d3": "d3"
  }),
  new ForkTsCheckerWebpackPlugin({
    tsconfig: tsConfigPath,
    watch: 'src',
    workers: ForkTsCheckerWebpackPlugin.ONE_CPU
  }),
  new webpack.DefinePlugin({
    BEAKERX_MODULE_VERSION: JSON.stringify("*") // The latest version
  })
];

const externals = [
  '@jupyter-widgets/base',
  '@jupyter-widgets/controls'
];

const resolve = {
  modules: ['web_modules', 'node_modules'],
  extensions: ['.ts', '.jsx','.js','.less','.css'],
  plugins: [new TsconfigPathsPlugin({ configFile: tsConfigPath })]
};
github stardog-union / stardog-language-servers / packages / sparql-language-server / webpack.config.js View on Github external
}
    ],
  },
  resolve: {
    modules: [SRC_DIR, 'node_modules'],
    extensions: ['.ts', '.js'],
  },
  plugins: [
    new BannerPlugin({
      banner: '#!/usr/bin/env node',
    }),
    new ForkTsCheckerWebpackPlugin({
      tsconfig: path.resolve(__dirname, 'tsconfig.json'),
      watch: SRC_DIR,
      // CI memory limits make building with more than one CPU for type-checking too fragile, unfortunately
      workers: isCI ? ForkTsCheckerWebpackPlugin.ONE_CPU : ForkTsCheckerWebpackPlugin.TWO_CPUS_FREE,
      memoryLimit: 4096,
    }),
  ],
  devtool: 'source-map',
  optimization: {
    minimizer: [
      new TerserPlugin({
        sourceMap: true,
        terserOptions: {
          // Chevrotain does not cooperate with webpack mangling (see here: https://sap.github.io/chevrotain/docs/FAQ.html#MINIFIED).
          mangle: {
            reserved,
          },
        },
      }),
    ],
github stardog-union / stardog-language-servers / packages / turtle-language-server / webpack.config.js View on Github external
}
    ],
  },
  resolve: {
    modules: [SRC_DIR, 'node_modules'],
    extensions: ['.ts', '.js'],
  },
  plugins: [
    new BannerPlugin({
      banner: '#!/usr/bin/env node',
    }),
    new ForkTsCheckerWebpackPlugin({
      tsconfig: path.resolve(__dirname, 'tsconfig.json'),
      watch: SRC_DIR,
      // CI memory limits make building with more than one CPU for type-checking too fragile, unfortunately
      workers: isCI ? ForkTsCheckerWebpackPlugin.ONE_CPU : ForkTsCheckerWebpackPlugin.TWO_CPUS_FREE,
      memoryLimit: 4096,
    }),
  ],
  devtool: 'source-map',
  optimization: {
    minimizer: [
      new TerserPlugin({
        sourceMap: true,
        terserOptions: {
          // Chevrotain does not cooperate with webpack mangling (see here: https://sap.github.io/chevrotain/docs/FAQ.html#MINIFIED).
          mangle: {
            reserved,
          },
        },
      }),
    ],
github chanlito / nuxt-ts-module / index.js View on Github external
}

    // Add .ts extension in webpack resolve
    if (config.resolve.extensions.indexOf('.ts') === -1) {
      config.resolve.extensions.push('.ts');
    }

    if (config.resolve.extensions.indexOf('.tsx') === -1) {
      config.resolve.extensions.push('.tsx');
    }

    // Add a fork ts checker webpack plugin
    if (config.name === 'client') {
      const tsCheckerDefaultOptions = {
        checkSyntacticErrors: !!options.thread,
        workers: ForkTsCheckerWebpackPlugin.ONE_CPU,
        formatter: 'codeframe',
        vue: true,
        tsconfig: options.tsconfig || tsconfigDefault,
      };
      config.plugins.push(
        new ForkTsCheckerWebpackPlugin(tsCheckerDefaultOptions),
      );
    }
  });
}
github stardog-union / stardog-language-servers / packages / sms-language-server / webpack.config.js View on Github external
},
        ],
        exclude: [/node_modules/],
      }
    ],
  },
  resolve: {
    modules: [SRC_DIR, 'node_modules'],
    extensions: ['.ts', '.js'],
  },
  plugins: [
    new ForkTsCheckerWebpackPlugin({
      tsconfig: path.resolve(__dirname, 'tsconfig.json'),
      watch: SRC_DIR,
      // CI memory limits make building with more than one CPU for type-checking too fragile, unfortunately
      workers: isCI ? ForkTsCheckerWebpackPlugin.ONE_CPU : ForkTsCheckerWebpackPlugin.TWO_CPUS_FREE,
      memoryLimit: 4096,
    }),
  ],
  devtool: 'source-map',
  node: {
    child_process: 'empty',
    net: 'empty',
    fs: 'empty',
    net: 'empty',
  },
  optimization: {
    minimizer: [
      new TerserPlugin({
        sourceMap: true,
        terserOptions: {
          // Chevrotain does not cooperate with webpack mangling (see here: https://sap.github.io/chevrotain/docs/FAQ.html#MINIFIED).
github stardog-union / stardog-language-servers / packages / srs-language-server / webpack.config.js View on Github external
],
        exclude: [/node_modules/],
      },
    ],
  },
  resolve: {
    modules: [SRC_DIR, 'node_modules'],
    extensions: ['.ts', '.js'],
  },
  plugins: [
    new ForkTsCheckerWebpackPlugin({
      tsconfig: path.resolve(__dirname, 'tsconfig.json'),
      watch: SRC_DIR,
      // CI memory limits make building with more than one CPU for type-checking too fragile, unfortunately
      workers: isCI
        ? ForkTsCheckerWebpackPlugin.ONE_CPU
        : ForkTsCheckerWebpackPlugin.TWO_CPUS_FREE,
      memoryLimit: 4096,
    }),
  ],
  devtool: 'source-map',
  node: {
    child_process: 'empty',
    net: 'empty',
    fs: 'empty',
    net: 'empty',
  },
  optimization: {
    minimizer: [
      new TerserPlugin({
        sourceMap: true,
        terserOptions: {