Skip to content

Commit a81dc0f

Browse files
authored
fix: keep build stable when run in a different path (#2040)
By making the `exportHelperPath` a relative path so that the generated code is consistent.
1 parent b96af78 commit a81dc0f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ export interface VueLoaderOptions {
5858
let errorEmitted = false
5959

6060
const { parse } = compiler
61-
const exportHelperPath = JSON.stringify(require.resolve('./exportHelper'))
61+
const exportHelperPath = require.resolve('./exportHelper')
6262

6363
export default function loader(
6464
this: LoaderContext<VueLoaderOptions>,
@@ -296,7 +296,7 @@ export default function loader(
296296
if (!propsToAttach.length) {
297297
code += `\n\nconst __exports__ = script;`
298298
} else {
299-
code += `\n\nimport exportComponent from ${exportHelperPath}`
299+
code += `\n\nimport exportComponent from ${stringifyRequest(exportHelperPath)}`
300300
code += `\nconst __exports__ = /*#__PURE__*/exportComponent(script, [${propsToAttach
301301
.map(([key, val]) => `['${key}',${val}]`)
302302
.join(',')}])`

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy