File tree 4 files changed +10
-15
lines changed
4 files changed +10
-15
lines changed Original file line number Diff line number Diff line change 37
37
},
38
38
"dependencies" : {
39
39
"chalk" : " ^4.1.0" ,
40
- "hash-sum" : " ^2.0.0" ,
41
40
"watchpack" : " ^2.4.0"
42
41
},
43
42
"peerDependencies" : {
56
55
"@babel/preset-env" : " ^7.11.5" ,
57
56
"@intlify/vue-i18n-loader" : " ^3.0.0" ,
58
57
"@types/estree" : " ^0.0.45" ,
59
- "@types/hash-sum" : " ^1.0.0" ,
60
58
"@types/jest" : " ^26.0.13" ,
61
59
"@types/jsdom" : " ^16.2.13" ,
62
60
"@types/mini-css-extract-plugin" : " ^0.9.1" ,
Original file line number Diff line number Diff line change 1
1
import type { LoaderContext } from 'webpack'
2
2
import * as path from 'path'
3
+ import * as crypto from 'crypto'
3
4
import * as qs from 'querystring'
4
5
5
- import hash = require( 'hash-sum' )
6
-
7
6
import { compiler } from './compiler'
8
7
import type {
9
8
TemplateCompiler ,
@@ -66,6 +65,10 @@ let errorEmitted = false
66
65
const { parse } = compiler
67
66
const exportHelperPath = require . resolve ( './exportHelper' )
68
67
68
+ function hash ( text : string ) : string {
69
+ return crypto . createHash ( 'sha256' ) . update ( text ) . digest ( 'hex' ) . substring ( 0 , 8 )
70
+ }
71
+
69
72
export default function loader (
70
73
this : LoaderContext < VueLoaderOptions > ,
71
74
source : string
Original file line number Diff line number Diff line change 1
1
/* env jest */
2
2
import * as path from 'path'
3
+ import * as crypto from 'crypto'
3
4
import webpack from 'webpack'
4
5
import merge from 'webpack-merge'
5
- import hash from 'hash-sum'
6
6
// import MiniCssExtractPlugin from 'mini-css-extract-plugin'
7
7
import { fs as mfs } from 'memfs'
8
8
import { JSDOM , VirtualConsole } from 'jsdom'
9
9
import { VueLoaderPlugin } from '..'
10
10
import type { VueLoaderOptions } from '..'
11
11
12
+ function hash ( text : string ) : string {
13
+ return crypto . createHash ( 'sha256' ) . update ( text ) . digest ( 'hex' ) . substring ( 0 , 8 )
14
+ }
15
+
12
16
export const DEFAULT_VUE_USE = {
13
17
loader : 'vue-loader' ,
14
18
options : {
Original file line number Diff line number Diff line change 1317
1317
dependencies :
1318
1318
" @types/node" " *"
1319
1319
1320
- " @types/hash-sum@^1.0.0 " :
1321
- version "1.0.0"
1322
- resolved "https://registry.yarnpkg.com/@types/hash-sum/-/hash-sum-1.0.0.tgz#838f4e8627887d42b162d05f3d96ca636c2bc504"
1323
- integrity sha512-FdLBT93h3kcZ586Aee66HPCVJ6qvxVjBlDWNmxSGSbCZe9hTsjRKdSsl4y1T+3zfujxo9auykQMnFsfyHWD7wg==
1324
-
1325
1320
" @types/html-minifier-terser@^5.0.0 " :
1326
1321
version "5.1.1"
1327
1322
resolved "https://registry.yarnpkg.com/@types/html-minifier-terser/-/html-minifier-terser-5.1.1.tgz#3c9ee980f1a10d6021ae6632ca3e79ca2ec4fb50"
@@ -4925,11 +4920,6 @@ hash-base@^3.0.0:
4925
4920
readable-stream "^3.6.0"
4926
4921
safe-buffer "^5.2.0"
4927
4922
4928
- hash-sum@^2.0.0 :
4929
- version "2.0.0"
4930
- resolved "https://registry.yarnpkg.com/hash-sum/-/hash-sum-2.0.0.tgz#81d01bb5de8ea4a214ad5d6ead1b523460b0b45a"
4931
- integrity sha512-WdZTbAByD+pHfl/g9QSsBIIwy8IT+EsPiKDs0KNX+zSHhdDLFKdZu0BQHljvO+0QI/BasbMSUa8wYNCZTvhslg==
4932
-
4933
4923
hash.js@^1.0.0, hash.js@^1.0.3 :
4934
4924
version "1.1.7"
4935
4925
resolved "https://registry.yarnpkg.com/hash.js/-/hash.js-1.1.7.tgz#0babca538e8d4ee4a0f8988d68866537a003cf42"
You can’t perform that action at this time.
0 commit comments