@crxjs/vite-plugin 2.1.0 → 2.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/index.mjs +7 -2
  2. package/package.json +1 -1
package/dist/index.mjs CHANGED
@@ -107,9 +107,14 @@ const getMatchPatternOrigin = (pattern) => {
107
107
  if (pattern.startsWith("<"))
108
108
  return pattern;
109
109
  const [schema, rest] = pattern.split("://");
110
- const [origin, pathname] = rest.split("/");
110
+ const slashIndex = rest.indexOf("/");
111
+ const isSlashAfterOriginPresent = slashIndex !== -1;
112
+ const origin = isSlashAfterOriginPresent ? rest.slice(0, slashIndex) : rest;
111
113
  const root = `${schema}://${origin}`;
112
- return pathname ? `${root}/*` : root;
114
+ if (isSlashAfterOriginPresent) {
115
+ return `${root}/*`;
116
+ }
117
+ return root;
113
118
  };
114
119
 
115
120
  function defineClientValues(code, config) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@crxjs/vite-plugin",
3
- "version": "2.1.0",
3
+ "version": "2.2.0",
4
4
  "description": "Build Chrome Extensions with this Vite plugin.",
5
5
  "keywords": [
6
6
  "rollup-plugin",