@kitsy/cnos-vite 1.2.0 → 1.4.0
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/index.cjs +4 -3
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +2 -1
- package/package.json +2 -2
package/dist/index.cjs
CHANGED
|
@@ -24,7 +24,8 @@ __export(index_exports, {
|
|
|
24
24
|
loadCnosViteEnv: () => loadCnosViteEnv
|
|
25
25
|
});
|
|
26
26
|
module.exports = __toCommonJS(index_exports);
|
|
27
|
-
var
|
|
27
|
+
var import_build = require("@kitsy/cnos/build");
|
|
28
|
+
var import_configure = require("@kitsy/cnos/configure");
|
|
28
29
|
function resolveRuntimeOptions(options, env) {
|
|
29
30
|
const profile = options.profile ?? options.profileFromMode?.(env.mode, env);
|
|
30
31
|
return {
|
|
@@ -41,7 +42,7 @@ async function loadCnosViteEnv(options = {}, env = {
|
|
|
41
42
|
command: "build",
|
|
42
43
|
mode: "production"
|
|
43
44
|
}) {
|
|
44
|
-
const runtime = await (0,
|
|
45
|
+
const runtime = await (0, import_configure.createCnos)(resolveRuntimeOptions(options, env));
|
|
45
46
|
return runtime.toPublicEnv({
|
|
46
47
|
framework: "vite",
|
|
47
48
|
...options.prefix ? { prefix: options.prefix } : {}
|
|
@@ -54,7 +55,7 @@ function createCnosVitePlugin(options = {}) {
|
|
|
54
55
|
async config(config, env) {
|
|
55
56
|
const [publicEnv, browserData] = await Promise.all([
|
|
56
57
|
loadCnosViteEnv(options, env),
|
|
57
|
-
(0,
|
|
58
|
+
(0, import_build.resolveBrowserData)(resolveRuntimeOptions(options, env))
|
|
58
59
|
]);
|
|
59
60
|
const defineEntries = Object.fromEntries(
|
|
60
61
|
Object.entries(publicEnv).flatMap(([key, value]) => {
|
package/dist/index.d.cts
CHANGED
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
// src/index.ts
|
|
2
|
-
import {
|
|
2
|
+
import { resolveBrowserData } from "@kitsy/cnos/build";
|
|
3
|
+
import { createCnos } from "@kitsy/cnos/configure";
|
|
3
4
|
function resolveRuntimeOptions(options, env) {
|
|
4
5
|
const profile = options.profile ?? options.profileFromMode?.(env.mode, env);
|
|
5
6
|
return {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kitsy/cnos-vite",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.4.0",
|
|
4
4
|
"description": "Vite integration for CNOS public config injection.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.cjs",
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
"access": "public"
|
|
36
36
|
},
|
|
37
37
|
"dependencies": {
|
|
38
|
-
"@kitsy/cnos": "1.
|
|
38
|
+
"@kitsy/cnos": "1.4.0"
|
|
39
39
|
},
|
|
40
40
|
"peerDependencies": {
|
|
41
41
|
"vite": ">=5"
|