@crxjs/vite-plugin 1.0.7 → 1.0.8

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/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # @crxjs/vite-plugin
2
2
 
3
+ ## 1.0.8
4
+
5
+ ### Patch Changes
6
+
7
+ - 8a09cb9: Optimize rollup input
8
+
3
9
  ## 1.0.7
4
10
 
5
11
  ### Patch Changes
package/dist/index.cjs CHANGED
@@ -2784,17 +2784,28 @@ const pluginManifest = (_manifest) => () => {
2784
2784
  async config(config2, env) {
2785
2785
  manifest = await (typeof _manifest === "function" ? _manifest(env) : _manifest);
2786
2786
  if (manifest.manifest_version !== 3)
2787
- throw new Error(`Manifest v${manifest.manifest_version} is currently unsupported, please use manifest v3`);
2787
+ throw new Error(`CRXJS does not support Manifest v${manifest.manifest_version}, please use Manifest v3`);
2788
2788
  if (env.command === "serve") {
2789
2789
  const {
2790
2790
  contentScripts: js,
2791
2791
  background: sw,
2792
2792
  html
2793
2793
  } = await manifestFiles(manifest);
2794
- let { entries = [] } = config2.optimizeDeps ?? {};
2795
- entries = [entries].flat();
2796
- const set = new Set(entries);
2797
- for (const x of [...js, ...sw, ...html])
2794
+ const { entries = [] } = config2.optimizeDeps ?? {};
2795
+ let { input = [] } = config2.build?.rollupOptions ?? {};
2796
+ if (typeof input === "string")
2797
+ input = [input];
2798
+ else
2799
+ input = Object.values(input);
2800
+ input = input.map((f) => {
2801
+ let result = f;
2802
+ if (isAbsolute(f)) {
2803
+ result = relative(config2.root ?? process.cwd(), f);
2804
+ }
2805
+ return result;
2806
+ });
2807
+ const set = new Set([entries, input].flat());
2808
+ for (const x of [js, sw, html].flat())
2798
2809
  set.add(x);
2799
2810
  return {
2800
2811
  ...config2,
package/dist/index.mjs CHANGED
@@ -2751,17 +2751,28 @@ const pluginManifest = (_manifest) => () => {
2751
2751
  async config(config2, env) {
2752
2752
  manifest = await (typeof _manifest === "function" ? _manifest(env) : _manifest);
2753
2753
  if (manifest.manifest_version !== 3)
2754
- throw new Error(`Manifest v${manifest.manifest_version} is currently unsupported, please use manifest v3`);
2754
+ throw new Error(`CRXJS does not support Manifest v${manifest.manifest_version}, please use Manifest v3`);
2755
2755
  if (env.command === "serve") {
2756
2756
  const {
2757
2757
  contentScripts: js,
2758
2758
  background: sw,
2759
2759
  html
2760
2760
  } = await manifestFiles(manifest);
2761
- let { entries = [] } = config2.optimizeDeps ?? {};
2762
- entries = [entries].flat();
2763
- const set = new Set(entries);
2764
- for (const x of [...js, ...sw, ...html])
2761
+ const { entries = [] } = config2.optimizeDeps ?? {};
2762
+ let { input = [] } = config2.build?.rollupOptions ?? {};
2763
+ if (typeof input === "string")
2764
+ input = [input];
2765
+ else
2766
+ input = Object.values(input);
2767
+ input = input.map((f) => {
2768
+ let result = f;
2769
+ if (isAbsolute(f)) {
2770
+ result = relative(config2.root ?? process.cwd(), f);
2771
+ }
2772
+ return result;
2773
+ });
2774
+ const set = new Set([entries, input].flat());
2775
+ for (const x of [js, sw, html].flat())
2765
2776
  set.add(x);
2766
2777
  return {
2767
2778
  ...config2,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@crxjs/vite-plugin",
3
- "version": "1.0.7",
3
+ "version": "1.0.8",
4
4
  "description": "Build Chrome Extensions with this Vite plugin.",
5
5
  "keywords": [
6
6
  "rollup-plugin",
@@ -95,8 +95,8 @@
95
95
  "@typescript-eslint/eslint-plugin": "5.23.0",
96
96
  "@typescript-eslint/parser": "5.23.0",
97
97
  "@vitejs/plugin-react": "1.3.2",
98
- "@vitejs/plugin-vue": "2.3.2",
99
- "esbuild": "0.14.38",
98
+ "@vitejs/plugin-vue": "2.3.3",
99
+ "esbuild": "0.14.42",
100
100
  "esbuild-runner": "2.2.1",
101
101
  "eslint": "8.15.0",
102
102
  "jest": "27.5.1",