fix: regexp for swapping dev/prod runtimes (#1845)

This commit is contained in:
Dylan Piercey 2022-08-11 09:41:43 -07:00 committed by GitHub
parent 22e48e505f
commit 65bab8e6df
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 12 additions and 1 deletions

View File

@ -0,0 +1,8 @@
---
"@marko/babel-utils": patch
"@marko/compiler": patch
"marko": patch
"@marko/translator-default": patch
---
Fix issue where Marko runtime was being incorrectly matched when swapping from dev to prod runtimes.

View File

@ -11,7 +11,10 @@ export function resolveRelativePath(file, request) {
}
if (file.markoOpts.optimize) {
request = request.replace(/(^|\/)marko\/src\//, "$1marko/dist/");
request = request.replace(
/(^|\/node-modules\/)marko\/src\//,
"$1marko/dist/"
);
}
return request;