@crxjs/vite-plugin 2.0.0-beta.8 → 2.0.0-beta.9

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/README.md CHANGED
File without changes
package/dist/index.mjs CHANGED
@@ -568,7 +568,7 @@ const pluginContentScripts = () => {
568
568
  async configureServer(_server) {
569
569
  server = _server;
570
570
  if (typeof preambleCode === "undefined" && server.config.plugins.some(
571
- ({ name = "none" }) => name.toLowerCase().includes("react")
571
+ ({ name = "none" }) => name.toLowerCase().includes("react") && !name.toLowerCase().includes("preact")
572
572
  )) {
573
573
  try {
574
574
  const react = await import('@vitejs/plugin-react');
@@ -806,7 +806,7 @@ const pluginDynamicContentScripts = () => {
806
806
  );
807
807
  return `${JSON.stringify(
808
808
  `/${script.loaderName ?? script.fileName}`
809
- )};`;
809
+ )}${match.split(scriptKey)[1]}`;
810
810
  }
811
811
  );
812
812
  chunk.code = replaced;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@crxjs/vite-plugin",
3
- "version": "2.0.0-beta.8",
3
+ "version": "2.0.0-beta.9",
4
4
  "description": "Build Chrome Extensions with this Vite plugin.",
5
5
  "keywords": [
6
6
  "rollup-plugin",
@@ -45,6 +45,23 @@
45
45
  "schema",
46
46
  "client.d.ts"
47
47
  ],
48
+ "scripts": {
49
+ "format": "prettier -w -c ../../.prettierrc.yaml",
50
+ "build": "run-s build:clean build:js",
51
+ "build:clean": "rimraf dist",
52
+ "build:js": "rollup -c rollup.config.ts --configPlugin esbuild",
53
+ "dev:js": "npm run build:js -- -w",
54
+ "dev:lint": "tsc --noEmit --watch",
55
+ "lint": "run-s lint:eslint lint:types",
56
+ "lint:eslint": "eslint \"{src,test}/**/*.ts\"",
57
+ "lint:types": "tsc --noEmit",
58
+ "test": "vitest --mode unit",
59
+ "test:e2e": "vitest --mode e2e",
60
+ "test:run": "run-s test:run:*",
61
+ "test:run:out": "vitest --run --mode out",
62
+ "test:run:e2e": "vitest --run --mode e2e",
63
+ "test:update": "run-s \"test:run:out --update\" \"test:run:e2e --update\""
64
+ },
48
65
  "dependencies": {
49
66
  "@rollup/pluginutils": "^4.1.2",
50
67
  "@webcomponents/custom-elements": "^1.5.0",
@@ -102,22 +119,5 @@
102
119
  "vite-plugin-inspect": "0.7.5",
103
120
  "vitest": "0.24.3",
104
121
  "vue": "3.2.41"
105
- },
106
- "scripts": {
107
- "format": "prettier -w -c ../../.prettierrc.yaml",
108
- "build": "run-s build:clean build:js",
109
- "build:clean": "rimraf dist",
110
- "build:js": "rollup -c rollup.config.ts --configPlugin esbuild",
111
- "dev:js": "npm run build:js -- -w",
112
- "dev:lint": "tsc --noEmit --watch",
113
- "lint": "run-s lint:eslint lint:types",
114
- "lint:eslint": "eslint \"{src,test}/**/*.ts\"",
115
- "lint:types": "tsc --noEmit",
116
- "test": "vitest --mode unit",
117
- "test:e2e": "vitest --mode e2e",
118
- "test:run": "run-s test:run:*",
119
- "test:run:out": "vitest --run --mode out",
120
- "test:run:e2e": "vitest --run --mode e2e",
121
- "test:update": "run-s \"test:run:out --update\" \"test:run:e2e --update\""
122
122
  }
123
- }
123
+ }