How to use the fork-ts-checker-webpack-plugin.TWO_CPUS_FREE 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 xmazu / react-inline-suggest / scripts / webpack.dev.config.js View on Github external
devtool: 'source-map',

  resolve: {
    extensions: ['.ts', '.tsx', '.js', '.scss', '.css'],
    modules: [absolute('src'), absolute('node_modules')],
  },
  plugins: [
    // Provide NODE_ENV variable
    new webpack.DefinePlugin({
      'NODE_ENV': JSON.stringify(process.env.NODE_ENV || 'development'),
      'process.env.NODE_ENV': JSON.stringify(process.env.NODE_ENV || 'development')
    }),
    // Fork type-check to separate process
    new ForkTsCheckerPlugin({
      workers: ForkTsCheckerPlugin.TWO_CPUS_FREE,
      watch: ['src']
    }),
    new HtmlPlugin({
      template: 'example/index.html',
      hash: false,
      filename: 'index.html',
      inject: 'body',
    }),
    new webpack.NoEmitOnErrorsPlugin()
  ],

  module: {
    rules: [
      {
        test: /\.tsx?$/,
        use: [
github stardog-union / stardog-language-servers / packages / sms-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 / shacl-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 / 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',
  entry: path.join(SRC_DIR, 'worker.ts'),
github stardog-union / stardog-language-servers / packages / srs-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 twosigma / beakerx / beakerx / js / webpack.config.js View on Github external
{ test: /\.ttf(\?v=\d+\.\d+\.\d+)?$/, loader: "url-loader?limit=10000&mimetype=application/octet-stream" },
  { test: /\.eot(\?v=\d+\.\d+\.\d+)?$/, loader: "file-loader" },
  { test: /\.svg(\?v=\d+\.\d+\.\d+)?$/, loader: "url-loader?limit=10000&mimetype=image/svg+xml" },
  { test: /\.html$/, use: 'html-loader' }
];

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

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

var resolve = {
  modules: ['web_modules', 'node_modules'],
  extensions: ['.ts', '.jsx','.js','.less','.css']
};
github vocoWone / reaux / core / webpack / webpack.config.ssr.js View on Github external
test: /\.mp4$/,
                loader: "file-loader",
            },
        ],
    },
    plugins: [
        new StylelintPlugin({
            configFile: env.stylelintConfig,
            context: env.entry,
            files: "**/*.less",
            syntax: "less",
        }),
        new ForkTSCheckerPlugin({
            tsconfig: env.tsConfig,
            tslint: env.tslintConfig,
            workers: ForkTSCheckerPlugin.TWO_CPUS_FREE,
        }),
        new HTMLPlugin({
            template: path.resolve(__dirname, `${env.entry}/index.html`) /* θ‡ͺ动在θ―₯樑板中导ε…₯ output δΈ­ηš„filenameζ–‡δ»Ά */,
        }),
        new webpack.HotModuleReplacementPlugin(),
        new webpack.ProgressPlugin() /* ζŽ§εˆΆε°ζ˜Ύη€ΊεŠ θ½½θΏ›εΊ¦ */,
    ],
});
github wooline / react-coat-spa-demo / config / webpack.config.prod.js View on Github external
filename: "css/[name].[contenthash:8].css",
    }),
    /* new ManifestPlugin({
      fileName: "asset-manifest.json",
      publicPath: conEnv.clientPublicPath,
    }), */
    new StylelintPlugin({
      configFile: path.join(paths.rootPath, "./.stylelintrc.json"),
      context: paths.srcPath,
      files: "**/*.less",
      syntax: "less",
    }),
    new ForkTsCheckerWebpackPlugin({
      tsconfig: path.join(paths.rootPath, "./tsconfig.json"),
      tslint: path.join(paths.rootPath, "./tslint.json"),
      workers: ForkTsCheckerWebpackPlugin.TWO_CPUS_FREE,
    }),
    new webpack.IgnorePlugin(/^\.\/locale$/, /moment$/),
    new webpack.ProgressPlugin(),
  ],
};

module.exports = config;
github vocoWone / reaux / webpack / webpack.config.build.js View on Github external
test: /\.mp4$/,
                loader: "file-loader",
                options: {
                    name: `static/mp4/[name].[hash:8].[ext]`,
                },
            },
        ],
    },
    plugins: [
        new MiniCSSExtractPlugin({
            filename: `static/css/[name].[contenthash:8].css`,
        }),
        new ForkTSCheckerPlugin({
            tsconfig: env.tsConfig,
            tslint: env.tslintConfig,
            workers: ForkTSCheckerPlugin.TWO_CPUS_FREE,
        }),
        new StylelintPlugin({
            configFile: env.stylelintConfig,
            context: env.src,
            files: "**/*.less",
            syntax: "less",
        }),
        new HTMLPlugin({
            template: `${env.src}/index.html`,
            minify: {
                collapseBooleanAttributes: true,
                collapseInlineTagWhitespace: true,
                collapseWhitespace: true,
                includeAutoGeneratedTags: false,
                keepClosingSlash: true,
                minifyCSS: true,
github xmazu / react-inline-suggest / scripts / webpack.prod.config.js View on Github external
'sass-loader'
        ])
      }
    ]
  },
  resolve: {
    extensions: ['.ts', '.tsx', '.js', '.jsx'],
    modules: [absolute('src'), absolute('node_modules')]
  },
  externals: {
    'react': 'React',
    'react-dom': 'react-dom'
  },
  plugins: [
    new ForkTsCheckerPlugin({
      workers: ForkTsCheckerPlugin.TWO_CPUS_FREE,
      watch: ['src']
    }),
    new ExtractTextPlugin('react-inline-suggest.css')
  ]  
};

module.exports = config;