@akanjs/config 0.9.9 → 0.9.11
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/cjs/src/nextConfig.js +12 -10
- package/esm/src/nextConfig.js +11 -10
- package/package.json +1 -1
- package/src/nextConfig.d.ts +1 -1
package/cjs/src/nextConfig.js
CHANGED
|
@@ -34,8 +34,9 @@ __export(nextConfig_exports, {
|
|
|
34
34
|
module.exports = __toCommonJS(nextConfig_exports);
|
|
35
35
|
var import_bundle_analyzer = __toESM(require("@next/bundle-analyzer"));
|
|
36
36
|
var import_next_pwa = __toESM(require("next-pwa"));
|
|
37
|
-
var import_cache = __toESM(require("next-pwa/cache"));
|
|
37
|
+
var import_cache = __toESM(require("next-pwa/cache.js"));
|
|
38
38
|
var import_path = __toESM(require("path"));
|
|
39
|
+
const import_meta = {};
|
|
39
40
|
const composePlugins = (...plugins) => {
|
|
40
41
|
return function(baseConfig) {
|
|
41
42
|
return async function combined(phase, context) {
|
|
@@ -53,16 +54,17 @@ const composePlugins = (...plugins) => {
|
|
|
53
54
|
};
|
|
54
55
|
};
|
|
55
56
|
const commandType = process.env.AKAN_COMMAND_TYPE?.includes("start") ? "start" : process.env.AKAN_COMMAND_TYPE?.includes("build") ? "build" : "deploy";
|
|
56
|
-
const withPWA = (0, import_next_pwa.default)({
|
|
57
|
-
dest: "public",
|
|
58
|
-
register: true,
|
|
59
|
-
skipWaiting: true,
|
|
60
|
-
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
|
|
61
|
-
runtimeCaching: import_cache.default,
|
|
62
|
-
disable: commandType === "start"
|
|
63
|
-
});
|
|
64
57
|
const devDomain = process.env.NEXT_PUBLIC_SERVE_DOMAIN ?? "akanjs.com";
|
|
65
58
|
const withBase = (appName, config, libs, routes = []) => {
|
|
59
|
+
const __dirname = import_path.default.dirname(new URL(import_meta.url).pathname);
|
|
60
|
+
const withPWA = (0, import_next_pwa.default)({
|
|
61
|
+
dest: "public",
|
|
62
|
+
register: true,
|
|
63
|
+
skipWaiting: true,
|
|
64
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
|
|
65
|
+
runtimeCaching: import_cache.default,
|
|
66
|
+
disable: commandType === "start"
|
|
67
|
+
});
|
|
66
68
|
return composePlugins(
|
|
67
69
|
(0, import_bundle_analyzer.default)({ enabled: process.env.ANALYZE === "true" }),
|
|
68
70
|
...commandType !== "start" || process.env.USE_PWA === "true" ? [withPWA] : []
|
|
@@ -175,7 +177,7 @@ const withBase = (appName, config, libs, routes = []) => {
|
|
|
175
177
|
}
|
|
176
178
|
});
|
|
177
179
|
};
|
|
178
|
-
const defaultNextConfigFile = `import "tsconfig-paths/register";
|
|
180
|
+
const defaultNextConfigFile = `import "tsconfig-paths/register.js";
|
|
179
181
|
|
|
180
182
|
import { getNextConfig } from "@akanjs/config";
|
|
181
183
|
|
package/esm/src/nextConfig.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import withAnalyze from "@next/bundle-analyzer";
|
|
2
2
|
import pwa from "next-pwa";
|
|
3
|
-
import runtimeCaching from "next-pwa/cache";
|
|
3
|
+
import runtimeCaching from "next-pwa/cache.js";
|
|
4
4
|
import path from "path";
|
|
5
5
|
const composePlugins = (...plugins) => {
|
|
6
6
|
return function(baseConfig) {
|
|
@@ -19,16 +19,17 @@ const composePlugins = (...plugins) => {
|
|
|
19
19
|
};
|
|
20
20
|
};
|
|
21
21
|
const commandType = process.env.AKAN_COMMAND_TYPE?.includes("start") ? "start" : process.env.AKAN_COMMAND_TYPE?.includes("build") ? "build" : "deploy";
|
|
22
|
-
const withPWA = pwa({
|
|
23
|
-
dest: "public",
|
|
24
|
-
register: true,
|
|
25
|
-
skipWaiting: true,
|
|
26
|
-
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
|
|
27
|
-
runtimeCaching,
|
|
28
|
-
disable: commandType === "start"
|
|
29
|
-
});
|
|
30
22
|
const devDomain = process.env.NEXT_PUBLIC_SERVE_DOMAIN ?? "akanjs.com";
|
|
31
23
|
const withBase = (appName, config, libs, routes = []) => {
|
|
24
|
+
const __dirname = path.dirname(new URL(import.meta.url).pathname);
|
|
25
|
+
const withPWA = pwa({
|
|
26
|
+
dest: "public",
|
|
27
|
+
register: true,
|
|
28
|
+
skipWaiting: true,
|
|
29
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
|
|
30
|
+
runtimeCaching,
|
|
31
|
+
disable: commandType === "start"
|
|
32
|
+
});
|
|
32
33
|
return composePlugins(
|
|
33
34
|
withAnalyze({ enabled: process.env.ANALYZE === "true" }),
|
|
34
35
|
...commandType !== "start" || process.env.USE_PWA === "true" ? [withPWA] : []
|
|
@@ -141,7 +142,7 @@ const withBase = (appName, config, libs, routes = []) => {
|
|
|
141
142
|
}
|
|
142
143
|
});
|
|
143
144
|
};
|
|
144
|
-
const defaultNextConfigFile = `import "tsconfig-paths/register";
|
|
145
|
+
const defaultNextConfigFile = `import "tsconfig-paths/register.js";
|
|
145
146
|
|
|
146
147
|
import { getNextConfig } from "@akanjs/config";
|
|
147
148
|
|
package/package.json
CHANGED
package/src/nextConfig.d.ts
CHANGED
|
@@ -11,4 +11,4 @@ export declare const withBase: (appName: string, config: NextConfig, libs: strin
|
|
|
11
11
|
debug?: string[];
|
|
12
12
|
};
|
|
13
13
|
}[]) => NextConfigFn;
|
|
14
|
-
export declare const defaultNextConfigFile = "import \"tsconfig-paths/register\";\n\nimport { getNextConfig } from \"@akanjs/config\";\n\nimport appInfo from \"./akan.app.json\";\nimport config from \"./akan.config\";\n\nexport default getNextConfig(config, appInfo);\n";
|
|
14
|
+
export declare const defaultNextConfigFile = "import \"tsconfig-paths/register.js\";\n\nimport { getNextConfig } from \"@akanjs/config\";\n\nimport appInfo from \"./akan.app.json\";\nimport config from \"./akan.config\";\n\nexport default getNextConfig(config, appInfo);\n";
|