From 60772b7098b3f832ad620d43d965664167b5a035 Mon Sep 17 00:00:00 2001 From: Dylan Piercey Date: Tue, 19 Jan 2021 16:15:04 -0700 Subject: [PATCH] fix: src to dist translations in some cases --- packages/babel-utils/src/imports.js | 2 +- .../fixtures/await-tag/snapshots/htmlProduction-expected.js | 2 +- .../fixtures/await-tag/snapshots/vdomProduction-expected.js | 2 +- .../fixtures/doctype/snapshots/htmlProduction-expected.js | 6 +++--- .../snapshots/htmlProduction-expected.js | 2 +- .../snapshots/vdomProduction-expected.js | 2 +- 6 files changed, 8 insertions(+), 8 deletions(-) diff --git a/packages/babel-utils/src/imports.js b/packages/babel-utils/src/imports.js index 2eb8136969..9d0185bb47 100644 --- a/packages/babel-utils/src/imports.js +++ b/packages/babel-utils/src/imports.js @@ -114,5 +114,5 @@ function getImports(file) { function remapProductionMarkoBuild(file, request) { if (!file.markoOpts.optimize) return request; - return request.replace(/^marko\/src\//, "marko/dist/"); + return request.replace(/(^|\/)marko\/src\//, "$1marko/dist/"); } diff --git a/packages/translator-default/test/fixtures/await-tag/snapshots/htmlProduction-expected.js b/packages/translator-default/test/fixtures/await-tag/snapshots/htmlProduction-expected.js index 7af8c25530..e650a95c68 100644 --- a/packages/translator-default/test/fixtures/await-tag/snapshots/htmlProduction-expected.js +++ b/packages/translator-default/test/fixtures/await-tag/snapshots/htmlProduction-expected.js @@ -2,7 +2,7 @@ const _marko_template = _t(); export default _marko_template; import { x as _marko_escapeXml } from "marko/dist/runtime/html/helpers/escape-xml"; -import _await from "../../../../marko/src/core-tags/core/await/renderer.js"; +import _await from "../../../../marko/dist/core-tags/core/await/renderer.js"; import _marko_tag from "marko/dist/runtime/helpers/render-tag"; import _marko_renderer from "marko/dist/runtime/components/renderer"; import { t as _t } from "marko/dist/runtime/html"; diff --git a/packages/translator-default/test/fixtures/await-tag/snapshots/vdomProduction-expected.js b/packages/translator-default/test/fixtures/await-tag/snapshots/vdomProduction-expected.js index 7c4a02d6eb..488a4c50b6 100644 --- a/packages/translator-default/test/fixtures/await-tag/snapshots/vdomProduction-expected.js +++ b/packages/translator-default/test/fixtures/await-tag/snapshots/vdomProduction-expected.js @@ -1,7 +1,7 @@ const _marko_template = _t(); export default _marko_template; -import _await from "../../../../marko/src/core-tags/core/await/renderer.js"; +import _await from "../../../../marko/dist/core-tags/core/await/renderer.js"; import _marko_tag from "marko/dist/runtime/helpers/render-tag"; import _marko_renderer from "marko/dist/runtime/components/renderer"; import { t as _t } from "marko/dist/runtime/dom"; diff --git a/packages/translator-default/test/fixtures/doctype/snapshots/htmlProduction-expected.js b/packages/translator-default/test/fixtures/doctype/snapshots/htmlProduction-expected.js index c5488bf536..2cfa4c2d8f 100644 --- a/packages/translator-default/test/fixtures/doctype/snapshots/htmlProduction-expected.js +++ b/packages/translator-default/test/fixtures/doctype/snapshots/htmlProduction-expected.js @@ -1,10 +1,10 @@ const _marko_template = _t(); export default _marko_template; -import _initComponents from "../../../../marko/src/core-tags/components/init-components-tag.js"; +import _initComponents from "../../../../marko/dist/core-tags/components/init-components-tag.js"; import _marko_tag from "marko/dist/runtime/helpers/render-tag"; -import _awaitReorderer from "../../../../marko/src/core-tags/core/await/reorderer-renderer.js"; -import _preferredScriptLocation from "../../../../marko/src/core-tags/components/preferred-script-location-tag.js"; +import _awaitReorderer from "../../../../marko/dist/core-tags/core/await/reorderer-renderer.js"; +import _preferredScriptLocation from "../../../../marko/dist/core-tags/components/preferred-script-location-tag.js"; import _marko_renderer from "marko/dist/runtime/components/renderer"; import { t as _t } from "marko/dist/runtime/html"; const _marko_componentType = "VJrYycFN", diff --git a/packages/translator-default/test/fixtures/no-update-directives/snapshots/htmlProduction-expected.js b/packages/translator-default/test/fixtures/no-update-directives/snapshots/htmlProduction-expected.js index 214f765cd0..d3744d4aaf 100644 --- a/packages/translator-default/test/fixtures/no-update-directives/snapshots/htmlProduction-expected.js +++ b/packages/translator-default/test/fixtures/no-update-directives/snapshots/htmlProduction-expected.js @@ -3,7 +3,7 @@ const _marko_template = _t(); export default _marko_template; import _hello from "./components/hello/index.marko"; import _marko_tag from "marko/dist/runtime/helpers/render-tag"; -import _preserve from "../../../../marko/src/core-tags/components/preserve-tag.js"; +import _preserve from "../../../../marko/dist/core-tags/components/preserve-tag.js"; import _marko_renderer from "marko/dist/runtime/components/renderer"; import { t as _t } from "marko/dist/runtime/html"; const _marko_componentType = "qUg9ApxN", diff --git a/packages/translator-default/test/fixtures/no-update-directives/snapshots/vdomProduction-expected.js b/packages/translator-default/test/fixtures/no-update-directives/snapshots/vdomProduction-expected.js index 50059d7f9f..1df330193d 100644 --- a/packages/translator-default/test/fixtures/no-update-directives/snapshots/vdomProduction-expected.js +++ b/packages/translator-default/test/fixtures/no-update-directives/snapshots/vdomProduction-expected.js @@ -7,7 +7,7 @@ import _marko_createElement from "marko/dist/runtime/vdom/helpers/v-element"; const _marko_node = _marko_createElement("div", null, "2", null, 0, 0); -import _preserve from "../../../../marko/src/core-tags/components/preserve-tag.js"; +import _preserve from "../../../../marko/dist/core-tags/components/preserve-tag.js"; const _marko_node2 = _marko_createElement("div", null, "5", null, 0, 0);