Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into jinjiang/pnpm
Browse files Browse the repository at this point in the history
  • Loading branch information
Jinjiang committed Jan 13, 2024
2 parents 5878dd7 + bd9cb6f commit 87a4ef7
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 19 deletions.
2 changes: 0 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@
},
"dependencies": {
"chalk": "^4.1.0",
"hash-sum": "^2.0.0",
"watchpack": "^2.4.0"
},
"peerDependencies": {
Expand All @@ -57,7 +56,6 @@
"@intlify/vue-i18n-loader": "^3.0.0",
"@types/cssesc": "^3.0.2",
"@types/estree": "^0.0.45",
"@types/hash-sum": "^1.0.0",
"@types/jest": "^26.0.13",
"@types/jsdom": "^16.2.13",
"@types/mini-css-extract-plugin": "^0.9.1",
Expand Down
14 changes: 0 additions & 14 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 5 additions & 2 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
import type { LoaderContext } from 'webpack'
import * as path from 'path'
import * as crypto from 'crypto'
import * as qs from 'querystring'

import hash = require('hash-sum')

import { compiler } from './compiler'
import type {
TemplateCompiler,
Expand Down Expand Up @@ -66,6 +65,10 @@ let errorEmitted = false
const { parse } = compiler
const exportHelperPath = require.resolve('./exportHelper')

function hash(text: string): string {
return crypto.createHash('sha256').update(text).digest('hex').substring(0, 8)
}

export default function loader(
this: LoaderContext<VueLoaderOptions>,
source: string
Expand Down
6 changes: 5 additions & 1 deletion test/utils.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,18 @@
/* env jest */
import * as path from 'path'
import * as crypto from 'crypto'
import webpack from 'webpack'
import merge from 'webpack-merge'
import hash from 'hash-sum'
// import MiniCssExtractPlugin from 'mini-css-extract-plugin'
import { fs as mfs } from 'memfs'
import { JSDOM, VirtualConsole } from 'jsdom'
import { VueLoaderPlugin } from '..'
import type { VueLoaderOptions } from '..'

function hash(text: string): string {
return crypto.createHash('sha256').update(text).digest('hex').substring(0, 8)
}

export const DEFAULT_VUE_USE = {
loader: 'vue-loader',
options: {
Expand Down

0 comments on commit 87a4ef7

Please sign in to comment.