@nrwl/next 14.5.2 → 14.5.5-beta.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/CHANGELOG.md +1 -1
- package/generators.json +10 -0
- package/migrations.json +21 -0
- package/package.json +11 -10
- package/plugins/with-less.d.ts +8 -1
- package/plugins/with-less.js +3 -0
- package/plugins/with-less.js.map +1 -1
- package/plugins/with-nx.d.ts +93 -0
- package/plugins/with-nx.js +5 -0
- package/plugins/with-nx.js.map +1 -1
- package/plugins/with-stylus.d.ts +1 -1
- package/plugins/with-stylus.js +3 -0
- package/plugins/with-stylus.js.map +1 -1
- package/src/executors/build/build.impl.js +2 -1
- package/src/executors/build/build.impl.js.map +1 -1
- package/src/executors/server/schema.json +6 -1
- package/src/executors/server/server.impl.d.ts +1 -1
- package/src/executors/server/server.impl.js +60 -18
- package/src/executors/server/server.impl.js.map +1 -1
- package/src/generators/application/files/next.config.js__tmpl__ +5 -9
- package/src/generators/application/files/pages/_document.tsx__tmpl__ +14 -13
- package/src/generators/application/lib/add-project.js +1 -1
- package/src/generators/application/lib/add-project.js.map +1 -1
- package/src/generators/custom-server/custom-server.d.ts +4 -0
- package/src/generators/custom-server/custom-server.js +79 -0
- package/src/generators/custom-server/custom-server.js.map +1 -0
- package/src/generators/custom-server/files/server/main.ts__tmpl__ +56 -0
- package/src/generators/custom-server/files/tsconfig.server.json__tmpl__ +15 -0
- package/src/generators/custom-server/schema.d.ts +4 -0
- package/src/generators/custom-server/schema.json +34 -0
- package/src/generators/init/init.js +2 -0
- package/src/generators/init/init.js.map +1 -1
- package/src/migrations/update-14-5-3/add-gitignore-entry.d.ts +3 -0
- package/src/migrations/update-14-5-3/add-gitignore-entry.js +15 -0
- package/src/migrations/update-14-5-3/add-gitignore-entry.js.map +1 -0
- package/src/migrations/update-14-5-3/update-dev-output-path.d.ts +3 -0
- package/src/migrations/update-14-5-3/update-dev-output-path.js +29 -0
- package/src/migrations/update-14-5-3/update-dev-output-path.js.map +1 -0
- package/src/utils/add-gitignore-entry.d.ts +2 -0
- package/src/utils/add-gitignore-entry.js +18 -0
- package/src/utils/add-gitignore-entry.js.map +1 -0
- package/src/utils/types.d.ts +5 -0
- package/src/utils/versions.d.ts +1 -1
- package/src/utils/versions.js +1 -1
- package/src/utils/versions.js.map +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,6 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
-
## [14.5.
|
|
6
|
+
## [14.5.5-beta.0](https://github.com/nrwl/nx/compare/14.5.4...14.5.5-beta.0) (2022-08-09)
|
|
7
7
|
|
|
8
8
|
**Note:** Version bump only for package @nrwl/next
|
package/generators.json
CHANGED
|
@@ -25,6 +25,11 @@
|
|
|
25
25
|
"factory": "./src/generators/component/component#componentSchematic",
|
|
26
26
|
"schema": "./src/generators/component/schema.json",
|
|
27
27
|
"description": "Create a React component."
|
|
28
|
+
},
|
|
29
|
+
"custom-server": {
|
|
30
|
+
"factory": "./src/generators/custom-server/custom-server#customServerSchematic",
|
|
31
|
+
"schema": "./src/generators/custom-server/schema.json",
|
|
32
|
+
"description": "Set up a custom server."
|
|
28
33
|
}
|
|
29
34
|
},
|
|
30
35
|
"generators": {
|
|
@@ -57,6 +62,11 @@
|
|
|
57
62
|
"aliases": ["lib"],
|
|
58
63
|
"x-type": "library",
|
|
59
64
|
"description": "Create a library."
|
|
65
|
+
},
|
|
66
|
+
"custom-server": {
|
|
67
|
+
"factory": "./src/generators/custom-server/custom-server#customServerGenerator",
|
|
68
|
+
"schema": "./src/generators/custom-server/schema.json",
|
|
69
|
+
"description": "Set up a custom server."
|
|
60
70
|
}
|
|
61
71
|
}
|
|
62
72
|
}
|
package/migrations.json
CHANGED
|
@@ -90,6 +90,18 @@
|
|
|
90
90
|
"version": "14.4.3-beta.0",
|
|
91
91
|
"description": "Add a development outputPath to avoid conflict with the production build.",
|
|
92
92
|
"factory": "./src/migrations/update-14-4-3/add-dev-output-path"
|
|
93
|
+
},
|
|
94
|
+
"add-gitignore-entry": {
|
|
95
|
+
"cli": "nx",
|
|
96
|
+
"version": "14.5.3-beta.0",
|
|
97
|
+
"description": "Add .next folder to gitignore.",
|
|
98
|
+
"factory": "./src/migrations/update-14-5-3/add-gitignore-entry"
|
|
99
|
+
},
|
|
100
|
+
"update-dev-output-path": {
|
|
101
|
+
"cli": "nx",
|
|
102
|
+
"version": "14.5.3-beta.0",
|
|
103
|
+
"description": "Update development outputPath to the project root.",
|
|
104
|
+
"factory": "./src/migrations/update-14-5-3/update-dev-output-path"
|
|
93
105
|
}
|
|
94
106
|
},
|
|
95
107
|
"packageJsonUpdates": {
|
|
@@ -321,6 +333,15 @@
|
|
|
321
333
|
"alwaysAddToPackageJson": false
|
|
322
334
|
}
|
|
323
335
|
}
|
|
336
|
+
},
|
|
337
|
+
"14.5.3": {
|
|
338
|
+
"version": "14.5.3-beta.0",
|
|
339
|
+
"packages": {
|
|
340
|
+
"@emotion/server": {
|
|
341
|
+
"version": "11.10.0",
|
|
342
|
+
"alwaysAddToPackageJson": false
|
|
343
|
+
}
|
|
344
|
+
}
|
|
324
345
|
}
|
|
325
346
|
}
|
|
326
347
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nrwl/next",
|
|
3
|
-
"version": "14.5.
|
|
3
|
+
"version": "14.5.5-beta.0",
|
|
4
4
|
"description": "When using Next.js in Nx, you get the out-of-the-box support for TypeScript, Cypress, and Jest. No need to configure anything: watch mode, source maps, and typings just work.\n\nThe Next.js plugin contains executors and generators for managing Next.js applications and libraries within an Nx workspace. It provides:\n\n\n- Scaffolding for creating, building, serving, linting, and testing Next.js applications.\n\n- Integration with building, serving, and exporting a Next.js application.\n\n- Integration with React libraries within the workspace.",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -34,22 +34,23 @@
|
|
|
34
34
|
},
|
|
35
35
|
"dependencies": {
|
|
36
36
|
"@babel/plugin-proposal-decorators": "^7.14.5",
|
|
37
|
-
"@nrwl/cypress": "14.5.
|
|
38
|
-
"@nrwl/devkit": "14.5.
|
|
39
|
-
"@nrwl/jest": "14.5.
|
|
40
|
-
"@nrwl/linter": "14.5.
|
|
41
|
-
"@nrwl/react": "14.5.
|
|
42
|
-
"@nrwl/web": "14.5.
|
|
43
|
-
"@nrwl/workspace": "14.5.
|
|
37
|
+
"@nrwl/cypress": "14.5.5-beta.0",
|
|
38
|
+
"@nrwl/devkit": "14.5.5-beta.0",
|
|
39
|
+
"@nrwl/jest": "14.5.5-beta.0",
|
|
40
|
+
"@nrwl/linter": "14.5.5-beta.0",
|
|
41
|
+
"@nrwl/react": "14.5.5-beta.0",
|
|
42
|
+
"@nrwl/web": "14.5.5-beta.0",
|
|
43
|
+
"@nrwl/workspace": "14.5.5-beta.0",
|
|
44
44
|
"@svgr/webpack": "^6.1.2",
|
|
45
45
|
"chalk": "4.1.0",
|
|
46
46
|
"dotenv": "~10.0.0",
|
|
47
47
|
"eslint-config-next": "^12.1.0",
|
|
48
48
|
"fs-extra": "^10.1.0",
|
|
49
|
-
"
|
|
49
|
+
"ignore": "^5.0.4",
|
|
50
|
+
"ts-node": "10.9.1",
|
|
50
51
|
"tsconfig-paths": "^3.9.0",
|
|
51
52
|
"url-loader": "^4.1.1",
|
|
52
53
|
"webpack-merge": "^5.8.0"
|
|
53
54
|
},
|
|
54
|
-
"gitHead": "
|
|
55
|
+
"gitHead": "efea1a511edfa904230b9e7b787ef71877ff6d9c"
|
|
55
56
|
}
|
package/plugins/with-less.d.ts
CHANGED
package/plugins/with-less.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.withLess = void 0;
|
|
3
4
|
const tslib_1 = require("tslib");
|
|
4
5
|
// Adapted from https://raw.githubusercontent.com/elado/next-with-less/main/src/index.js
|
|
5
6
|
const webpack_merge_1 = require("webpack-merge");
|
|
@@ -69,6 +70,8 @@ function withLess(_a) {
|
|
|
69
70
|
},
|
|
70
71
|
});
|
|
71
72
|
}
|
|
73
|
+
exports.withLess = withLess;
|
|
72
74
|
module.exports = withLess;
|
|
75
|
+
module.exports.withLess = withLess;
|
|
73
76
|
module.exports.patchNext = patchNextCSSWithLess;
|
|
74
77
|
//# sourceMappingURL=with-less.js.map
|
package/plugins/with-less.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"with-less.js","sourceRoot":"","sources":["../../../../packages/next/plugins/with-less.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"with-less.js","sourceRoot":"","sources":["../../../../packages/next/plugins/with-less.ts"],"names":[],"mappings":";;;;AAAA,wFAAwF;AACxF,iDAAsC;AAEtC,MAAM,eAAe,GAAG,CAAC,EAAE,EAAE,EAAE,CAC7B,IAAI,MAAM,CAAC,EAAE,CAAC,MAAM,CAAC,OAAO,CAAC,OAAO,EAAE,YAAY,CAAC,EAAE,EAAE,CAAC,KAAK,CAAC,CAAC;AAEjE,SAAS,oBAAoB,CAC3B,gBAAqB,OAAO,CAAC,2CAA2C,CAAC;IAEzE,aAAa,CAAC,YAAY,GAAG,eAAe,CAAC,aAAa,CAAC,YAAY,CAAC,CAAC;AAC3E,CAAC;AAED,oBAAoB,EAAE,CAAC;AAEvB,SAAgB,QAAQ,CAAC,EAAyC;QAAzC,EAAE,iBAAiB,GAAG,EAAE,OAAiB,EAAZ,UAAU,sBAAvC,qBAAyC,CAAF;IAC9D,OAAO,MAAM,CAAC,MAAM,CAAC,EAAE,EAAE,UAAU,EAAE;QACnC,OAAO,CAAC,MAAM,EAAE,IAAI;YAClB,0EAA0E;YAC1E,IAAI,cAAc,CAAC;YACnB,qDAAqD;YACrD,IAAI,cAAc,CAAC;YAEnB,MAAM,OAAO,GAAG,M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OAAO,KAAK,UAAU,EAAE;gBAC5C,OAAO,UAAU,CAAC,OAAO,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;aACzC;YAED,OAAO,MAAM,CAAC;QAChB,CAAC;KACF,CAAC,CAAC;AACL,CAAC;AAhFD,4BAgFC;AAED,MAAM,CAAC,OAAO,GAAG,QAAQ,CAAC;AAC1B,MAAM,CAAC,OAAO,CAAC,QAAQ,GAAG,QAAQ,CAAC;AACnC,MAAM,CAAC,OAAO,CAAC,SAAS,GAAG,oBAAoB,CAAC"}
|
package/plugins/with-nx.d.ts
CHANGED
|
@@ -3,3 +3,96 @@ import type { WebpackConfigOptions } from '../src/utils/types';
|
|
|
3
3
|
export interface WithNxOptions extends NextConfig {
|
|
4
4
|
nx?: WebpackConfigOptions;
|
|
5
5
|
}
|
|
6
|
+
export declare function withNx(nextConfig?: WithNxOptions): {
|
|
7
|
+
webpack: (config: any, options: any) => any;
|
|
8
|
+
i18n?: import("next/dist/server/config-shared").I18NConfig;
|
|
9
|
+
eslint: import("next/dist/server/config-shared").ESLintConfig;
|
|
10
|
+
typescript?: import("next/dist/server/config-shared").TypeScriptConfig;
|
|
11
|
+
headers?: () => Promise<import("next/dist/lib/load-custom-routes").Header[]>;
|
|
12
|
+
rewrites?: () => Promise<import("next/dist/lib/load-custom-routes").Rewrite[] | {
|
|
13
|
+
beforeFiles: import("next/dist/lib/load-custom-routes").Rewrite[];
|
|
14
|
+
afterFiles: import("next/dist/lib/load-custom-routes").Rewrite[];
|
|
15
|
+
fallback: import("next/dist/lib/load-custom-routes").Rewrite[];
|
|
16
|
+
}>;
|
|
17
|
+
redirects?: () => Promise<import("next/dist/lib/load-custom-routes").Redirect[]>;
|
|
18
|
+
webpack5?: false;
|
|
19
|
+
excludeDefaultMomentLocales?: boolean;
|
|
20
|
+
trailingSlash?: boolean;
|
|
21
|
+
env?: Record<string, string>;
|
|
22
|
+
distDir?: string;
|
|
23
|
+
cleanDistDir?: boolean;
|
|
24
|
+
assetPrefix?: string;
|
|
25
|
+
useFileSystemPublicRoutes?: boolean;
|
|
26
|
+
generateBuildId?: () => string | Promise<string>;
|
|
27
|
+
generateEtags?: boolean;
|
|
28
|
+
pageExtensions?: string[];
|
|
29
|
+
compress?: boolean;
|
|
30
|
+
poweredByHeader?: boolean;
|
|
31
|
+
images?: Partial<import("next/dist/shared/lib/image-config").ImageConfigComplete>;
|
|
32
|
+
devIndicators?: {
|
|
33
|
+
buildActivity?: boolean;
|
|
34
|
+
buildActivityPosition?: "bottom-right" | "bottom-left" | "top-right" | "top-left";
|
|
35
|
+
};
|
|
36
|
+
onDemandEntries?: {
|
|
37
|
+
maxInactiveAge?: number;
|
|
38
|
+
pagesBufferLength?: number;
|
|
39
|
+
};
|
|
40
|
+
amp?: {
|
|
41
|
+
canonicalBase?: string;
|
|
42
|
+
};
|
|
43
|
+
basePath?: string;
|
|
44
|
+
sassOptions?: {
|
|
45
|
+
[key: string]: any;
|
|
46
|
+
};
|
|
47
|
+
productionBrowserSourceMaps?: boolean;
|
|
48
|
+
optimizeFonts?: boolean;
|
|
49
|
+
reactStrictMode?: boolean;
|
|
50
|
+
publicRuntimeConfig?: {
|
|
51
|
+
[key: string]: any;
|
|
52
|
+
};
|
|
53
|
+
serverRuntimeConfig?: {
|
|
54
|
+
[key: string]: any;
|
|
55
|
+
};
|
|
56
|
+
httpAgentOptions?: {
|
|
57
|
+
keepAlive?: boolean;
|
|
58
|
+
};
|
|
59
|
+
future?: {
|
|
60
|
+
webpack5?: false;
|
|
61
|
+
};
|
|
62
|
+
outputFileTracing?: boolean;
|
|
63
|
+
staticPageGenerationTimeout?: number;
|
|
64
|
+
crossOrigin?: false | "anonymous" | "use-credentials";
|
|
65
|
+
swcMinify?: boolean;
|
|
66
|
+
compiler?: {
|
|
67
|
+
reactRemoveProperties?: boolean | {
|
|
68
|
+
properties?: string[];
|
|
69
|
+
};
|
|
70
|
+
relay?: {
|
|
71
|
+
src: string;
|
|
72
|
+
artifactDirectory?: string;
|
|
73
|
+
language?: "typescript" | "flow";
|
|
74
|
+
};
|
|
75
|
+
removeConsole?: boolean | {
|
|
76
|
+
exclude?: string[];
|
|
77
|
+
};
|
|
78
|
+
styledComponents?: boolean | {
|
|
79
|
+
displayName?: boolean;
|
|
80
|
+
topLevelImportPaths?: string[];
|
|
81
|
+
ssr?: boolean;
|
|
82
|
+
fileName?: boolean;
|
|
83
|
+
meaninglessFileNames?: string[];
|
|
84
|
+
minify?: boolean;
|
|
85
|
+
transpileTemplateLiterals?: boolean;
|
|
86
|
+
namespace?: string;
|
|
87
|
+
pure?: boolean;
|
|
88
|
+
cssProp?: boolean;
|
|
89
|
+
};
|
|
90
|
+
emotion?: boolean | {
|
|
91
|
+
sourceMap?: boolean;
|
|
92
|
+
autoLabel?: "dev-only" | "always" | "never";
|
|
93
|
+
labelFormat?: string;
|
|
94
|
+
};
|
|
95
|
+
};
|
|
96
|
+
output?: "standalone";
|
|
97
|
+
experimental?: import("next/dist/server/config-shared").ExperimentalConfig;
|
|
98
|
+
};
|
package/plugins/with-nx.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.withNx = void 0;
|
|
3
4
|
const tslib_1 = require("tslib");
|
|
4
5
|
const { join } = require('path');
|
|
5
6
|
const { workspaceRoot } = require('@nrwl/devkit');
|
|
@@ -92,6 +93,7 @@ function withNx(nextConfig = {}) {
|
|
|
92
93
|
return userWebpack(config, options);
|
|
93
94
|
} });
|
|
94
95
|
}
|
|
96
|
+
exports.withNx = withNx;
|
|
95
97
|
function getNxEnvironmentVariables() {
|
|
96
98
|
return Object.keys(process.env)
|
|
97
99
|
.filter((env) => /^NX_/i.test(env))
|
|
@@ -113,5 +115,8 @@ function addNxEnvVariables(config) {
|
|
|
113
115
|
.forEach(([name, value]) => (maybeDefinePlugin.definitions[name] = value));
|
|
114
116
|
}
|
|
115
117
|
}
|
|
118
|
+
// Support for older generated code: `const withNx = require('@nrwl/next/plugins/with-nx');`
|
|
116
119
|
module.exports = withNx;
|
|
120
|
+
// Support for newer generated code: `const { withNx } = require(...);`
|
|
121
|
+
module.exports.withNx = withNx;
|
|
117
122
|
//# sourceMappingURL=with-nx.js.map
|
package/plugins/with-nx.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"with-nx.js","sourceRoot":"","sources":["../../../../packages/next/plugins/with-nx.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"with-nx.js","sourceRoot":"","sources":["../../../../packages/next/plugins/with-nx.ts"],"names":[],"mappings":";;;;AAGA,MAAM,EAAE,IAAI,EAAE,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;AACjC,MAAM,EAAE,aAAa,EAAE,GAAG,OAAO,CAAC,cAAc,CAAC,CAAC;AAClD,MAAM,EAAE,eAAe,EAAE,GAAG,OAAO,CAAC,cAAc,CAAC,CAAC;AAMpD,SAAS,UAAU,CAAC,CAAC,EAAE,CAAC;IACtB,OAAO,CACL,CAAC,YAAY,MAAM;QACnB,CAAC,YAAY,MAAM;QACnB,CAAC,CAAC,MAAM,KAAK,CAAC,CAAC,MAAM;QACrB,CAAC,CAAC,MAAM,KAAK,CAAC,CAAC,MAAM;QACrB,CAAC,CAAC,UAAU,KAAK,CAAC,CAAC,UAAU;QAC7B,CAAC,CAAC,SAAS,KAAK,CAAC,CAAC,SAAS,CAC5B,CAAC;AACJ,CAAC;AAED,SAAgB,MAAM,CAAC,aAAa,EAAmB;;IACrD,MAAM,WAAW,GAAG,UAAU,CAAC,OAAO,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC;IACrD,MAAM,EAAE,EAAE,KAAyB,UAAU,EAA9B,eAAe,kBAAK,UAAU,EAAvC,MAA0B,CAAa,CAAC;IAC9C,qCACE,MAAM,kBACJ,kBAAkB,EAAE,IAAI,IACrB,CAAC,MAAA,eAAe,CAAC,MAAM,mCAA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ACN,CAAC,CAAC,IAAI,EAAE,KAAK,CAAC,EAAE,EAAE,CAAC,CAAC,iBAAiB,CAAC,WAAW,CAAC,IAAI,CAAC,GAAG,KAAK,CAAC,CACjE,CAAC;KACL;AACH,CAAC;AAED,4FAA4F;AAC5F,MAAM,CAAC,OAAO,GAAG,MAAM,CAAC;AACxB,uEAAuE;AACvE,MAAM,CAAC,OAAO,CAAC,MAAM,GAAG,MAAM,CAAC"}
|
package/plugins/with-stylus.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export {};
|
|
1
|
+
export declare function withStylus({ stylusLoaderOptions, ...nextConfig }: any): any;
|
package/plugins/with-stylus.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.withStylus = void 0;
|
|
3
4
|
const tslib_1 = require("tslib");
|
|
4
5
|
// Adapted from https://raw.githubusercontent.com/elado/next-with-less/main/src/index.js
|
|
5
6
|
const webpack_merge_1 = require("webpack-merge");
|
|
@@ -69,6 +70,8 @@ function withStylus(_a) {
|
|
|
69
70
|
},
|
|
70
71
|
});
|
|
71
72
|
}
|
|
73
|
+
exports.withStylus = withStylus;
|
|
72
74
|
module.exports = withStylus;
|
|
75
|
+
module.exports.withStylus = withStylus;
|
|
73
76
|
module.exports.patchNext = patchNextCSSWithStylus;
|
|
74
77
|
//# sourceMappingURL=with-stylus.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"with-stylus.js","sourceRoot":"","sources":["../../../../packages/next/plugins/with-stylus.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"with-stylus.js","sourceRoot":"","sources":["../../../../packages/next/plugins/with-stylus.ts"],"names":[],"mappings":";;;;AAAA,wFAAwF;AACxF,iDAAsC;AAEtC,MAAM,iBAAiB,GAAG,CAAC,EAAE,EAAE,EAAE,CAC/B,IAAI,MAAM,CAAC,EAAE,CAAC,MA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AsD;gBACtD,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,YAAY,CAAC,CAAC;YACvC,CAAC,CAAC;YAEF,mBAAmB,CAAC,gBAAgB,CAAC,CAAC;YACtC,OAAO,CAAC,KAAK,CAAC,MAAM,CAClB,OAAO,CAAC,KAAK,CAAC,OAAO,CAAC,cAAc,CAAC,GAAG,CAAC,EACzC,CAAC,EACD,gBAAgB,CACjB,CAAC;YAEF,IAAI,cAAc,EAAE;gBAClB,IAAI,gBAAgB,GAAG,IAAA,qBAAK,EAAC,EAAE,EAAE,cAAc,CAAC,CAAC;gBACjD,mBAAmB,CAAC,gBAAgB,CAAC,CAAC;gBACtC,OAAO,CAAC,KAAK,CAAC,MAAM,CAClB,OAAO,CAAC,KAAK,CAAC,OAAO,CAAC,cAAc,CAAC,GAAG,CAAC,EACzC,CAAC,EACD,gBAAgB,CACjB,CAAC;aACH;YAED,IAAI,OAAO,UAAU,CAAC,OAAO,KAAK,UAAU,EAAE;gBAC5C,OAAO,UAAU,CAAC,OAAO,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;aACzC;YAED,OAAO,MAAM,CAAC;QAChB,CAAC;KACF,CAAC,CAAC;AACL,CAAC;AA/ED,gCA+EC;AAED,MAAM,CAAC,OAAO,GAAG,UAAU,CAAC;AAC5B,MAAM,CAAC,OAAO,CAAC,UAAU,GAAG,UAAU,CAAC;AACvC,MAAM,CAAC,OAAO,CAAC,SAAS,GAAG,sBAAsB,CAAC"}
|
|
@@ -15,10 +15,11 @@ const create_next_config_file_1 = require("./lib/create-next-config-file");
|
|
|
15
15
|
const check_project_1 = require("./lib/check-project");
|
|
16
16
|
const constants_1 = require("../../utils/constants");
|
|
17
17
|
function buildExecutor(options, context) {
|
|
18
|
-
var _a;
|
|
18
|
+
var _a, _b;
|
|
19
19
|
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
20
20
|
// Cast to any to overwrite NODE_ENV
|
|
21
21
|
(_a = process.env).NODE_ENV || (_a.NODE_ENV = 'production');
|
|
22
|
+
(_b = process.env).__NEXT_REACT_ROOT || (_b.__NEXT_REACT_ROOT = 'true');
|
|
22
23
|
let dependencies = [];
|
|
23
24
|
const root = (0, path_1.resolve)(context.root, options.root);
|
|
24
25
|
const libsDir = (0, path_1.join)(context.root, (0, devkit_2.workspaceLayout)().libsDir);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"build.impl.js","sourceRoot":"","sources":["../../../../../../packages/next/src/executors/build/build.impl.ts"],"names":[],"mappings":";;;AAAA,yBAAuB;AAEvB,2CAAoC;AACpC,+BAAqC;AACrC,uCAA2C;AAC3C,uEAA0E;AAC1E,yCAAsD;AACtD,6FAG4D;AAC5D,yCAA+C;AAE/C,+CAAmD;AACnD,mEAA8D;AAC9D,2EAAqE;AACrE,uDAA2D;AAE3D,qDAA+D;AAE/D,SAA8B,aAAa,CACzC,OAAgC,EAChC,OAAwB;;;QAExB,oCAAoC;QACpC,MAAC,OAAO,CAAC,GAAW,EAAC,QAAQ,QAAR,QAAQ,GAAK,YAAY,EAAC;
|
|
1
|
+
{"version":3,"file":"build.impl.js","sourceRoot":"","sources":["../../../../../../packages/next/src/executors/build/build.impl.ts"],"names":[],"mappings":";;;AAAA,yBAAuB;AAEvB,2CAAoC;AACpC,+BAAqC;AACrC,uCAA2C;AAC3C,uEAA0E;AAC1E,yCAAsD;AACtD,6FAG4D;AAC5D,yCAA+C;AAE/C,+CAAmD;AACnD,mEAA8D;AAC9D,2EAAqE;AACrE,uDAA2D;AAE3D,qDAA+D;AAE/D,SAA8B,aAAa,CACzC,OAAgC,EAChC,OAAwB;;;QAExB,oCAAoC;QACpC,MAAC,OAAO,CAAC,GAAW,EAAC,QAAQ,QAAR,QAAQ,GAAK,YAAY,EAAC;QAC/C,MAAC,OAAO,CAAC,GAAW,EAAC,iBAAiB,QAAjB,iBAAiB,GAAK,MAAM,EAAC;QAElD,IAAI,YAAY,GAAoC,EAAE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|
"description": "Hide error messages containing server information.",
|
|
29
29
|
"default": false
|
|
30
30
|
},
|
|
31
|
+
"customServerTarget": {
|
|
32
|
+
"type": "string",
|
|
33
|
+
"description": "Target which builds the custom server."
|
|
34
|
+
},
|
|
31
35
|
"customServerPath": {
|
|
32
36
|
"type": "string",
|
|
33
|
-
"description": "Use a custom server script."
|
|
37
|
+
"description": "Use a custom server script. (Use `customServerTarget` instead)",
|
|
38
|
+
"x-deprecated": true
|
|
34
39
|
},
|
|
35
40
|
"hostname": {
|
|
36
41
|
"type": "string",
|
|
@@ -2,6 +2,6 @@ import 'dotenv/config';
|
|
|
2
2
|
import { ExecutorContext } from '@nrwl/devkit';
|
|
3
3
|
import { NextServeBuilderOptions } from '../../utils/types';
|
|
4
4
|
export default function serveExecutor(options: NextServeBuilderOptions, context: ExecutorContext): AsyncGenerator<{
|
|
5
|
-
baseUrl: string;
|
|
6
5
|
success: boolean;
|
|
6
|
+
baseUrl: string;
|
|
7
7
|
}, void, unknown>;
|
|
@@ -6,16 +6,12 @@ const devkit_1 = require("@nrwl/devkit");
|
|
|
6
6
|
const chalk = require("chalk");
|
|
7
7
|
const fs_1 = require("fs");
|
|
8
8
|
const path_1 = require("path");
|
|
9
|
-
const devkit_2 = require("@nrwl/devkit");
|
|
10
9
|
const buildable_libs_utils_1 = require("@nrwl/workspace/src/utilities/buildable-libs-utils");
|
|
11
|
-
const devkit_3 = require("@nrwl/devkit");
|
|
12
10
|
const config_1 = require("../../utils/config");
|
|
13
11
|
const custom_server_1 = require("./lib/custom-server");
|
|
14
12
|
const default_server_1 = require("./lib/default-server");
|
|
15
|
-
const buildable_libs_1 = require("../../utils/buildable-libs");
|
|
16
13
|
const constants_1 = require("../../utils/constants");
|
|
17
14
|
const infoPrefix = `[ ${chalk.dim(chalk.cyan('info'))} ] `;
|
|
18
|
-
const readyPrefix = `[ ${chalk.green('ready')} ]`;
|
|
19
15
|
function serveExecutor(options, context) {
|
|
20
16
|
return tslib_1.__asyncGenerator(this, arguments, function* serveExecutor_1() {
|
|
21
17
|
// Cast to any to overwrite NODE_ENV
|
|
@@ -24,19 +20,33 @@ function serveExecutor(options, context) {
|
|
|
24
20
|
: options.dev
|
|
25
21
|
? 'development'
|
|
26
22
|
: 'production';
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
const
|
|
30
|
-
const buildOptions = (0, devkit_1.readTargetOptions)(buildTarget, context);
|
|
23
|
+
// Setting port that the custom server should use.
|
|
24
|
+
process.env.PORT = options.port;
|
|
25
|
+
const buildOptions = (0, devkit_1.readTargetOptions)((0, devkit_1.parseTargetString)(options.buildTarget), context);
|
|
31
26
|
const root = (0, path_1.resolve)(context.root, buildOptions.root);
|
|
32
|
-
const
|
|
33
|
-
if (
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
(
|
|
27
|
+
const config = yield tslib_1.__await((0, config_1.prepareConfig)(options.dev ? constants_1.PHASE_DEVELOPMENT_SERVER : constants_1.PHASE_PRODUCTION_SERVER, buildOptions, context, getDependencies(options, context), (0, path_1.join)(context.root, (0, devkit_1.workspaceLayout)().libsDir)));
|
|
28
|
+
if (options.customServerTarget) {
|
|
29
|
+
yield tslib_1.__await(yield* tslib_1.__asyncDelegator(tslib_1.__asyncValues(runCustomServer(root, config, options, buildOptions, context))));
|
|
30
|
+
}
|
|
31
|
+
else {
|
|
32
|
+
yield tslib_1.__await(yield* tslib_1.__asyncDelegator(tslib_1.__asyncValues(runNextDevServer(root, config, options, buildOptions, context))));
|
|
38
33
|
}
|
|
39
|
-
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
exports.default = serveExecutor;
|
|
37
|
+
function getDependencies(options, context) {
|
|
38
|
+
if (options.buildLibsFromSource) {
|
|
39
|
+
return [];
|
|
40
|
+
}
|
|
41
|
+
else {
|
|
42
|
+
const result = (0, buildable_libs_utils_1.calculateProjectDependencies)((0, devkit_1.readCachedProjectGraph)(), context.root, context.projectName, 'build', // should be generalized
|
|
43
|
+
context.configurationName);
|
|
44
|
+
return result.dependencies;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
function runNextDevServer(root, config, options, buildOptions, context) {
|
|
48
|
+
return tslib_1.__asyncGenerator(this, arguments, function* runNextDevServer_1() {
|
|
49
|
+
const baseUrl = `http://${options.hostname || 'localhost'}:${options.port}`;
|
|
40
50
|
const settings = {
|
|
41
51
|
dev: options.dev,
|
|
42
52
|
dir: root,
|
|
@@ -44,8 +54,10 @@ function serveExecutor(options, context) {
|
|
|
44
54
|
quiet: options.quiet,
|
|
45
55
|
conf: config,
|
|
46
56
|
port: options.port,
|
|
47
|
-
|
|
57
|
+
customServer: !!options.customServerTarget,
|
|
48
58
|
hostname: options.hostname,
|
|
59
|
+
// TOOD(jack): Remove in Nx 15
|
|
60
|
+
path: options.customServerPath,
|
|
49
61
|
};
|
|
50
62
|
const server = options.customServerPath
|
|
51
63
|
? custom_server_1.customServer
|
|
@@ -61,7 +73,7 @@ function serveExecutor(options, context) {
|
|
|
61
73
|
}
|
|
62
74
|
try {
|
|
63
75
|
yield tslib_1.__await(server(settings, proxyConfig));
|
|
64
|
-
devkit_1.logger.info(
|
|
76
|
+
devkit_1.logger.info(`[ ${chalk.green('ready')} ] on ${baseUrl}`);
|
|
65
77
|
yield yield tslib_1.__await({
|
|
66
78
|
baseUrl,
|
|
67
79
|
success: true,
|
|
@@ -79,5 +91,35 @@ function serveExecutor(options, context) {
|
|
|
79
91
|
}
|
|
80
92
|
});
|
|
81
93
|
}
|
|
82
|
-
|
|
94
|
+
function runCustomServer(root, config, options, buildOptions, context) {
|
|
95
|
+
return tslib_1.__asyncGenerator(this, arguments, function* runCustomServer_1() {
|
|
96
|
+
var e_1, _a;
|
|
97
|
+
process.env.NX_NEXT_DIR = root;
|
|
98
|
+
process.env.NX_NEXT_PUBLIC_DIR = (0, path_1.join)(root, 'public');
|
|
99
|
+
const baseUrl = `http://${options.hostname || 'localhost'}:${options.port}`;
|
|
100
|
+
const customServerBuild = yield tslib_1.__await((0, devkit_1.runExecutor)((0, devkit_1.parseTargetString)(options.customServerTarget), {
|
|
101
|
+
watch: true,
|
|
102
|
+
}, context));
|
|
103
|
+
try {
|
|
104
|
+
for (var customServerBuild_1 = tslib_1.__asyncValues(customServerBuild), customServerBuild_1_1; customServerBuild_1_1 = yield tslib_1.__await(customServerBuild_1.next()), !customServerBuild_1_1.done;) {
|
|
105
|
+
const result = customServerBuild_1_1.value;
|
|
106
|
+
if (!result.success) {
|
|
107
|
+
return yield tslib_1.__await(result);
|
|
108
|
+
}
|
|
109
|
+
yield yield tslib_1.__await({
|
|
110
|
+
success: true,
|
|
111
|
+
baseUrl,
|
|
112
|
+
});
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
116
|
+
finally {
|
|
117
|
+
try {
|
|
118
|
+
if (customServerBuild_1_1 && !customServerBuild_1_1.done && (_a = customServerBuild_1.return)) yield tslib_1.__await(_a.call(customServerBuild_1));
|
|
119
|
+
}
|
|
120
|
+
finally { if (e_1) throw e_1.error; }
|
|
121
|
+
}
|
|
122
|
+
return yield tslib_1.__await({ success: true });
|
|
123
|
+
});
|
|
124
|
+
}
|
|
83
125
|
//# sourceMappingURL=server.impl.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server.impl.js","sourceRoot":"","sources":["../../../../../../packages/next/src/executors/server/server.impl.ts"],"names":[],"mappings":";;;AAAA,yBAAuB;AACvB,
|
|
1
|
+
{"version":3,"file":"server.impl.js","sourceRoot":"","sources":["../../../../../../packages/next/src/executors/server/server.impl.ts"],"names":[],"mappings":";;;AAAA,yBAAuB;AACvB,yCAQsB;AACtB,+BAA+B;AAC/B,2BAAgC;AAChC,+BAAqC;AACrC,6FAAkG;AAElG,+CAAmD;AAQnD,uDAAmD;AACnD,yDAAqD;AACrD,qDAG+B;AAE/B,MAAM,UAAU,GAAG,KAAK,KAAK,CAAC,GAAG,CAAC,KAAK,CAAC,IA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;SACZ,EACD,OAAO,CACR,CAAA,CAAC;;YAEF,KAA2B,IAAA,sBAAA,sBAAA,iBAAiB,CAAA,uBAAA;gBAAjC,MAAM,MAAM,8BAAA,CAAA;gBACrB,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE;oBACnB,6BAAO,MAAM,EAAC;iBACf;gBACD,4BAAM;oBACJ,OAAO,EAAE,IAAI;oBACb,OAAO;iBACR,CAAA,CAAC;aACH;;;;;;;;;QAED,6BAAO,EAAE,OAAO,EAAE,IAAI,EAAE,EAAC;IAC3B,CAAC;CAAA"}
|
|
@@ -1,10 +1,12 @@
|
|
|
1
|
+
//@ts-check
|
|
2
|
+
|
|
1
3
|
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
|
2
|
-
const withNx = require('@nrwl/next/plugins/with-nx');
|
|
4
|
+
const { withNx } = require('@nrwl/next/plugins/with-nx');
|
|
3
5
|
|
|
4
6
|
<% if (style === 'less') { %>
|
|
5
7
|
// This plugin is needed until this PR is merged.
|
|
6
8
|
// https://github.com/vercel/next.js/pull/23185
|
|
7
|
-
const withLess = require('@nrwl/next/plugins/with-less');
|
|
9
|
+
const { withLess } = require('@nrwl/next/plugins/with-less');
|
|
8
10
|
|
|
9
11
|
/**
|
|
10
12
|
* @type {import('@nrwl/next/plugins/with-nx').WithNxOptions}
|
|
@@ -15,14 +17,11 @@ const nextConfig = {
|
|
|
15
17
|
// See: https://github.com/gregberge/svgr
|
|
16
18
|
svgr: false,
|
|
17
19
|
},
|
|
18
|
-
// Set this to true if you use CSS modules.
|
|
19
|
-
// See: https://github.com/css-modules/css-modules
|
|
20
|
-
cssModules: false,
|
|
21
20
|
};
|
|
22
21
|
|
|
23
22
|
module.exports = withLess(withNx(nextConfig));
|
|
24
23
|
<% } else if (style === 'styl') { %>
|
|
25
|
-
const withStylus = require('@nrwl/next/plugins/with-stylus');
|
|
24
|
+
const { withStylus } = require('@nrwl/next/plugins/with-stylus');
|
|
26
25
|
|
|
27
26
|
/**
|
|
28
27
|
* @type {import('@nrwl/next/plugins/with-nx').WithNxOptions}
|
|
@@ -33,9 +32,6 @@ const nextConfig = {
|
|
|
33
32
|
// See: https://github.com/gregberge/svgr
|
|
34
33
|
svgr: false,
|
|
35
34
|
},
|
|
36
|
-
// Set this to true if you use CSS modules.
|
|
37
|
-
// See: https://github.com/css-modules/css-modules
|
|
38
|
-
cssModules: false,
|
|
39
35
|
};
|
|
40
36
|
|
|
41
37
|
module.exports = withStylus(withNx(nextConfig));
|
|
@@ -1,27 +1,28 @@
|
|
|
1
1
|
/* eslint-disable react/display-name */
|
|
2
|
-
import {
|
|
3
|
-
import Document, { Html, Head, Main, NextScript } from 'next/document';
|
|
2
|
+
import Document, { Html, Head, Main, NextScript, DocumentContext, DocumentInitialProps } from 'next/document';
|
|
4
3
|
import { ServerStyleSheet } from 'styled-components';
|
|
5
4
|
|
|
6
|
-
export default class CustomDocument extends Document
|
|
7
|
-
static getInitialProps(
|
|
8
|
-
|
|
5
|
+
export default class CustomDocument extends Document {
|
|
6
|
+
static async getInitialProps(ctx: DocumentContext): Promise<DocumentInitialProps> {
|
|
7
|
+
const originalRenderPage = ctx.renderPage;
|
|
9
8
|
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
9
|
+
const sheet = new ServerStyleSheet();
|
|
10
|
+
|
|
11
|
+
ctx.renderPage = () => originalRenderPage({
|
|
12
|
+
enhanceApp: (App) => (props) => sheet.collectStyles(<App {...props} />),
|
|
13
|
+
enhanceComponent: (Component) => Component,
|
|
14
|
+
});
|
|
13
15
|
|
|
14
|
-
|
|
16
|
+
const intialProps = await Document.getInitialProps(ctx);
|
|
17
|
+
const styles = sheet.getStyleElement();
|
|
15
18
|
|
|
16
|
-
|
|
19
|
+
return {...intialProps, styles };
|
|
17
20
|
}
|
|
18
21
|
|
|
19
22
|
render() {
|
|
20
23
|
return (
|
|
21
24
|
<Html>
|
|
22
|
-
<Head>
|
|
23
|
-
{this.props.styleTags}
|
|
24
|
-
</Head>
|
|
25
|
+
<Head>{this.props.styles}</Head>
|
|
25
26
|
<body>
|
|
26
27
|
<Main />
|
|
27
28
|
<NextScript />
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"add-project.js","sourceRoot":"","sources":["../../../../../../../packages/next/src/generators/application/lib/add-project.ts"],"names":[],"mappings":";;;AACA,yCAKsB;AAEtB,SAAgB,UAAU,CAAC,IAAU,EAAE,OAAyB;IAC9D,MAAM,OAAO,GAAwB,EAAE,CAAC;IAExC,OAAO,CAAC,KAAK,GAAG;QACd,OAAO,EAAE,kBAAkB;QAC3B,OAAO,EAAE,CAAC,sBAAsB,CAAC;QACjC,oBAAoB,EAAE,YAAY;QAClC,OAAO,EAAE;YACP,IAAI,EAAE,OAAO,CAAC,cAAc;YAC5B,UAAU,EAAE,IAAA,0BAAiB,EAAC,MAAM,EAAE,OAAO,CAAC,cAAc,CAAC;SAC9D;QACD,cAAc,EAAE;YACd,WAAW,EAAE;gBACX,UAAU,EAAE,
|
|
1
|
+
{"version":3,"file":"add-project.js","sourceRoot":"","sources":["../../../../../../../packages/next/src/generators/application/lib/add-project.ts"],"names":[],"mappings":";;;AACA,yCAKsB;AAEtB,SAAgB,UAAU,CAAC,IAAU,EAAE,OAAyB;IAC9D,MAAM,OAAO,GAAwB,EAAE,CAAC;IAExC,OAAO,CAAC,KAAK,GAAG;QACd,OAAO,EAAE,kBAAkB;QAC3B,OAAO,EAAE,CAAC,sBAAsB,CAAC;QACjC,oBAAoB,EAAE,YAAY;QAClC,OAAO,EAAE;YACP,IAAI,EAAE,OAAO,CAAC,cAAc;YAC5B,UAAU,EAAE,IAAA,0BAAiB,EAAC,MAAM,EAAE,OAAO,CAAC,cAAc,CAAC;SAC9D;QACD,cAAc,EAAE;YACd,WAAW,EAAE;gBACX,UAAU,EAAE,OAAO,CAAC,cAAc;aACnC;YACD,UAAU,EAAE,EAAE;SACf;KACF,CAAC;IAEF,OAAO,CAAC,KAAK,GAAG;QACd,OAAO,EAAE,mBAAmB;QAC5B,oBAAoB,EAAE,aAAa;QACnC,OAAO,EAAE;YACP,WAAW,EAAE,GAAG,OAAO,CAAC,WAAW,QAAQ;YAC3C,GAAG,EAAE,IAAI;SACV;QACD,cAAc,EAAE;YACd,WAAW,EAAE;gBACX,WAAW,EAAE,GAAG,OAAO,CAAC,WAAW,oBAAoB;gBACvD,GAAG,EAAE,IAAI;aACV;YACD,UAAU,EAAE;gBACV,WAAW,EAAE,GAAG,OAAO,CAAC,WAAW,mBAAmB;gBACtD,GAAG,EAAE,KAAK;aACX;SACF;KACF,CAAC;IAEF,IAAI,OAAO,CAAC,MAAM,EAAE;QAClB,OAAO,CAAC,KAAK,CAAC,OAAO,mCAChB,OAAO,CAAC,KAAK,CAAC,OAAO,KACxB,gBAAgB,EAAE,OAAO,CAAC,MAAM,GACjC,CAAC;KACH;IAED,OAAO,CAAC,MAAM,GAAG;QACf,OAAO,EAAE,mBAAmB;QAC5B,OAAO,EAAE;YACP,WAAW,EAAE,GAAG,OAAO,CAAC,WAAW,mBAAmB;SACvD;KACF,CAAC;IAEF,MAAM,OAAO,GAAyB;QACpC,IAAI,EAAE,OAAO,CAAC,cAAc;QAC5B,UAAU,EAAE,OAAO,CAAC,cAAc;QAClC,WAAW,EAAE,aAAa;QAC1B,OAAO;QACP,IAAI,EAAE,OAAO,CAAC,UAAU;KACzB,CAAC;IAEF,IAAA,gCAAuB,EACrB,IAAI,EACJ,OAAO,CAAC,WAAW,oBAEd,OAAO,GAEZ,OAAO,CAAC,gBAAgB,CACzB,CAAC;AACJ,CAAC;AApED,gCAoEC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { Tree } from '@nrwl/devkit';
|
|
2
|
+
import { CustomServerSchema } from './schema';
|
|
3
|
+
export declare function customServerGenerator(host: Tree, options: CustomServerSchema): Promise<void>;
|
|
4
|
+
export declare const customServerSchematic: (generatorOptions: CustomServerSchema) => (tree: any, context: any) => Promise<any>;
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.customServerSchematic = exports.customServerGenerator = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const devkit_1 = require("@nrwl/devkit");
|
|
6
|
+
function customServerGenerator(host, options) {
|
|
7
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r;
|
|
8
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
9
|
+
const project = (0, devkit_1.readProjectConfiguration)(host, options.project);
|
|
10
|
+
if (((_b = (_a = project.targets) === null || _a === void 0 ? void 0 : _a.build) === null || _b === void 0 ? void 0 : _b.executor) !== '@nrwl/next:build') {
|
|
11
|
+
devkit_1.logger.error(`Project ${options.project} is not a Next.js project. Did you generate it with "nx g @nrwl/next:app"?`);
|
|
12
|
+
return;
|
|
13
|
+
}
|
|
14
|
+
const outputPath = (_e = (_d = (_c = project.targets) === null || _c === void 0 ? void 0 : _c.build) === null || _d === void 0 ? void 0 : _d.options) === null || _e === void 0 ? void 0 : _e.outputPath;
|
|
15
|
+
const root = (_h = (_g = (_f = project.targets) === null || _f === void 0 ? void 0 : _f.build) === null || _g === void 0 ? void 0 : _g.options) === null || _h === void 0 ? void 0 : _h.root;
|
|
16
|
+
if (!root ||
|
|
17
|
+
!outputPath ||
|
|
18
|
+
!((_l = (_k = (_j = project.targets) === null || _j === void 0 ? void 0 : _j.build) === null || _k === void 0 ? void 0 : _k.configurations) === null || _l === void 0 ? void 0 : _l.development) ||
|
|
19
|
+
!((_p = (_o = (_m = project.targets) === null || _m === void 0 ? void 0 : _m.build) === null || _o === void 0 ? void 0 : _o.configurations) === null || _p === void 0 ? void 0 : _p.production)) {
|
|
20
|
+
devkit_1.logger.error(`Project ${options.project} has invalid config. Did you generate it with "nx g @nrwl/next:app"?`);
|
|
21
|
+
return;
|
|
22
|
+
}
|
|
23
|
+
if (((_q = project.targets) === null || _q === void 0 ? void 0 : _q['build-custom-server']) ||
|
|
24
|
+
((_r = project.targets) === null || _r === void 0 ? void 0 : _r['serve-custom-server'])) {
|
|
25
|
+
devkit_1.logger.warn(`Project ${options.project} has custom server targets already: build-custom-server, serve-custom-server. Remove these targets from project and try again.`);
|
|
26
|
+
return;
|
|
27
|
+
}
|
|
28
|
+
(0, devkit_1.generateFiles)(host, (0, devkit_1.joinPathFragments)(__dirname, 'files'), project.root, Object.assign(Object.assign({}, options), { offsetFromRoot: (0, devkit_1.offsetFromRoot)(project.root), projectRoot: project.root, tmpl: '' }));
|
|
29
|
+
project.targets.build.dependsOn = ['build-custom-server'];
|
|
30
|
+
project.targets.serve.options.customServerTarget = `${options.project}:serve-custom-server`;
|
|
31
|
+
project.targets.serve.configurations.development.customServerTarget = `${options.project}:serve-custom-server:development`;
|
|
32
|
+
project.targets.serve.configurations.production.customServerTarget = `${options.project}:serve-custom-server:production`;
|
|
33
|
+
project.targets['build-custom-server'] = {
|
|
34
|
+
executor: '@nrwl/js:tsc',
|
|
35
|
+
defaultConfiguration: 'production',
|
|
36
|
+
options: {
|
|
37
|
+
outputPath,
|
|
38
|
+
main: `${root}/server/main.ts`,
|
|
39
|
+
tsConfig: `${root}/tsconfig.server.json`,
|
|
40
|
+
clean: false,
|
|
41
|
+
assets: [],
|
|
42
|
+
},
|
|
43
|
+
configurations: {
|
|
44
|
+
development: {},
|
|
45
|
+
production: {},
|
|
46
|
+
},
|
|
47
|
+
};
|
|
48
|
+
project.targets['serve-custom-server'] = {
|
|
49
|
+
executor: '@nrwl/js:node',
|
|
50
|
+
defaultConfiguration: 'development',
|
|
51
|
+
options: {
|
|
52
|
+
buildTarget: `${options.project}:build-custom-server`,
|
|
53
|
+
},
|
|
54
|
+
configurations: {
|
|
55
|
+
development: {
|
|
56
|
+
buildTarget: `${options.project}:build-custom-server:development`,
|
|
57
|
+
},
|
|
58
|
+
production: {
|
|
59
|
+
buildTarget: `${options.project}:build-custom-server:production`,
|
|
60
|
+
},
|
|
61
|
+
},
|
|
62
|
+
};
|
|
63
|
+
(0, devkit_1.updateProjectConfiguration)(host, options.project, project);
|
|
64
|
+
(0, devkit_1.updateJson)(host, 'nx.json', (json) => {
|
|
65
|
+
var _a, _b;
|
|
66
|
+
var _c;
|
|
67
|
+
(_a = json.tasksRunnerOptions) !== null && _a !== void 0 ? _a : (json.tasksRunnerOptions = {});
|
|
68
|
+
(_b = (_c = json.tasksRunnerOptions).default) !== null && _b !== void 0 ? _b : (_c.default = { options: {} });
|
|
69
|
+
json.tasksRunnerOptions.default.options.cacheableOperations = [
|
|
70
|
+
...json.tasksRunnerOptions.default.options.cacheableOperations,
|
|
71
|
+
'build-custom-server',
|
|
72
|
+
];
|
|
73
|
+
return json;
|
|
74
|
+
});
|
|
75
|
+
});
|
|
76
|
+
}
|
|
77
|
+
exports.customServerGenerator = customServerGenerator;
|
|
78
|
+
exports.customServerSchematic = (0, devkit_1.convertNxGenerator)(customServerGenerator);
|
|
79
|
+
//# sourceMappingURL=custom-server.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"custom-server.js","sourceRoot":"","sources":["../../../../../../packages/next/src/generators/custom-server/custom-server.ts"],"names":[],"mappings":";;;;AACA,yCASsB;AAGtB,SAAsB,qBAAqB,CACzC,IAAU,EACV,OAA2B;;;QAE3B,MAAM,OAAO,GAAG,IAAA,iCAAwB,EAAC,IAAI,EAAE,OAAO,CAAC,OAAO,CAAC,CAAC;QAEhE,IAAI,CAAA,MAAA,MAAA,OAAO,CAAC,OAAO,0CAAE,KAAK,0CAAE,QAAQ,MAAK,kBAAkB,EAAE;YAC3D,eAAM,CAAC,KAAK,CACV,WAAW,OAAO,CAAC,OAAO,4EAA4E,CACvG,CAAC;YACF,OAAO;SACR;QAED,MAAM,UAAU,GAAG,MAAA,MAAA,MAAA,OAAO,CAAC,OAAO,0CAAE,KAAK,0CAAE,OAAO,0CAAE,UAAU,CAAC;QAC/D,MAAM,IAAI,GAAG,MAAA,M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AAO,CAAC,OAAO,CAAC,mBAAmB;gBAC9D,qBAAqB;aACtB,CAAC;YACF,OAAO,IAAI,CAAC;QACd,CAAC,CAAC,CAAC;;CACJ;AA7FD,sDA6FC;AAEY,QAAA,qBAAqB,GAAG,IAAA,2BAAkB,EAAC,qBAAqB,CAAC,CAAC"}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* This is only a minimal custom server to get started.
|
|
3
|
+
* You should customize this server with CORS and other security features.
|
|
4
|
+
*/
|
|
5
|
+
import express from 'express';
|
|
6
|
+
import * as path from 'path';
|
|
7
|
+
import next from 'next';
|
|
8
|
+
|
|
9
|
+
// Next.js server options:
|
|
10
|
+
// - The environment variable is set by `@nrwl/next:server` when running the dev server.
|
|
11
|
+
// - The fallback `__dirname` is for production builds.
|
|
12
|
+
// - Feel free to change this to suit your needs.
|
|
13
|
+
const dir = process.env.NX_NEXT_DIR || path.join(__dirname, '..');
|
|
14
|
+
const publicDir = process.env.NX_NEXT_PUBLIC_DIR || path.join(__dirname, '../public');
|
|
15
|
+
const dev = process.env.NODE_ENV === 'development';
|
|
16
|
+
|
|
17
|
+
// Express server options:
|
|
18
|
+
// - Feel free to change this to suit your needs.
|
|
19
|
+
const hostname = process.env.HOST || 'localhost';
|
|
20
|
+
const port = process.env.PORT ? parseInt(process.env.PORT) : 4200;
|
|
21
|
+
|
|
22
|
+
async function main() {
|
|
23
|
+
const nextApp = next({ dev, dir });
|
|
24
|
+
const handle = nextApp.getRequestHandler();
|
|
25
|
+
|
|
26
|
+
await nextApp.prepare();
|
|
27
|
+
|
|
28
|
+
const expressApp = express();
|
|
29
|
+
|
|
30
|
+
expressApp.get('/api', (req, res) => {
|
|
31
|
+
res.send({ message: 'Welcome!' });
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
// Serve static files from public folder.
|
|
35
|
+
expressApp.use(express.static(publicDir));
|
|
36
|
+
|
|
37
|
+
// Redirect requests to Next.js app.
|
|
38
|
+
expressApp.all('*', (req, res) => {
|
|
39
|
+
console.log('Forwarding request to Next.js: ', req.url);
|
|
40
|
+
handle(req, res)
|
|
41
|
+
});
|
|
42
|
+
|
|
43
|
+
return new Promise<void>((resolve, reject) => {
|
|
44
|
+
expressApp.on('error', (err) => reject(err));
|
|
45
|
+
expressApp.listen(port, () => {
|
|
46
|
+
console.log(`[ ready ] on http://${hostname}:${port}`)
|
|
47
|
+
resolve();
|
|
48
|
+
});
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
main().catch((err) => {
|
|
53
|
+
console.error(err);
|
|
54
|
+
process.exit(1);
|
|
55
|
+
});
|
|
56
|
+
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
{
|
|
2
|
+
"extends": "./tsconfig.json",
|
|
3
|
+
"compilerOptions": {
|
|
4
|
+
"module": "commonjs",
|
|
5
|
+
"noEmit": false,
|
|
6
|
+
"incremental": true,
|
|
7
|
+
"tsBuildInfoFile": "<%= offsetFromRoot %>/tmp/buildcache/<%= projectRoot %>/server",
|
|
8
|
+
"types": [
|
|
9
|
+
"node"
|
|
10
|
+
]
|
|
11
|
+
},
|
|
12
|
+
"include": [
|
|
13
|
+
"server/**/*.ts"
|
|
14
|
+
]
|
|
15
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "http://json-schema.org/schema",
|
|
3
|
+
"cli": "nx",
|
|
4
|
+
"$id": "NxNextCustomServer",
|
|
5
|
+
"title": "Add custom server",
|
|
6
|
+
"description": "Add a custom server to existing Next.js application.",
|
|
7
|
+
"examples": [
|
|
8
|
+
{
|
|
9
|
+
"command": "nx g custom-server my-app",
|
|
10
|
+
"description": "Add a custom server to existing Next.js app."
|
|
11
|
+
}
|
|
12
|
+
],
|
|
13
|
+
"type": "object",
|
|
14
|
+
"properties": {
|
|
15
|
+
"project": {
|
|
16
|
+
"type": "string",
|
|
17
|
+
"description": "The name of the project.",
|
|
18
|
+
"alias": "p",
|
|
19
|
+
"$default": {
|
|
20
|
+
"$source": "argv",
|
|
21
|
+
"index": 0
|
|
22
|
+
},
|
|
23
|
+
"x-dropdown": "project",
|
|
24
|
+
"x-prompt": "What is the name of the project to set up a custom server for?"
|
|
25
|
+
},
|
|
26
|
+
"compiler": {
|
|
27
|
+
"type": "string",
|
|
28
|
+
"enum": ["tsc", "swc"],
|
|
29
|
+
"default": "tsc",
|
|
30
|
+
"description": "The compiler used to build the custom server."
|
|
31
|
+
}
|
|
32
|
+
},
|
|
33
|
+
"required": ["project"]
|
|
34
|
+
}
|
|
@@ -8,6 +8,7 @@ const jest_1 = require("@nrwl/jest");
|
|
|
8
8
|
const cypress_1 = require("@nrwl/cypress");
|
|
9
9
|
const react_1 = require("@nrwl/react");
|
|
10
10
|
const versions_1 = require("../../utils/versions");
|
|
11
|
+
const add_gitignore_entry_1 = require("../../utils/add-gitignore-entry");
|
|
11
12
|
function updateDependencies(host) {
|
|
12
13
|
return (0, devkit_1.addDependenciesToPackageJson)(host, {
|
|
13
14
|
'@nrwl/next': versions_1.nxVersion,
|
|
@@ -34,6 +35,7 @@ function nextInitGenerator(host, schema) {
|
|
|
34
35
|
tasks.push(reactTask);
|
|
35
36
|
const installTask = updateDependencies(host);
|
|
36
37
|
tasks.push(installTask);
|
|
38
|
+
(0, add_gitignore_entry_1.addGitIgnoreEntry)(host);
|
|
37
39
|
return (0, run_tasks_in_serial_1.runTasksInSerial)(...tasks);
|
|
38
40
|
});
|
|
39
41
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"init.js","sourceRoot":"","sources":["../../../../../../packages/next/src/generators/init/init.ts"],"names":[],"mappings":";;;;AAAA,
|
|
1
|
+
{"version":3,"file":"init.js","sourceRoot":"","sources":["../../../../../../packages/next/src/generators/init/init.ts"],"names":[],"mappings":";;;;AAAA,yCAKsB;AACtB,2FAAqF;AACrF,qCAA+C;AAC/C,2CAAqD;AACrD,uCAAgF;AAEhF,mDAK8B;AAE9B,yE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CAAC,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.update = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const devkit_1 = require("@nrwl/devkit");
|
|
6
|
+
const add_gitignore_entry_1 = require("../../utils/add-gitignore-entry");
|
|
7
|
+
function update(tree) {
|
|
8
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
9
|
+
(0, add_gitignore_entry_1.addGitIgnoreEntry)(tree);
|
|
10
|
+
yield (0, devkit_1.formatFiles)(tree);
|
|
11
|
+
});
|
|
12
|
+
}
|
|
13
|
+
exports.update = update;
|
|
14
|
+
exports.default = update;
|
|
15
|
+
//# sourceMappingURL=add-gitignore-entry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"add-gitignore-entry.js","sourceRoot":"","sources":["../../../../../../packages/next/src/migrations/update-14-5-3/add-gitignore-entry.ts"],"names":[],"mappings":";;;;AAAA,yCAAiD;AACjD,yEAAoE;AAEpE,SAAsB,MAAM,CAAC,IAAU;;QACrC,IAAA,uCAAiB,EAAC,IAAI,CAAC,CAAC;QACxB,MAAM,IAAA,oBAAW,EAAC,IAAI,CAAC,CAAC;IAC1B,CAAC;CAAA;AAHD,wBAGC;AAED,kBAAe,MAAM,CAAC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.update = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const devkit_1 = require("@nrwl/devkit");
|
|
6
|
+
function update(tree) {
|
|
7
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
8
|
+
const projects = (0, devkit_1.getProjects)(tree);
|
|
9
|
+
projects.forEach((config, name) => {
|
|
10
|
+
var _a, _b, _c, _d;
|
|
11
|
+
var _e, _f;
|
|
12
|
+
if (((_b = (_a = config.targets) === null || _a === void 0 ? void 0 : _a.build) === null || _b === void 0 ? void 0 : _b.executor) === '@nrwl/next:build') {
|
|
13
|
+
(_c = (_e = config.targets.build).configurations) !== null && _c !== void 0 ? _c : (_e.configurations = {});
|
|
14
|
+
(_d = (_f = config.targets.build.configurations).development) !== null && _d !== void 0 ? _d : (_f.development = {});
|
|
15
|
+
if (!config.targets.build.configurations.development.outputPath ||
|
|
16
|
+
config.targets.build.configurations.development.outputPath ===
|
|
17
|
+
(0, devkit_1.joinPathFragments)('tmp', config.root)) {
|
|
18
|
+
config.targets.build.configurations.development.outputPath =
|
|
19
|
+
config.root;
|
|
20
|
+
(0, devkit_1.updateProjectConfiguration)(tree, name, config);
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
});
|
|
24
|
+
yield (0, devkit_1.formatFiles)(tree);
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
exports.update = update;
|
|
28
|
+
exports.default = update;
|
|
29
|
+
//# sourceMappingURL=update-dev-output-path.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"update-dev-output-path.js","sourceRoot":"","sources":["../../../../../../packages/next/src/migrations/update-14-5-3/update-dev-output-path.ts"],"names":[],"mappings":";;;;AAAA,yCAMsB;AAEtB,SAAsB,MAAM,CAAC,IAAU;;QACrC,MAAM,QAAQ,GAAG,IAAA,oBAAW,EAAC,IAAI,CAAC,CAAC;QAEnC,QAAQ,CAAC,OAAO,CAAC,CAAC,MAAM,EAAE,IAAI,EAAE,EAAE;;;YAChC,IAAI,CAAA,MAAA,MAAA,MAAM,CAAC,OAAO,0CAAE,KAAK,0CAAE,QAAQ,MAAK,kBAAkB,EAAE;gBAC1D,YAAA,MAAM,CAAC,OAAO,CAAC,KAAK,EAAC,cAAc,uCAAd,cAAc,GAAK,EAAE,EAAC;gBAC3C,YAAA,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,cAAc,EAAC,WAAW,uCAAX,WAAW,GAAK,EAAE,EAAC;gBACvD,IACE,CAAC,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,cAAc,CAAC,WAAW,CAAC,UAAU;oBAC3D,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,cAAc,CAAC,WAAW,CAAC,UAAU;wBACxD,IAAA,0BAAiB,EAAC,KAAK,EAAE,MAAM,CAAC,IAAI,CAAC,EACvC;oBACA,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,cAAc,CAAC,WAAW,CAAC,UAAU;wBACxD,MAAM,CAAC,IAAI,CAAC;oBACd,IAAA,mCAA0B,EAAC,IAAI,EAAE,IAAI,EAAE,MAAM,CAAC,CAAC;iBAChD;aACF;QACH,CAAC,CAAC,CAAC;QAEH,MAAM,IAAA,oBAAW,EAAC,IAAI,CAAC,CAAC;IAC1B,CAAC;CAAA;AApBD,wBAoBC;AAED,kBAAe,MAAM,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.addGitIgnoreEntry = void 0;
|
|
4
|
+
const ignore_1 = require("ignore");
|
|
5
|
+
function addGitIgnoreEntry(host) {
|
|
6
|
+
if (!host.exists('.gitignore')) {
|
|
7
|
+
return;
|
|
8
|
+
}
|
|
9
|
+
let content = host.read('.gitignore', 'utf-8').trimEnd();
|
|
10
|
+
const ig = (0, ignore_1.default)();
|
|
11
|
+
ig.add(host.read('.gitignore', 'utf-8'));
|
|
12
|
+
if (!ig.ignores('apps/example/.next')) {
|
|
13
|
+
content = `${content}\n\n# Next.js\n.next\n`;
|
|
14
|
+
}
|
|
15
|
+
host.write('.gitignore', content);
|
|
16
|
+
}
|
|
17
|
+
exports.addGitIgnoreEntry = addGitIgnoreEntry;
|
|
18
|
+
//# sourceMappingURL=add-gitignore-entry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"add-gitignore-entry.js","sourceRoot":"","sources":["../../../../../packages/next/src/utils/add-gitignore-entry.ts"],"names":[],"mappings":";;;AACA,mCAA4B;AAE5B,SAAgB,iBAAiB,CAAC,IAAU;IAC1C,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,YAAY,CAAC,EAAE;QAC9B,OAAO;KACR;IAED,IAAI,OAAO,GAAG,IAAI,CAAC,IAAI,CAAC,YAAY,EAAE,OAAO,CAAC,CAAC,OAAO,EAAE,CAAC;IAEzD,MAAM,EAAE,GAAG,IAAA,gBAAM,GAAE,CAAC;IACpB,EAAE,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,YAAY,EAAE,OAAO,CAAC,CAAC,CAAC;IAEzC,IAAI,CAAC,EAAE,CAAC,OAAO,CAAC,oBAAoB,CAAC,EAAE;QACrC,OAAO,GAAG,GAAG,OAAO,wBAAwB,CAAC;KAC9C;IAED,IAAI,CAAC,KAAK,CAAC,YAAY,EAAE,OAAO,CAAC,CAAC;AACpC,CAAC;AAfD,8CAeC"}
|
package/src/utils/types.d.ts
CHANGED
|
@@ -16,6 +16,7 @@ export interface NextServerOptions {
|
|
|
16
16
|
port: number;
|
|
17
17
|
path: string;
|
|
18
18
|
hostname: string;
|
|
19
|
+
customServer?: boolean;
|
|
19
20
|
}
|
|
20
21
|
export interface FileReplacement {
|
|
21
22
|
replace: string;
|
|
@@ -28,6 +29,7 @@ export interface NextBuildBuilderOptions {
|
|
|
28
29
|
assets?: any[];
|
|
29
30
|
nextConfig?: string;
|
|
30
31
|
buildLibsFromSource?: boolean;
|
|
32
|
+
watch?: boolean;
|
|
31
33
|
}
|
|
32
34
|
export interface NextServeBuilderOptions {
|
|
33
35
|
dev: boolean;
|
|
@@ -35,6 +37,9 @@ export interface NextServeBuilderOptions {
|
|
|
35
37
|
staticMarkup: boolean;
|
|
36
38
|
quiet: boolean;
|
|
37
39
|
buildTarget: string;
|
|
40
|
+
customServerTarget?: string;
|
|
41
|
+
/** @deprecated Use customServerTarget
|
|
42
|
+
*/
|
|
38
43
|
customServerPath?: string;
|
|
39
44
|
hostname?: string;
|
|
40
45
|
proxyConfig?: string;
|
package/src/utils/versions.d.ts
CHANGED
|
@@ -4,6 +4,6 @@ export declare const eslintConfigNextVersion = "12.2.3";
|
|
|
4
4
|
export declare const sassVersion = "1.54.0";
|
|
5
5
|
export declare const lessLoader = "11.0.0";
|
|
6
6
|
export declare const stylusLoader = "7.0.0";
|
|
7
|
-
export declare const emotionServerVersion = "11.
|
|
7
|
+
export declare const emotionServerVersion = "11.10.0";
|
|
8
8
|
export declare const babelPluginStyledComponentsVersion = "1.10.7";
|
|
9
9
|
export declare const tsLibVersion = "^2.3.0";
|
package/src/utils/versions.js
CHANGED
|
@@ -7,7 +7,7 @@ exports.eslintConfigNextVersion = '12.2.3';
|
|
|
7
7
|
exports.sassVersion = '1.54.0';
|
|
8
8
|
exports.lessLoader = '11.0.0';
|
|
9
9
|
exports.stylusLoader = '7.0.0';
|
|
10
|
-
exports.emotionServerVersion = '11.
|
|
10
|
+
exports.emotionServerVersion = '11.10.0';
|
|
11
11
|
exports.babelPluginStyledComponentsVersion = '1.10.7';
|
|
12
12
|
exports.tsLibVersion = '^2.3.0';
|
|
13
13
|
//# sourceMappingURL=versions.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"versions.js","sourceRoot":"","sources":["../../../../../packages/next/src/utils/versions.ts"],"names":[],"mappings":";;;AAAa,QAAA,SAAS,GAAG,OAAO,CAAC,oBAAoB,CAAC,CAAC,OAAO,CAAC;AAElD,QAAA,WAAW,GAAG,QAAQ,CAAC;AACvB,QAAA,uBAAuB,GAAG,QAAQ,CAAC;AACnC,QAAA,WAAW,GAAG,QAAQ,CAAC;AACvB,QAAA,UAAU,GAAG,QAAQ,CAAC;AACtB,QAAA,YAAY,GAAG,OAAO,CAAC;AACvB,QAAA,oBAAoB,GAAG,
|
|
1
|
+
{"version":3,"file":"versions.js","sourceRoot":"","sources":["../../../../../packages/next/src/utils/versions.ts"],"names":[],"mappings":";;;AAAa,QAAA,SAAS,GAAG,OAAO,CAAC,oBAAoB,CAAC,CAAC,OAAO,CAAC;AAElD,QAAA,WAAW,GAAG,QAAQ,CAAC;AACvB,QAAA,uBAAuB,GAAG,QAAQ,CAAC;AACnC,QAAA,WAAW,GAAG,QAAQ,CAAC;AACvB,QAAA,UAAU,GAAG,QAAQ,CAAC;AACtB,QAAA,YAAY,GAAG,OAAO,CAAC;AACvB,QAAA,oBAAoB,GAAG,SAAS,CAAC;AACjC,QAAA,kCAAkC,GAAG,QAAQ,CAAC;AAC9C,QAAA,YAAY,GAAG,QAAQ,CAAC"}
|