@promoboxx/react-scripts-vite 0.1.31-esm.8 → 0.2.1-vitest.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.
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Plugin } from 'vite';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Mutes Rollup warnings.
|
|
5
|
+
* https://github.com/vitejs/vite/issues/15012#issuecomment-1825035992
|
|
6
|
+
*/
|
|
7
|
+
declare const muteWarnings: (options: {
|
|
8
|
+
warningsToIgnore: string[][];
|
|
9
|
+
debugWarnings: boolean;
|
|
10
|
+
}) => Plugin;
|
|
11
|
+
|
|
12
|
+
export = muteWarnings;
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
|
|
20
|
+
// src/muteWarnings.ts
|
|
21
|
+
var muteWarnings_exports = {};
|
|
22
|
+
__export(muteWarnings_exports, {
|
|
23
|
+
default: () => muteWarnings_default
|
|
24
|
+
});
|
|
25
|
+
module.exports = __toCommonJS(muteWarnings_exports);
|
|
26
|
+
var muteWarnings = (options) => {
|
|
27
|
+
const mutedMessages = /* @__PURE__ */ new Set();
|
|
28
|
+
return {
|
|
29
|
+
name: "mute-warnings",
|
|
30
|
+
enforce: "pre",
|
|
31
|
+
config: (userConfig) => ({
|
|
32
|
+
build: {
|
|
33
|
+
rollupOptions: {
|
|
34
|
+
onwarn(warning, defaultHandler) {
|
|
35
|
+
var _a, _b;
|
|
36
|
+
if (warning.code) {
|
|
37
|
+
if (options.debugWarnings) {
|
|
38
|
+
console.warn(`${warning.code} - ${warning.message}`);
|
|
39
|
+
}
|
|
40
|
+
const muted = options.warningsToIgnore.find(
|
|
41
|
+
([code, message]) => code === warning.code && warning.message.includes(message)
|
|
42
|
+
);
|
|
43
|
+
if (muted) {
|
|
44
|
+
mutedMessages.add(muted.join());
|
|
45
|
+
return;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
if ((_b = (_a = userConfig.build) == null ? void 0 : _a.rollupOptions) == null ? void 0 : _b.onwarn) {
|
|
49
|
+
userConfig.build.rollupOptions.onwarn(warning, defaultHandler);
|
|
50
|
+
} else {
|
|
51
|
+
defaultHandler(warning);
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
}),
|
|
57
|
+
closeBundle() {
|
|
58
|
+
const diff = options.warningsToIgnore.filter(
|
|
59
|
+
(x) => !mutedMessages.has(x.join())
|
|
60
|
+
);
|
|
61
|
+
if (diff.length > 0) {
|
|
62
|
+
this.warn(
|
|
63
|
+
"Some of your muted warnings never appeared during the build process:"
|
|
64
|
+
);
|
|
65
|
+
diff.forEach((m) => this.warn(`- ${m.join(": ")}`));
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
};
|
|
69
|
+
};
|
|
70
|
+
var muteWarnings_default = muteWarnings;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Plugin } from 'vite';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Mutes Rollup warnings.
|
|
5
|
+
* https://github.com/vitejs/vite/issues/15012#issuecomment-1825035992
|
|
6
|
+
*/
|
|
7
|
+
declare const muteWarnings: (options: {
|
|
8
|
+
warningsToIgnore: string[][];
|
|
9
|
+
debugWarnings: boolean;
|
|
10
|
+
}) => Plugin;
|
|
11
|
+
|
|
12
|
+
export { muteWarnings as default };
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
// src/muteWarnings.ts
|
|
2
|
+
var muteWarnings = (options) => {
|
|
3
|
+
const mutedMessages = /* @__PURE__ */ new Set();
|
|
4
|
+
return {
|
|
5
|
+
name: "mute-warnings",
|
|
6
|
+
enforce: "pre",
|
|
7
|
+
config: (userConfig) => ({
|
|
8
|
+
build: {
|
|
9
|
+
rollupOptions: {
|
|
10
|
+
onwarn(warning, defaultHandler) {
|
|
11
|
+
if (warning.code) {
|
|
12
|
+
if (options.debugWarnings) {
|
|
13
|
+
console.warn(`${warning.code} - ${warning.message}`);
|
|
14
|
+
}
|
|
15
|
+
const muted = options.warningsToIgnore.find(
|
|
16
|
+
([code, message]) => code === warning.code && warning.message.includes(message)
|
|
17
|
+
);
|
|
18
|
+
if (muted) {
|
|
19
|
+
mutedMessages.add(muted.join());
|
|
20
|
+
return;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
if (userConfig.build?.rollupOptions?.onwarn) {
|
|
24
|
+
userConfig.build.rollupOptions.onwarn(warning, defaultHandler);
|
|
25
|
+
} else {
|
|
26
|
+
defaultHandler(warning);
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
}),
|
|
32
|
+
closeBundle() {
|
|
33
|
+
const diff = options.warningsToIgnore.filter(
|
|
34
|
+
(x) => !mutedMessages.has(x.join())
|
|
35
|
+
);
|
|
36
|
+
if (diff.length > 0) {
|
|
37
|
+
this.warn(
|
|
38
|
+
"Some of your muted warnings never appeared during the build process:"
|
|
39
|
+
);
|
|
40
|
+
diff.forEach((m) => this.warn(`- ${m.join(": ")}`));
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
};
|
|
44
|
+
};
|
|
45
|
+
var muteWarnings_default = muteWarnings;
|
|
46
|
+
export {
|
|
47
|
+
muteWarnings_default as default
|
|
48
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@promoboxx/react-scripts-vite",
|
|
3
|
-
"version": "0.1
|
|
3
|
+
"version": "0.2.1-vitest.1",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "./dist/cjs/index.js",
|
|
6
6
|
"module": "./dist/esm/index.mjs",
|
|
@@ -21,9 +21,9 @@
|
|
|
21
21
|
"@types/node": "^20.10.4",
|
|
22
22
|
"concurrently": "^8.2.2",
|
|
23
23
|
"esbuild": "x",
|
|
24
|
-
"prettier": "^3.1.
|
|
24
|
+
"prettier": "^3.1.1",
|
|
25
25
|
"tsup": "^8.0.1",
|
|
26
|
-
"typescript": "^5.3.
|
|
26
|
+
"typescript": "^5.3.3"
|
|
27
27
|
},
|
|
28
28
|
"exports": {
|
|
29
29
|
".": {
|
|
@@ -36,16 +36,16 @@
|
|
|
36
36
|
}
|
|
37
37
|
},
|
|
38
38
|
"dependencies": {
|
|
39
|
-
"@vitejs/plugin-react": "^4.2.
|
|
39
|
+
"@vitejs/plugin-react": "^4.2.1",
|
|
40
40
|
"alias-hq": "^6.2.3",
|
|
41
41
|
"eslint": "^8.55.0",
|
|
42
|
-
"jsdom": "^23.0.
|
|
43
|
-
"vite": "^5.0.
|
|
42
|
+
"jsdom": "^23.0.1",
|
|
43
|
+
"vite": "^5.0.9",
|
|
44
44
|
"vite-plugin-checker": "^0.6.2",
|
|
45
45
|
"vite-plugin-environment": "^1.1.3",
|
|
46
|
-
"vite-plugin-pwa": "^0.17.
|
|
46
|
+
"vite-plugin-pwa": "^0.17.4",
|
|
47
47
|
"vite-plugin-svgr": "^4.2.0",
|
|
48
|
-
"vitest": "^0.
|
|
48
|
+
"vitest": "^1.0.4"
|
|
49
49
|
},
|
|
50
50
|
"files": [
|
|
51
51
|
"dist"
|