diff --git a/packages/webpack/src/utils/webpack/plugins/remove-hash-plugin.ts b/packages/webpack/src/utils/webpack/plugins/remove-hash-plugin.ts deleted file mode 100644 index f0f03ad9651a6..0000000000000 --- a/packages/webpack/src/utils/webpack/plugins/remove-hash-plugin.ts +++ /dev/null @@ -1,33 +0,0 @@ -import { HashFormat } from '../../hash-format'; - -type Compiler = any; - -export interface RemoveHashPluginOptions { - chunkNames: string[]; - hashFormat: HashFormat; -} - -export class RemoveHashPlugin { - constructor(private options: RemoveHashPluginOptions) {} - - apply(compiler: Compiler): void { - compiler.hooks.compilation.tap('remove-hash-plugin', (compilation) => { - compilation.hooks.assetPath.tap( - 'remove-hash-plugin', - (path: string, data: { chunk?: { name: string } }) => { - const chunkName = data.chunk && data.chunk.name; - const { chunkNames, hashFormat } = this.options; - - if (chunkName && chunkNames.includes(chunkName)) { - // Replace hash formats with empty strings. - return path - .replace(hashFormat.chunk, '') - .replace(hashFormat.extract, ''); - } - - return path; - } - ); - }); - } -} diff --git a/packages/webpack/src/utils/with-web.ts b/packages/webpack/src/utils/with-web.ts index 9d28bc0266c09..2ad4276e1d0e2 100644 --- a/packages/webpack/src/utils/with-web.ts +++ b/packages/webpack/src/utils/with-web.ts @@ -13,14 +13,12 @@ import { normalizeExtraEntryPoints } from '@nrwl/webpack/src/utils/webpack/norma import { NormalizedWebpackExecutorOptions } from '../executors/webpack/schema'; import { getClientEnvironment } from './get-client-environment'; -import { RemoveHashPlugin } from './webpack/plugins/remove-hash-plugin'; import { ScriptsWebpackPlugin } from './webpack/plugins/scripts-webpack-plugin'; import { getCSSModuleLocalIdent } from './get-css-module-local-ident'; import CssMinimizerPlugin = require('css-minimizer-webpack-plugin'); import MiniCssExtractPlugin = require('mini-css-extract-plugin'); import autoprefixer = require('autoprefixer'); import postcssImports = require('postcss-import'); -import { Postcss } from 'postcss'; import { basename } from 'path'; interface PostcssOptions { @@ -89,7 +87,6 @@ export function withWeb() { // Process global styles. if (options.styles.length > 0) { - const chunkNames: string[] = []; normalizeExtraEntryPoints(options.styles, 'styles').forEach((style) => { const resolvedPath = path.resolve(options.root, style.input); // Add style entry points. @@ -102,11 +99,6 @@ export function withWeb() { // Add global css paths. globalStylePaths.push(resolvedPath); }); - - if (chunkNames.length > 0) { - // Add plugin to remove hashes from lazy styles. - plugins.push(new RemoveHashPlugin({ chunkNames, hashFormat })); - } } const cssModuleRules: RuleSetRule[] = [