unplugin-version-injector 1.1.1-alpha.3 → 1.1.1-alpha.5
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/dist/core.js +5 -7
- package/dist/core.mjs +5 -7
- package/dist/webpack.js +11 -8
- package/dist/webpack.mjs +11 -8
- package/package.json +1 -1
package/dist/core.js
CHANGED
@@ -37,23 +37,21 @@ module.exports = __toCommonJS(core_exports);
|
|
37
37
|
var import_unplugin = require("unplugin");
|
38
38
|
|
39
39
|
// src/utils.ts
|
40
|
-
var import_node_path = __toESM(require("path"));
|
41
40
|
var import_node_fs = __toESM(require("fs"));
|
41
|
+
var import_node_path = __toESM(require("path"));
|
42
42
|
var import_node_url = require("url");
|
43
43
|
var import_meta = {};
|
44
|
-
function
|
44
|
+
function getCurrentDir() {
|
45
45
|
try {
|
46
|
-
|
47
|
-
return import_node_path.default.dirname((0, import_node_url.fileURLToPath)(import_meta.url));
|
48
|
-
}
|
46
|
+
return import_node_path.default.dirname((0, import_node_url.fileURLToPath)(import_meta.url));
|
49
47
|
} catch (e) {
|
48
|
+
return process.cwd();
|
50
49
|
}
|
51
|
-
return __dirname;
|
52
50
|
}
|
53
51
|
function getPackageVersion() {
|
54
52
|
var _a;
|
55
53
|
try {
|
56
|
-
let dir =
|
54
|
+
let dir = getCurrentDir();
|
57
55
|
while (dir !== import_node_path.default.parse(dir).root) {
|
58
56
|
const pkgPath = import_node_path.default.join(dir, "package.json");
|
59
57
|
if (import_node_fs.default.existsSync(pkgPath)) {
|
package/dist/core.mjs
CHANGED
@@ -9,23 +9,21 @@ var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require
|
|
9
9
|
import { createUnplugin } from "unplugin";
|
10
10
|
|
11
11
|
// src/utils.ts
|
12
|
-
import path from "node:path";
|
13
12
|
import fs from "node:fs";
|
13
|
+
import path from "node:path";
|
14
14
|
import { fileURLToPath } from "node:url";
|
15
15
|
var import_meta = {};
|
16
|
-
function
|
16
|
+
function getCurrentDir() {
|
17
17
|
try {
|
18
|
-
|
19
|
-
return path.dirname(fileURLToPath(import_meta.url));
|
20
|
-
}
|
18
|
+
return path.dirname(fileURLToPath(import_meta.url));
|
21
19
|
} catch (e) {
|
20
|
+
return process.cwd();
|
22
21
|
}
|
23
|
-
return __dirname;
|
24
22
|
}
|
25
23
|
function getPackageVersion() {
|
26
24
|
var _a;
|
27
25
|
try {
|
28
|
-
let dir =
|
26
|
+
let dir = getCurrentDir();
|
29
27
|
while (dir !== path.parse(dir).root) {
|
30
28
|
const pkgPath = path.join(dir, "package.json");
|
31
29
|
if (fs.existsSync(pkgPath)) {
|
package/dist/webpack.js
CHANGED
@@ -30,7 +30,7 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
30
30
|
// src/webpack.ts
|
31
31
|
var webpack_exports = {};
|
32
32
|
__export(webpack_exports, {
|
33
|
-
default: () =>
|
33
|
+
default: () => webpack_default
|
34
34
|
});
|
35
35
|
module.exports = __toCommonJS(webpack_exports);
|
36
36
|
|
@@ -38,23 +38,21 @@ module.exports = __toCommonJS(webpack_exports);
|
|
38
38
|
var import_unplugin = require("unplugin");
|
39
39
|
|
40
40
|
// src/utils.ts
|
41
|
-
var import_node_path = __toESM(require("path"));
|
42
41
|
var import_node_fs = __toESM(require("fs"));
|
42
|
+
var import_node_path = __toESM(require("path"));
|
43
43
|
var import_node_url = require("url");
|
44
44
|
var import_meta = {};
|
45
|
-
function
|
45
|
+
function getCurrentDir() {
|
46
46
|
try {
|
47
|
-
|
48
|
-
return import_node_path.default.dirname((0, import_node_url.fileURLToPath)(import_meta.url));
|
49
|
-
}
|
47
|
+
return import_node_path.default.dirname((0, import_node_url.fileURLToPath)(import_meta.url));
|
50
48
|
} catch (e) {
|
49
|
+
return process.cwd();
|
51
50
|
}
|
52
|
-
return __dirname;
|
53
51
|
}
|
54
52
|
function getPackageVersion() {
|
55
53
|
var _a;
|
56
54
|
try {
|
57
|
-
let dir =
|
55
|
+
let dir = getCurrentDir();
|
58
56
|
while (dir !== import_node_path.default.parse(dir).root) {
|
59
57
|
const pkgPath = import_node_path.default.join(dir, "package.json");
|
60
58
|
if (import_node_fs.default.existsSync(pkgPath)) {
|
@@ -141,3 +139,8 @@ var versionInjectorPlugin = (0, import_unplugin.createUnplugin)((options = {}) =
|
|
141
139
|
function versionInjector(options = {}) {
|
142
140
|
return versionInjectorPlugin.webpack(options);
|
143
141
|
}
|
142
|
+
var webpack_default = versionInjector;
|
143
|
+
if (typeof module !== "undefined") {
|
144
|
+
module.exports = versionInjector;
|
145
|
+
module.exports.default = versionInjector;
|
146
|
+
}
|
package/dist/webpack.mjs
CHANGED
@@ -9,23 +9,21 @@ var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require
|
|
9
9
|
import { createUnplugin } from "unplugin";
|
10
10
|
|
11
11
|
// src/utils.ts
|
12
|
-
import path from "node:path";
|
13
12
|
import fs from "node:fs";
|
13
|
+
import path from "node:path";
|
14
14
|
import { fileURLToPath } from "node:url";
|
15
15
|
var import_meta = {};
|
16
|
-
function
|
16
|
+
function getCurrentDir() {
|
17
17
|
try {
|
18
|
-
|
19
|
-
return path.dirname(fileURLToPath(import_meta.url));
|
20
|
-
}
|
18
|
+
return path.dirname(fileURLToPath(import_meta.url));
|
21
19
|
} catch (e) {
|
20
|
+
return process.cwd();
|
22
21
|
}
|
23
|
-
return __dirname;
|
24
22
|
}
|
25
23
|
function getPackageVersion() {
|
26
24
|
var _a;
|
27
25
|
try {
|
28
|
-
let dir =
|
26
|
+
let dir = getCurrentDir();
|
29
27
|
while (dir !== path.parse(dir).root) {
|
30
28
|
const pkgPath = path.join(dir, "package.json");
|
31
29
|
if (fs.existsSync(pkgPath)) {
|
@@ -112,6 +110,11 @@ var versionInjectorPlugin = createUnplugin((options = {}) => {
|
|
112
110
|
function versionInjector(options = {}) {
|
113
111
|
return versionInjectorPlugin.webpack(options);
|
114
112
|
}
|
113
|
+
var webpack_default = versionInjector;
|
114
|
+
if (typeof module !== "undefined") {
|
115
|
+
module.exports = versionInjector;
|
116
|
+
module.exports.default = versionInjector;
|
117
|
+
}
|
115
118
|
export {
|
116
|
-
|
119
|
+
webpack_default as default
|
117
120
|
};
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "unplugin-version-injector",
|
3
|
-
"version": "1.1.1-alpha.
|
3
|
+
"version": "1.1.1-alpha.5",
|
4
4
|
"author": "Nian Yi <nianyi778@gmail.com>",
|
5
5
|
"license": "MIT",
|
6
6
|
"description": "A universal plugin to inject version and build time into HTML (supports Webpack, Vite, Rollup)",
|