Skip to content

Commit 87a4ef7

Browse files
committed
Merge remote-tracking branch 'origin/main' into jinjiang/pnpm
2 parents 5878dd7 + bd9cb6f commit 87a4ef7

File tree

4 files changed

+10
-19
lines changed

4 files changed

+10
-19
lines changed

package.json

-2
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@
3737
},
3838
"dependencies": {
3939
"chalk": "^4.1.0",
40-
"hash-sum": "^2.0.0",
4140
"watchpack": "^2.4.0"
4241
},
4342
"peerDependencies": {
@@ -57,7 +56,6 @@
5756
"@intlify/vue-i18n-loader": "^3.0.0",
5857
"@types/cssesc": "^3.0.2",
5958
"@types/estree": "^0.0.45",
60-
"@types/hash-sum": "^1.0.0",
6159
"@types/jest": "^26.0.13",
6260
"@types/jsdom": "^16.2.13",
6361
"@types/mini-css-extract-plugin": "^0.9.1",

pnpm-lock.yaml

-14
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/index.ts

+5-2
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
import type { LoaderContext } from 'webpack'
22
import * as path from 'path'
3+
import * as crypto from 'crypto'
34
import * as qs from 'querystring'
45

5-
import hash = require('hash-sum')
6-
76
import { compiler } from './compiler'
87
import type {
98
TemplateCompiler,
@@ -66,6 +65,10 @@ let errorEmitted = false
6665
const { parse } = compiler
6766
const exportHelperPath = require.resolve('./exportHelper')
6867

68+
function hash(text: string): string {
69+
return crypto.createHash('sha256').update(text).digest('hex').substring(0, 8)
70+
}
71+
6972
export default function loader(
7073
this: LoaderContext<VueLoaderOptions>,
7174
source: string

test/utils.ts

+5-1
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,18 @@
11
/* env jest */
22
import * as path from 'path'
3+
import * as crypto from 'crypto'
34
import webpack from 'webpack'
45
import merge from 'webpack-merge'
5-
import hash from 'hash-sum'
66
// import MiniCssExtractPlugin from 'mini-css-extract-plugin'
77
import { fs as mfs } from 'memfs'
88
import { JSDOM, VirtualConsole } from 'jsdom'
99
import { VueLoaderPlugin } from '..'
1010
import type { VueLoaderOptions } from '..'
1111

12+
function hash(text: string): string {
13+
return crypto.createHash('sha256').update(text).digest('hex').substring(0, 8)
14+
}
15+
1216
export const DEFAULT_VUE_USE = {
1317
loader: 'vue-loader',
1418
options: {

0 commit comments

Comments
 (0)