Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(plugin_resolve): duplicated querystring on external #2057

Merged
merged 3 commits into from
Jan 11, 2025

Conversation

HelloWorld017
Copy link
Contributor

Description:

  • When I externalize dependencies with querystring, the query duplicates.
  • For example:
    • import { Astal } from 'gi://Astal?version=4.0
    • with externalizing ['^gi://']
    • yields import { o } from "gi://Astal?version=4.0?version=4.0";

Reproduction:

diff --git a/farm.config.js b/farm.config.js
new file mode 100644
index 0000000..aaa84db
--- /dev/null
+++ b/farm.config.js
@@ -0,0 +1,9 @@
+import { defineConfig } from '@farmfe/core';
+
+export default defineConfig({
+	compilation: {
+		input: { index: './index.js' },
+		output: { targetEnv: 'library' },
+		external: ['^gi://']
+	},
+});
diff --git a/index.js b/index.js
new file mode 100644
index 0000000..0c019aa
--- /dev/null
+++ b/index.js
@@ -0,0 +1,2 @@
+import Astal from "gi://Astal?version=4.0";
+export { Astal };
diff --git a/package.json b/package.json
new file mode 100644
index 0000000..2061134
--- /dev/null
+++ b/package.json
@@ -0,0 +1,17 @@
+{
+  "name": "farm-minimal-external",
+  "version": "1.0.0",
+  "description": "",
+  "main": "index.js",
+  "scripts": {
+    "build": "farm build",
+    "test": "echo \"Error: no test specified\" && exit 1"
+  },
+  "keywords": [],
+  "author": "",
+  "license": "ISC",
+  "devDependencies": {
+    "@farmfe/cli": "^1.0.4",
+    "@farmfe/core": "^1.6.4"
+  }
+}

Copy link

changeset-bot bot commented Jan 9, 2025

🦋 Changeset detected

Latest commit: 9668d22

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 3 packages
Name Type
@farmfe/core Patch
@farmfe-examples/tailwind-next Patch
@farmfe/js-plugin-tailwindcss Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copy link

codspeed-hq bot commented Jan 9, 2025

CodSpeed Performance Report

Merging #2057 will create unknown performance changes

Comparing HelloWorld017:fix/external-with-querystring (9668d22) with main (a785d6f)

Summary

⚠️ No benchmarks were detected in both the base of the PR and the PR.\

@ErKeLost
Copy link
Member

thanks

@wre232114 wre232114 enabled auto-merge (squash) January 11, 2025 02:39
@wre232114 wre232114 merged commit 2423ee6 into farm-fe:main Jan 11, 2025
37 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants