@crxjs/vite-plugin 1.0.0 → 1.0.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.
package/CHANGELOG.md ADDED
@@ -0,0 +1,7 @@
1
+ # @crxjs/vite-plugin
2
+
3
+ ## 1.0.1
4
+
5
+ ### Patch Changes
6
+
7
+ - d2b4f9e: feat: allow hash in manifest html urls
package/dist/index.cjs CHANGED
@@ -42,6 +42,7 @@ function _interopNamespace(e) {
42
42
  var debug__default = /*#__PURE__*/_interopDefaultLegacy(debug$5);
43
43
  var fg__default = /*#__PURE__*/_interopDefaultLegacy(fg);
44
44
  var v8__default = /*#__PURE__*/_interopDefaultLegacy(v8);
45
+ var fsExtra__default = /*#__PURE__*/_interopDefaultLegacy(fsExtra);
45
46
  var MagicString__default = /*#__PURE__*/_interopDefaultLegacy(MagicString);
46
47
  var colors__default = /*#__PURE__*/_interopDefaultLegacy(colors);
47
48
  var jsesc__default = /*#__PURE__*/_interopDefaultLegacy(jsesc);
@@ -101,7 +102,7 @@ function htmlFiles(manifest) {
101
102
  manifest.options_page,
102
103
  manifest.options_ui?.page,
103
104
  manifest.sandbox?.pages
104
- ].flat().filter(isString).sort();
105
+ ].flat().filter(isString).map((s) => s.split("#")[0]).sort();
105
106
  return [...new Set(files)];
106
107
  }
107
108
  function decodeManifest(code) {
@@ -1981,6 +1982,7 @@ function withLatestFrom() {
1981
1982
  });
1982
1983
  }
1983
1984
 
1985
+ const { pathExistsSync, outputFile, statSync } = fsExtra__default["default"];
1984
1986
  const debug$3 = _debug("file-writer").extend("events");
