@korioinc/next-conf 1.0.5 → 1.0.6

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.
@@ -2,6 +2,7 @@ import type { NextConfig } from 'next';
2
2
  export interface WithConfigOptions {
3
3
  configFileName?: string;
4
4
  linguiConfigFileName?: string;
5
+ linguiLoaderDir?: string;
5
6
  }
6
7
  /**
7
8
  * Next.js configuration plugin that injects webpack aliases
@@ -1 +1 @@
1
- {"version":3,"file":"with-config.d.ts","sourceRoot":"","sources":["../../src/plugin/with-config.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,MAAM,CAAC;AA2BvC,MAAM,WAAW,iBAAiB;IAChC,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,oBAAoB,CAAC,EAAE,MAAM,CAAC;CAC/B;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,eAAe,CAAC,UAAU,GAAE,UAAe,EAAE,OAAO,GAAE,iBAAsB,GAAG,UAAU,CAoExG"}
1
+ {"version":3,"file":"with-config.d.ts","sourceRoot":"","sources":["../../src/plugin/with-config.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,MAAM,CAAC;AA2BvC,MAAM,WAAW,iBAAiB;IAChC,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,eAAe,CAAC,UAAU,GAAE,UAAe,EAAE,OAAO,GAAE,iBAAsB,GAAG,UAAU,CAmFxG"}
@@ -18,7 +18,7 @@ import * as path from 'path';
18
18
  * ```
19
19
  */
20
20
  export function withNextKitConf(nextConfig = {}, options = {}) {
21
- const { configFileName = 'next-kit.config.ts', linguiConfigFileName = 'lingui.config.ts' } = options;
21
+ const { configFileName = 'next-kit.config.ts', linguiConfigFileName = 'lingui.config.ts', linguiLoaderDir = './lang', } = options;
22
22
  return {
23
23
  ...nextConfig,
24
24
  // Turbopack configuration for development
@@ -36,6 +36,10 @@ export function withNextKitConf(nextConfig = {}, options = {}) {
36
36
  'lingui.config': linguiConfigFileName.startsWith('.') || linguiConfigFileName.startsWith('/')
37
37
  ? linguiConfigFileName
38
38
  : `./${linguiConfigFileName}`,
39
+ // Expose consumer's Lingui loader entry to all imports
40
+ 'lingui.loader': linguiLoaderDir.startsWith('.') || linguiLoaderDir.startsWith('/')
41
+ ? `${linguiLoaderDir}/index.ts`
42
+ : `./${linguiLoaderDir}/index.ts`,
39
43
  },
40
44
  },
41
45
  // Webpack configuration for production builds
@@ -48,6 +52,7 @@ export function withNextKitConf(nextConfig = {}, options = {}) {
48
52
  const cwd = options?.dir || process.cwd();
49
53
  const userConfigPath = path.resolve(cwd, configFileName);
50
54
  const userLinguiConfigPath = path.resolve(cwd, linguiConfigFileName);
55
+ const userLinguiLoaderPath = path.resolve(cwd, linguiLoaderDir, 'index.ts');
51
56
  // Map package paths used by this package
52
57
  const newConfigPaths = [
53
58
  '@korioinc/next-conf/dist/core/config.default',
@@ -64,6 +69,10 @@ export function withNextKitConf(nextConfig = {}, options = {}) {
64
69
  if (config.resolve?.alias) {
65
70
  config.resolve.alias['lingui.config'] = userLinguiConfigPath;
66
71
  }
72
+ // Alias lingui.loader -> user's loader entry
73
+ if (config.resolve?.alias) {
74
+ config.resolve.alias['lingui.loader'] = userLinguiLoaderPath;
75
+ }
67
76
  // Call the original webpack function if it exists
68
77
  if (typeof nextConfig.webpack === 'function') {
69
78
  return nextConfig.webpack(config, options);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@korioinc/next-conf",
3
- "version": "1.0.5",
3
+ "version": "1.0.6",
4
4
  "description": "Configuration management for Next.js applications",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -35,9 +35,9 @@
35
35
  }
36
36
  },
37
37
  "devDependencies": {
38
- "@types/node": "^22.18.1",
38
+ "@types/node": "^22.18.3",
39
39
  "typescript": "^5.9.2",
40
- "vitest": "^2.0.0"
40
+ "vitest": "^2.1.9"
41
41
  },
42
42
  "publishConfig": {
43
43
  "access": "public",