File tree Expand file tree Collapse file tree 4 files changed +10
-15
lines changed Expand file tree Collapse file tree 4 files changed +10
-15
lines changed Original file line number Diff line number Diff line change 3737 },
3838 "dependencies" : {
3939 "chalk" : " ^4.1.0" ,
40- "hash-sum" : " ^2.0.0" ,
4140 "watchpack" : " ^2.4.0"
4241 },
4342 "peerDependencies" : {
5655 "@babel/preset-env" : " ^7.11.5" ,
5756 "@intlify/vue-i18n-loader" : " ^3.0.0" ,
5857 "@types/estree" : " ^0.0.45" ,
59- "@types/hash-sum" : " ^1.0.0" ,
6058 "@types/jest" : " ^26.0.13" ,
6159 "@types/jsdom" : " ^16.2.13" ,
6260 "@types/mini-css-extract-plugin" : " ^0.9.1" ,
Original file line number Diff line number Diff line change 11import type { LoaderContext } from 'webpack'
22import * as path from 'path'
3+ import * as crypto from 'crypto'
34import * as qs from 'querystring'
45
5- import hash = require( 'hash-sum' )
6-
76import { compiler } from './compiler'
87import type {
98 TemplateCompiler ,
@@ -66,6 +65,10 @@ let errorEmitted = false
6665const { parse } = compiler
6766const 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+
6972export default function loader (
7073 this : LoaderContext < VueLoaderOptions > ,
7174 source : string
Original file line number Diff line number Diff line change 11/* env jest */
22import * as path from 'path'
3+ import * as crypto from 'crypto'
34import webpack from 'webpack'
45import merge from 'webpack-merge'
5- import hash from 'hash-sum'
66// import MiniCssExtractPlugin from 'mini-css-extract-plugin'
77import { fs as mfs } from 'memfs'
88import { JSDOM , VirtualConsole } from 'jsdom'
99import { VueLoaderPlugin } from '..'
1010import type { VueLoaderOptions } from '..'
1111
12+ function hash ( text : string ) : string {
13+ return crypto . createHash ( 'sha256' ) . update ( text ) . digest ( 'hex' ) . substring ( 0 , 8 )
14+ }
15+
1216export const DEFAULT_VUE_USE = {
1317 loader : 'vue-loader' ,
1418 options : {
Original file line number Diff line number Diff line change 13171317 dependencies :
13181318 " @types/node" " *"
13191319
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-
13251320" @types/html-minifier-terser@^5.0.0 " :
13261321 version "5.1.1"
13271322 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:
49254920 readable-stream "^3.6.0"
49264921 safe-buffer "^5.2.0"
49274922
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-
49334923hash.js@^1.0.0, hash.js@^1.0.3 :
49344924 version "1.1.7"
49354925 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