Skip to content

Commit

Permalink
delete pitch loader
Browse files Browse the repository at this point in the history
  • Loading branch information
jantimon committed Jul 4, 2023
1 parent 92bf6dc commit 3803ae1
Showing 1 changed file with 1 addition and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,6 @@
import crypto from 'crypto'
import type webpack from 'webpack'

export const pitch: webpack.PitchLoaderDefinitionFunction<NextServerCSSLoaderOptions> =
function () {
if (process.env.NODE_ENV !== 'production') {
// @ts-expect-error TODO: Should we use readFile instead?
const content = this.fs.readFileSync(this.resourcePath)
this.data.__checksum = crypto
.createHash('sha256')
.update(typeof content === 'string' ? Buffer.from(content) : content)
.digest()
.toString('hex')
}
}

type NextServerCSSLoaderOptions = {
cssModules: boolean
}
Expand All @@ -45,10 +32,7 @@ const NextServerCSSLoader: webpack.LoaderDefinitionFunction<NextServerCSSLoaderO
}
const checksum = crypto
.createHash('sha256')
.update(
this.data.__checksum +
(typeof content === 'string' ? Buffer.from(content) : content)
)
.update(typeof content === 'string' ? Buffer.from(content) : content)
.digest()
.toString('hex')
.substring(0, 12)
Expand Down

0 comments on commit 3803ae1

Please sign in to comment.