@crxjs/vite-plugin 2.7.0 → 2.7.1

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 +17 -8
  2. package/package.json +5 -5
package/dist/index.mjs CHANGED
@@ -798,6 +798,19 @@ async function allFilesReady() {
798
798
 
799
799
  const { outputFile } = fsx;
800
800
  const debug$4 = _debug("file-writer");
801
+ function getRollupInputOptions(options) {
802
+ const {
803
+ platform: _platform,
804
+ resolve: _resolve,
805
+ transform: _transform,
806
+ moduleTypes: _moduleTypes,
807
+ optimization: _optimization,
808
+ experimental: _experimental,
809
+ cwd: _cwd,
810
+ ...rollupOptions
811
+ } = options;
812
+ return rollupOptions;
813
+ }
801
814
  function queueWrite(script, previous) {
802
815
  if (!previous)
803
816
  return write(script);
@@ -811,9 +824,10 @@ async function start({
811
824
  (p) => p.name?.startsWith("crx:")
812
825
  );
813
826
  const { rollupOptions, outDir } = server.config.build;
827
+ const rollupInputOptions = getRollupInputOptions(rollupOptions);
814
828
  const inputOptions = {
815
829
  input: "index.html",
816
- ...rollupOptions,
830
+ ...rollupInputOptions,
817
831
  plugins
818
832
  };
819
833
  const rollupOutputOptions = [rollupOptions.output].flat()[0];
@@ -1104,11 +1118,8 @@ const pluginContentScripts = () => {
1104
1118
  async config(config, env) {
1105
1119
  await findWorldMainIds(config, env);
1106
1120
  return {
1107
- ...config,
1108
1121
  build: {
1109
- ...config.build,
1110
1122
  rollupOptions: {
1111
- ...config.build?.rollupOptions,
1112
1123
  // keep exports for content script module api
1113
1124
  preserveEntrySignatures: config.build?.rollupOptions?.preserveEntrySignatures ?? "exports-only"
1114
1125
  }
@@ -1974,7 +1985,7 @@ const pluginHMR = () => {
1974
1985
  server.hmr = {};
1975
1986
  server.hmr = server.hmr ?? {};
1976
1987
  server.hmr.host = "localhost";
1977
- return { server, ...config2 };
1988
+ return { server };
1978
1989
  },
1979
1990
  // server should ignore outdir
1980
1991
  configResolved(_config) {
@@ -2362,9 +2373,7 @@ const pluginManifest = () => {
2362
2373
  for (const x of [js, sw, html].flat())
2363
2374
  set.add(x);
2364
2375
  return {
2365
- ...config2,
2366
2376
  optimizeDeps: {
2367
- ...config2.optimizeDeps,
2368
2377
  entries: [...set]
2369
2378
  }
2370
2379
  };
@@ -2852,7 +2861,7 @@ const pluginWebAccessibleResources = () => {
2852
2861
  browser = opts.browser || "chrome";
2853
2862
  injectCss = contentScripts2.injectCss ?? true;
2854
2863
  userWantsViteManifest = build?.manifest;
2855
- return { ...config2, build: { ...build, manifest: command === "build" } };
2864
+ return { build: { manifest: command === "build" } };
2856
2865
  },
2857
2866
  configResolved(_config) {
2858
2867
  config = _config;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@crxjs/vite-plugin",
3
- "version": "2.7.0",
3
+ "version": "2.7.1",
4
4
  "description": "Build Chrome Extensions with this Vite plugin.",
5
5
  "keywords": [
6
6
  "rollup-plugin",
@@ -55,11 +55,11 @@
55
55
  "dependencies": {
56
56
  "@webcomponents/custom-elements": "^1.5.0",
57
57
  "acorn-walk": "^8.3.5",
58
- "convert-source-map": "^1.7.0",
59
- "debug": "^4.3.3",
58
+ "convert-source-map": "^2.0.0",
59
+ "debug": "^4.4.3",
60
60
  "es-module-lexer": "^0.10.0",
61
61
  "tinyglobby": "^0.2.17",
62
- "fs-extra": "^10.0.1",
62
+ "fs-extra": "^11.3.5",
63
63
  "jsesc": "^3.0.2",
64
64
  "magic-string": "^0.30.12",
65
65
  "node-html-parser": "^7.1.0",
@@ -83,7 +83,7 @@
83
83
  "@types/chrome": "0.0.237",
84
84
  "@types/convert-source-map": "^2.0.0",
85
85
  "@types/debug": "4.1.13",
86
- "@types/fs-extra": "9.0.13",
86
+ "@types/fs-extra": "11.0.4",
87
87
  "@types/jest-image-snapshot": "^5.1.0",
88
88
  "@types/jsesc": "3.0.3",
89
89
  "@types/node": "17.0.18",