webpack#HashedModuleIdsPlugin TypeScript Examples

The following examples show how to use webpack#HashedModuleIdsPlugin. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: webpack.prod.ts    From react-typescript-boilerplate with MIT License 6 votes vote down vote up
mergedConfig = merge(commonConfig, {
    mode: 'production',
    plugins: [
        new BannerPlugin({
            raw: true,
            banner: COPYRIGHT,
        }),
        new HashedModuleIdsPlugin(),
        new ForkTsCheckerWebpackPlugin({
            typescript: {
                // 生产环境打包并不频繁,可以适当调高允许使用的内存,加快类型检查速度
                memoryLimit: 1024 * 2,
                configFile: resolve(PROJECT_ROOT, './src/tsconfig.json'),
            },
        }),
        new MiniCssExtractPlugin({
            filename: 'css/[name].[contenthash].css',
            chunkFilename: 'css/[id].[contenthash].css',
            ignoreOrder: false,
        }),
        new CompressionPlugin({ cache: true }),
    ],
    optimization: {
        runtimeChunk: 'single',
        minimize: true,
        minimizer: [new TerserPlugin({ extractComments: false }), new OptimizeCSSAssetsPlugin()],
    },
})