@koine/next 2.0.0-beta.147 → 2.0.0-beta.148
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/config.cjs.js +1 -1
- package/config.d.ts +14 -5
- package/config.esm.js +1 -1
- package/package.json +5 -5
package/config.cjs.js
CHANGED
|
@@ -3,6 +3,6 @@
|
|
|
3
3
|
var swc = require('@koine/node/swc');
|
|
4
4
|
var next = require('@koine/i18n/next');
|
|
5
5
|
|
|
6
|
-
let withKoine=(s={})=>{let{nx:n,svg:p,i18nRoutes:l,i18nCompiler:a,modularize:u
|
|
6
|
+
let withKoine=(s={})=>{let{nx:n,svg:p,i18nRoutes:l,i18nCompiler:a,modularize:m,...u}=s,c={modularizeImports:{...m?Array.isArray(m)?m.reduce((o,r)=>({...o,...swc.swcCreateTransforms(r.libs,r.scope)}),{}):swc.swcCreateTransforms(m.libs,m.scope):{},...u.modularizeImports||{},...swc.swcTransformsKoine},...u};return (p&&(n?c.nx={svgr:!0}:(delete c.nx,c.webpack=(e,o)=>{let r="function"==typeof u.webpack?u.webpack(e,o):e;return r.module.rules.push({test:/\.svg$/,use:[{loader:"@svgr/webpack",options:{svgoConfig:{plugins:[{name:"removeViewBox",active:!1}]}}}]}),r})),l)?next.withI18nLegacy({...c,i18nRoutes:l}):a?n?next.withI18nAsync({...c,i18nCompiler:a}):next.withI18n({...c,i18nCompiler:a}):c};
|
|
7
7
|
|
|
8
8
|
exports.withKoine = withKoine;
|
package/config.d.ts
CHANGED
|
@@ -19,20 +19,29 @@ type ModularizeShortcut = {
|
|
|
19
19
|
scope?: string;
|
|
20
20
|
};
|
|
21
21
|
export type WithKoineOptions = NextConfig & {
|
|
22
|
+
/**
|
|
23
|
+
* Set it to `true` when your _Next.js_ app is built inside a Nx monorepo
|
|
24
|
+
*/
|
|
22
25
|
nx?: boolean;
|
|
26
|
+
/**
|
|
27
|
+
* Set it to `true` in order to be able importing React components directly
|
|
28
|
+
* from `.svg` files.
|
|
29
|
+
*
|
|
30
|
+
* It automatically configure webpack taking into account the `nx` option.
|
|
31
|
+
*/
|
|
23
32
|
svg?: boolean;
|
|
24
33
|
/**
|
|
25
34
|
* Shortcut option to automatically create swc transforms to feed into
|
|
26
|
-
* _Next.js_' `modularizeImports
|
|
35
|
+
* _Next.js_' `modularizeImports`.
|
|
36
|
+
*
|
|
37
|
+
* Pass one or a list of {@link ModularizeShortcut shortcut object}.
|
|
27
38
|
*/
|
|
28
39
|
modularize?: ModularizeShortcut[] | ModularizeShortcut;
|
|
29
40
|
} & WithI18nLegacyOptions & WithI18nAsyncOptions;
|
|
30
41
|
/**
|
|
31
|
-
* Get
|
|
42
|
+
* Get _Next.js_ config with some extra {@link WithKoineOptions options}
|
|
32
43
|
*
|
|
33
|
-
* @param
|
|
34
|
-
* @property {boolean} [options.nx=false] Nx monorepo setup
|
|
35
|
-
* @property {boolean} [options.svg=false] SVG to react components
|
|
44
|
+
* @param options
|
|
36
45
|
*/
|
|
37
46
|
export declare let withKoine: (options?: WithKoineOptions) => NextConfig;
|
|
38
47
|
export {};
|
package/config.esm.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { swcCreateTransforms, swcTransformsKoine } from '@koine/node/swc';
|
|
2
2
|
import { withI18nLegacy, withI18nAsync, withI18n } from '@koine/i18n/next';
|
|
3
3
|
|
|
4
|
-
let withKoine=(s={})=>{let{nx:n,svg:p,i18nRoutes:l,i18nCompiler:a,modularize:u
|
|
4
|
+
let withKoine=(s={})=>{let{nx:n,svg:p,i18nRoutes:l,i18nCompiler:a,modularize:m,...u}=s,c={modularizeImports:{...m?Array.isArray(m)?m.reduce((o,r)=>({...o,...swcCreateTransforms(r.libs,r.scope)}),{}):swcCreateTransforms(m.libs,m.scope):{},...u.modularizeImports||{},...swcTransformsKoine},...u};return (p&&(n?c.nx={svgr:!0}:(delete c.nx,c.webpack=(e,o)=>{let r="function"==typeof u.webpack?u.webpack(e,o):e;return r.module.rules.push({test:/\.svg$/,use:[{loader:"@svgr/webpack",options:{svgoConfig:{plugins:[{name:"removeViewBox",active:!1}]}}}]}),r})),l)?withI18nLegacy({...c,i18nRoutes:l}):a?n?withI18nAsync({...c,i18nCompiler:a}):withI18n({...c,i18nCompiler:a}):c};
|
|
5
5
|
|
|
6
6
|
export { withKoine };
|
package/package.json
CHANGED
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
"name": "@koine/next",
|
|
3
3
|
"sideEffects": false,
|
|
4
4
|
"dependencies": {
|
|
5
|
-
"@koine/browser": "2.0.0-beta.
|
|
6
|
-
"@koine/i18n": "2.0.0-beta.
|
|
7
|
-
"@koine/node": "2.0.0-beta.
|
|
8
|
-
"@koine/utils": "2.0.0-beta.
|
|
5
|
+
"@koine/browser": "2.0.0-beta.148",
|
|
6
|
+
"@koine/i18n": "2.0.0-beta.148",
|
|
7
|
+
"@koine/node": "2.0.0-beta.148",
|
|
8
|
+
"@koine/utils": "2.0.0-beta.148"
|
|
9
9
|
},
|
|
10
10
|
"peerDependencies": {
|
|
11
11
|
"next": "^14.0.4",
|
|
@@ -65,5 +65,5 @@
|
|
|
65
65
|
"module": "./index.esm.js",
|
|
66
66
|
"main": "./index.cjs.js",
|
|
67
67
|
"types": "./index.esm.d.ts",
|
|
68
|
-
"version": "2.0.0-beta.
|
|
68
|
+
"version": "2.0.0-beta.148"
|
|
69
69
|
}
|