1985
1987
  const writerEvent$ = new BehaviorSubject({
1986
1988
  type: "init"
@@ -2002,7 +2004,7 @@ const filesReady$ = writerEvent$.pipe(filter((x) => {
2002
2004
  return x.type === "writeBundle";
2003
2005
  }), switchMap((event) => interval(100).pipe(mapTo(event), first(({ bundle, options, timestamp }) => {
2004
2006
  const result = Object.keys(bundle).every((p) => {
2005
- const stats = fsExtra.statSync(join(options.dir, p));
2007
+ const stats = statSync(join(options.dir, p));
2006
2008
  return stats.mtimeMs > timestamp;
2007
2009
  });
2008
2010
  return result;
@@ -2014,7 +2016,7 @@ const rebuildFiles = async () => {
2014
2016
  debug$3("rebuildFiles start");
2015
2017
  await filesReady();
2016
2018
  await Promise.all([
2017
- fsExtra.outputFile(await triggerName, Date.now().toString()),
2019
+ outputFile(await triggerName, Date.now().toString()),
2018
2020
  filesStart()
2019
2021
  ]);
2020
2022
  await filesReady();
@@ -2063,8 +2065,8 @@ const pluginFileWriterEvents = () => {
2063
2065
  async buildStart(options) {
2064
2066
  start = perf_hooks.performance.now();
2065
2067
  const filename = await triggerName;
2066
- if (!fsExtra.existsSync(filename)) {
2067
- await fsExtra.outputFile(filename, Date.now().toString());
2068
+ if (!pathExistsSync(filename)) {
2069
+ await outputFile(filename, Date.now().toString());
2068
2070
  }
2069
2071
  this.addWatchFile(filename);
2070
2072
  writerEvent$.next({ type: "buildStart", options });
package/dist/index.mjs CHANGED
@@ -4,7 +4,7 @@ import { createHash as createHash$1 } from 'crypto';
4
4
  import debug$5 from 'debug';
5
5
  import fg from 'fast-glob';
6
6
  import v8 from 'v8';
7
- import { readFile, outputFile, existsSync, statSync, readFileSync } from 'fs-extra';
7
+ import fsExtra, { readFile, readFileSync } from 'fs-extra';
8
8
  import MagicString from 'magic-string';
9
9
  import { posix } from 'path';
10
10
  import { performance } from 'perf_hooks';
@@ -69,7 +69,7 @@ function htmlFiles(manifest) {
69
69
  manifest.options_page,
70
70
  manifest.options_ui?.page,
71
71
  manifest.sandbox?.pages
72
- ].flat().filter(isString).sort();
72
+ ].flat().filter(isString).map((s) => s.split("#")[0]).sort();
73
73
  return [...new Set(files)];
74
74
  }
75
75
  function decodeManifest(code) {
@@ -1949,6 +1949,7 @@ function withLatestFrom() {
1949
1949
  });
1950
1950
  }
1951
1951
 
1952
+ const { pathExistsSync, outputFile, statSync } = fsExtra;
1952
1953
  const debug$3 = _debug("file-writer").extend("events");
1953
1954
  const writerEvent$ = new BehaviorSubject({
1954
1955
  type: "init"
@@ -2031,7 +2032,7 @@ const pluginFileWriterEvents = () => {
2031
2032
  async buildStart(options) {
2032
2033
  start = performance.now();
2033
2034
  const filename = await triggerName;
2034
- if (!existsSync(filename)) {
2035
+ if (!pathExistsSync(filename)) {
2035
2036
  await outputFile(filename, Date.now().toString());
2036
2037
  }
2037
2038
  this.addWatchFile(filename);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@crxjs/vite-plugin",
3
- "version": "1.0.0",
3
+ "version": "1.0.1",
4
4
  "description": "Build Chrome Extensions with this Vite plugin.",
5
5
  "keywords": [
6
6
  "rollup-plugin",
@@ -79,10 +79,10 @@
79
79
  "@extend-chrome/messages": "1.2.2",
80
80
  "@extend-chrome/storage": "1.5.0",
81
81
  "@rollup/plugin-alias": "3.1.9",
82
- "@rollup/plugin-commonjs": "21.0.3",
82
+ "@rollup/plugin-commonjs": "21.1.0",
83
83
  "@rollup/plugin-node-resolve": "13.2.0",
84
84
  "@types/acorn": "4.0.6",
85
- "@types/chrome": "0.0.181",
85
+ "@types/chrome": "0.0.183",
86
86
  "@types/debug": "4.1.7",
87
87
  "@types/fs-extra": "9.0.13",
88
88
  "@types/jest": "27.4.1",
@@ -90,19 +90,19 @@
90
90
  "@types/jsesc": "3.0.1",
91
91
  "@types/node": "17.0.18",
92
92
  "@types/react": "17.0.44",
93
- "@types/react-dom": "17.0.11",
94
- "@typescript-eslint/eslint-plugin": "5.19.0",
95
- "@typescript-eslint/parser": "5.19.0",
93
+ "@types/react-dom": "17.0.16",
94
+ "@typescript-eslint/eslint-plugin": "5.21.0",
95
+ "@typescript-eslint/parser": "5.21.0",
96
96
  "@vitejs/plugin-react": "1.3.1",
97
97
  "@vitejs/plugin-vue": "2.3.1",
98
98
  "@vue/compiler-sfc": "3.2.33",
99
- "@vueuse/core": "7.6.2",
99
+ "@vueuse/core": "8.3.1",
100
100
  "@vueuse/router": "8.2.6",
101
- "esbuild": "0.14.23",
101
+ "esbuild": "0.14.38",
102
102
  "esbuild-runner": "2.2.1",
103
103
  "jest": "27.5.1",
104
104
  "jest-image-snapshot": "4.5.1",
105
- "playwright-chromium": "1.21.0",
105
+ "playwright-chromium": "1.21.1",
106
106
  "react": "17.0.2",
107
107
  "react-dom": "17.0.2",
108
108
  "rimraf": "3.0.2",
@@ -111,7 +111,7 @@
111
111
  "rxjs": "7.5.5",
112
112
  "typescript": "4.6.3",
113
113
  "vite": "^2.9.5",
114
- "vite-plugin-inspect": "0.4.3",
114
+ "vite-plugin-inspect": "0.5.0",
115
115
  "vue": "3.2.33"
116
116
  },
117
117
  "peerDependencies": {