-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathwebpack.plugins.ts
21 lines (19 loc) · 938 Bytes
/
webpack.plugins.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
import type IForkTsCheckerWebpackPlugin from 'fork-ts-checker-webpack-plugin';
import NodePolyfillPlugin from 'node-polyfill-webpack-plugin';
import { NormalModuleReplacementPlugin } from 'webpack';
// eslint-disable-next-line @typescript-eslint/no-var-requires
const ForkTsCheckerWebpackPlugin: typeof IForkTsCheckerWebpackPlugin = require('fork-ts-checker-webpack-plugin');
export const plugins = [
new ForkTsCheckerWebpackPlugin({
logger: 'webpack-infrastructure',
}),
new NodePolyfillPlugin(),
new NormalModuleReplacementPlugin(/^ws$/, 'isomorphic-ws'),
// force webpack to use the browser versions of these modules (they are all loaded by crypto-browserify)
new NormalModuleReplacementPlugin(
/^browserify-cipher$/,
'browserify-cipher/browser',
),
new NormalModuleReplacementPlugin(/^create-hmac$/, 'create-hmac/browser'),
new NormalModuleReplacementPlugin(/^randombytes$/, 'randombytes/browser'),
];