@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.
- package/dist/index.mjs +7 -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
|
|
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
|
-
|
|
114
|
+
if (isSlashAfterOriginPresent) {
|
|
115
|
+
return `${root}/*`;
|
|
116
|
+
}
|
|
117
|
+
return root;
|
|
113
118
|
};
|
|
114
119
|
|
|
115
120
|
function defineClientValues(code, config) {
|