gdu 4.1.2 → 4.1.3
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/commands/build/buildSSR.js +5 -0
- package/dist/config/babel.config.d.ts +1 -0
- package/dist/config/babel.config.js +2 -0
- package/dist/config/next.config.d.ts +10 -3
- package/dist/config/next.config.js +14 -4
- package/dist/config/webpack/webpack.config.js +17 -17
- package/dist/lib/config.d.ts +1 -0
- package/dist/lib/config.js +3 -1
- package/package.json +1 -1
|
@@ -17,6 +17,11 @@ const buildSSR = async (guruConfig) => {
|
|
|
17
17
|
stdio: 'inherit',
|
|
18
18
|
cwd: roots_1.PROJECT_ROOT,
|
|
19
19
|
localDir: roots_1.GDU_ROOT,
|
|
20
|
+
extendEnv: true,
|
|
21
|
+
env: {
|
|
22
|
+
NODE_ENV: 'production',
|
|
23
|
+
APP_ENV: process.env.APP_ENV || 'prod',
|
|
24
|
+
},
|
|
20
25
|
})
|
|
21
26
|
.then((result) => {
|
|
22
27
|
console.log(`${kleur_1.dim('SUCCESS!')}`, `${kleur_1.dim('Listening')}: ${kleur_1.blue(result === null || result === void 0 ? void 0 : result.all)}`);
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
const { join } = require('path');
|
|
3
3
|
const browsers = require('browserslist-config-autoguru');
|
|
4
|
+
const { PROJECT_ROOT } = require('../lib/roots');
|
|
4
5
|
module.exports = (guruConfig) => {
|
|
5
6
|
let hasRelay = false;
|
|
6
7
|
try {
|
|
@@ -40,6 +41,7 @@ module.exports = (guruConfig) => {
|
|
|
40
41
|
haste: false,
|
|
41
42
|
isDevVariable: '__DEV__',
|
|
42
43
|
eagerESModules: true,
|
|
44
|
+
artifactDirectory: join(PROJECT_ROOT, '../../', 'packages', 'relay', '__generated__'),
|
|
43
45
|
},
|
|
44
46
|
],
|
|
45
47
|
require.resolve('babel-plugin-treat'),
|
|
@@ -6,9 +6,16 @@ export declare const defaultSecurityHeaders: {
|
|
|
6
6
|
export declare const createNextJSConfig: (buildEnv: any) => {
|
|
7
7
|
distDir: string;
|
|
8
8
|
reactStrictMode: boolean;
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
9
|
+
swcMinify: boolean;
|
|
10
|
+
assetPrefix: string;
|
|
11
|
+
i18n: {
|
|
12
|
+
locales: string[];
|
|
13
|
+
defaultLocale: string;
|
|
14
|
+
};
|
|
15
|
+
typescript: {
|
|
16
|
+
transpileOnly: boolean;
|
|
17
|
+
ignoreDevErrors: boolean;
|
|
18
|
+
ignoreBuildErrors: boolean;
|
|
12
19
|
};
|
|
13
20
|
images: {
|
|
14
21
|
formats: string[];
|
|
@@ -28,6 +28,7 @@ const next_plugin_1 = require("@vanilla-extract/next-plugin");
|
|
|
28
28
|
const dotenv_webpack_1 = __importDefault(require("dotenv-webpack"));
|
|
29
29
|
const next_transpile_modules_1 = __importDefault(require("next-transpile-modules"));
|
|
30
30
|
const webpack_1 = require("webpack");
|
|
31
|
+
const config_1 = require("../lib/config");
|
|
31
32
|
const misc_1 = require("../lib/misc");
|
|
32
33
|
const roots_1 = require("../lib/roots");
|
|
33
34
|
const configs_1 = require("../utils/configs");
|
|
@@ -101,14 +102,23 @@ exports.defaultSecurityHeaders = [
|
|
|
101
102
|
},
|
|
102
103
|
];
|
|
103
104
|
const createNextJSConfig = (buildEnv) => {
|
|
105
|
+
var _a, _b;
|
|
104
106
|
const isDev = !misc_1.isEnvProduction();
|
|
105
107
|
const env = process.env.APP_ENV || (isDev ? 'dev' : buildEnv);
|
|
108
|
+
const assetPrefix = isDev ? '' : (_b = (_a = config_1.getGuruConfig()) === null || _a === void 0 ? void 0 : _a.publicPath) !== null && _b !== void 0 ? _b : '';
|
|
106
109
|
return {
|
|
107
110
|
distDir: `dist/${env}`,
|
|
108
111
|
reactStrictMode: true,
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
+
swcMinify: true,
|
|
113
|
+
assetPrefix,
|
|
114
|
+
i18n: {
|
|
115
|
+
locales: ['en'],
|
|
116
|
+
defaultLocale: 'en',
|
|
117
|
+
},
|
|
118
|
+
typescript: {
|
|
119
|
+
transpileOnly: true,
|
|
120
|
+
ignoreDevErrors: true,
|
|
121
|
+
ignoreBuildErrors: true,
|
|
112
122
|
},
|
|
113
123
|
images: {
|
|
114
124
|
formats: ['image/avif', 'image/webp'],
|
|
@@ -150,5 +160,5 @@ const createNextJSConfig = (buildEnv) => {
|
|
|
150
160
|
};
|
|
151
161
|
};
|
|
152
162
|
exports.createNextJSConfig = createNextJSConfig;
|
|
153
|
-
const createNextJSTranspiledConfig = () => withVanillaExtract(exports.withTM(exports.createNextJSConfig('
|
|
163
|
+
const createNextJSTranspiledConfig = () => withVanillaExtract(exports.withTM(exports.createNextJSConfig('prod')));
|
|
154
164
|
exports.createNextJSTranspiledConfig = createNextJSTranspiledConfig;
|
|
@@ -76,7 +76,6 @@ const baseOptions = (buildEnv, isMultiEnv) => ({
|
|
|
76
76
|
mode: isDev ? 'development' : 'production',
|
|
77
77
|
entry: {
|
|
78
78
|
main: [
|
|
79
|
-
!isDev && path_1.join(gduEntryPath, '/spa/set-public-path.js'),
|
|
80
79
|
path_1.join(gduEntryPath, '/polyfill.js'),
|
|
81
80
|
path_1.join(gduEntryPath, '/spa/client.js'),
|
|
82
81
|
].filter(Boolean),
|
|
@@ -298,22 +297,23 @@ const baseOptions = (buildEnv, isMultiEnv) => ({
|
|
|
298
297
|
].filter(Boolean),
|
|
299
298
|
});
|
|
300
299
|
const { outputPath } = config_1.getGuruConfig();
|
|
301
|
-
const makeWebpackConfig = (buildEnv, isMultiEnv) => {
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
}
|
|
300
|
+
const makeWebpackConfig = (buildEnv, isMultiEnv) => ({
|
|
301
|
+
name: buildEnv,
|
|
302
|
+
output: {
|
|
303
|
+
path: `${outputPath}/${!isMultiEnv && buildEnv === 'prod' ? '' : buildEnv}`,
|
|
304
|
+
publicPath: isDev
|
|
305
|
+
? '/'
|
|
306
|
+
: buildEnv === 'prod'
|
|
307
|
+
? `#{PUBLIC_PATH_BASE}/${config_1.getProjectFolderName()}/`
|
|
308
|
+
: `https://static-mfe-${buildEnv}.autoguru.io/${config_1.getProjectFolderName()}/`,
|
|
309
|
+
filename: `${fileMask}.js`,
|
|
310
|
+
chunkFilename: `chunks/${fileMask}.js`,
|
|
311
|
+
hashFunction: 'sha256',
|
|
312
|
+
crossOriginLoading: 'anonymous',
|
|
313
|
+
sourceMapFilename: 'sourceMaps/[file].map',
|
|
314
|
+
pathinfo: false,
|
|
315
|
+
},
|
|
316
|
+
});
|
|
317
317
|
const buildConfigs = () => {
|
|
318
318
|
const buildEnvs = configs_1.getBuildEnvs();
|
|
319
319
|
return buildEnvs.map((buildEnv) => ({
|
package/dist/lib/config.d.ts
CHANGED
|
@@ -12,3 +12,4 @@ export interface GuruConfig {
|
|
|
12
12
|
export declare const getGuruConfig: (location?: string) => GuruConfig | null;
|
|
13
13
|
export declare const decorateConfig: (guruConfig: Partial<GuruConfig>) => GuruConfig;
|
|
14
14
|
export declare const getProjectName: (location?: string) => any;
|
|
15
|
+
export declare const getProjectFolderName: (location?: string) => string;
|
package/dist/lib/config.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getProjectName = exports.decorateConfig = exports.getGuruConfig = void 0;
|
|
3
|
+
exports.getProjectFolderName = exports.getProjectName = exports.decorateConfig = exports.getGuruConfig = void 0;
|
|
4
4
|
const path_1 = require("path");
|
|
5
5
|
const diary_1 = require("diary");
|
|
6
6
|
const resolve_1 = require("./resolve");
|
|
@@ -52,3 +52,5 @@ const decorateConfig = (guruConfig) => {
|
|
|
52
52
|
exports.decorateConfig = decorateConfig;
|
|
53
53
|
const getProjectName = (location = roots_1.PROJECT_ROOT) => require(path_1.join(exports.getGuruConfig(location).__configPath, './package.json')).name;
|
|
54
54
|
exports.getProjectName = getProjectName;
|
|
55
|
+
const getProjectFolderName = (location = roots_1.PROJECT_ROOT) => path_1.basename(path_1.join(exports.getGuruConfig(location).__configPath));
|
|
56
|
+
exports.getProjectFolderName = getProjectFolderName;
|