@pinegrow/iles-module 3.0.0-beta.94 → 3.0.0-beta.96

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 CHANGED
@@ -16,16 +16,60 @@ async function getViteConfiguration(moduleOptions) {
16
16
  const config = {
17
17
  plugins: vitePlugin ? [vitePlugin] : []
18
18
  };
19
- (_a = config.plugins) == null ? void 0 : _a.push(
20
- _vite2.default.call(void 0, {
21
- ...(moduleOptions == null ? void 0 : moduleOptions.autoImportAPIs) || {},
22
- ...{
23
- imports: ["vue"],
24
- dirs: [],
25
- vueTemplate: true,
26
- cache: true
19
+ const isObject$1 = (value) => {
20
+ return Object.prototype.toString.call(value) === "[object Object]";
21
+ };
22
+ const arraify = (target) => {
23
+ return Array.isArray(target) ? target : [target];
24
+ };
25
+ const mergeConfigRecursively = (defaults, overrides) => {
26
+ const merged = { ...defaults };
27
+ for (const key in overrides) {
28
+ const value = overrides[key];
29
+ if (value == null) {
30
+ continue;
31
+ }
32
+ const existing = merged[key];
33
+ if (existing == null) {
34
+ merged[key] = value;
35
+ continue;
36
+ }
37
+ if (Array.isArray(existing) || Array.isArray(value)) {
38
+ merged[key] = [
39
+ ...arraify(existing !== null && existing !== void 0 ? existing : []),
40
+ ...arraify(value !== null && value !== void 0 ? value : [])
41
+ ];
42
+ continue;
43
+ }
44
+ if (isObject$1(existing) && isObject$1(value)) {
45
+ merged[key] = mergeConfigRecursively(existing, value, rootPath ? `${rootPath}.${key}` : key);
46
+ continue;
27
47
  }
28
- })
48
+ merged[key] = value;
49
+ }
50
+ return merged;
51
+ };
52
+ const mergeConfig = (defaults, overrides) => {
53
+ return mergeConfigRecursively(defaults || {}, overrides || {});
54
+ };
55
+ (_a = config.plugins) == null ? void 0 : _a.push(
56
+ _vite2.default.call(void 0,
57
+ mergeConfig(
58
+ {
59
+ include: [
60
+ /\.[tj]sx?$/,
61
+ /\.vue$/,
62
+ /\.vue\?vue/,
63
+ /\.md$/
64
+ ],
65
+ imports: ["vue", "vue-router"],
66
+ dirs: [],
67
+ vueTemplate: true,
68
+ cache: true
69
+ },
70
+ moduleOptions.autoImportAPIs
71
+ )
72
+ )
29
73
  );
30
74
  return config;
31
75
  }
package/dist/index.js CHANGED
@@ -16,16 +16,60 @@ async function getViteConfiguration(moduleOptions) {
16
16
  const config = {
17
17
  plugins: vitePlugin ? [vitePlugin] : []
18
18
  };
19
- (_a = config.plugins) == null ? void 0 : _a.push(
20
- autoImportAPIs({
21
- ...(moduleOptions == null ? void 0 : moduleOptions.autoImportAPIs) || {},
22
- ...{
23
- imports: ["vue"],
24
- dirs: [],
25
- vueTemplate: true,
26
- cache: true
19
+ const isObject$1 = (value) => {
20
+ return Object.prototype.toString.call(value) === "[object Object]";
21
+ };
22
+ const arraify = (target) => {
23
+ return Array.isArray(target) ? target : [target];
24
+ };
25
+ const mergeConfigRecursively = (defaults, overrides) => {
26
+ const merged = { ...defaults };
27
+ for (const key in overrides) {
28
+ const value = overrides[key];
29
+ if (value == null) {
30
+ continue;
31
+ }
32
+ const existing = merged[key];
33
+ if (existing == null) {
34
+ merged[key] = value;
35
+ continue;
36
+ }
37
+ if (Array.isArray(existing) || Array.isArray(value)) {
38
+ merged[key] = [
39
+ ...arraify(existing !== null && existing !== void 0 ? existing : []),
40
+ ...arraify(value !== null && value !== void 0 ? value : [])
41
+ ];
42
+ continue;
43
+ }
44
+ if (isObject$1(existing) && isObject$1(value)) {
45
+ merged[key] = mergeConfigRecursively(existing, value, rootPath ? `${rootPath}.${key}` : key);
46
+ continue;
27
47
  }
28
- })
48
+ merged[key] = value;
49
+ }
50
+ return merged;
51
+ };
52
+ const mergeConfig = (defaults, overrides) => {
53
+ return mergeConfigRecursively(defaults || {}, overrides || {});
54
+ };
55
+ (_a = config.plugins) == null ? void 0 : _a.push(
56
+ autoImportAPIs(
57
+ mergeConfig(
58
+ {
59
+ include: [
60
+ /\.[tj]sx?$/,
61
+ /\.vue$/,
62
+ /\.vue\?vue/,
63
+ /\.md$/
64
+ ],
65
+ imports: ["vue", "vue-router"],
66
+ dirs: [],
67
+ vueTemplate: true,
68
+ cache: true
69
+ },
70
+ moduleOptions.autoImportAPIs
71
+ )
72
+ )
29
73
  );
30
74
  return config;
31
75
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pinegrow/iles-module",
3
- "version": "3.0.0-beta.94",
3
+ "version": "3.0.0-beta.96",
4
4
  "description": "Pinegrow Iles Module",
5
5
  "author": "Pinegrow (http://pinegrow.com/)",
6
6
  "license": "MIT",
@@ -31,7 +31,7 @@
31
31
  "increment-beta-version": "npm version prerelease --preid=beta"
32
32
  },
33
33
  "dependencies": {
34
- "@pinegrow/vite-plugin": "3.0.0-beta.94",
34
+ "@pinegrow/vite-plugin": "3.0.0-beta.96",
35
35
  "node-html-parser": "^6.1.5",
36
36
  "unplugin-auto-import": "^0.15.2"
37
37
  },