File tree 4 files changed +10
-19
lines changed
4 files changed +10
-19
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" : {
57
56
"@intlify/vue-i18n-loader" : " ^3.0.0" ,
58
57
"@types/cssesc" : " ^3.0.2" ,
59
58
"@types/estree" : " ^0.0.45" ,
60
- "@types/hash-sum" : " ^1.0.0" ,
61
59
"@types/jest" : " ^26.0.13" ,
62
60
"@types/jsdom" : " ^16.2.13" ,
63
61
"@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 : {
You can’t perform that action at this time.
0 commit comments