@commercetools-frontend/mc-scripts 25.0.0 → 25.1.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/application-runtime/dist/commercetools-frontend-mc-scripts-application-runtime.cjs.dev.js +1 -1
- package/application-runtime/dist/commercetools-frontend-mc-scripts-application-runtime.cjs.prod.js +1 -1
- package/application-runtime/dist/commercetools-frontend-mc-scripts-application-runtime.esm.js +1 -1
- package/cli/dist/commercetools-frontend-mc-scripts-cli.cjs.dev.js +14 -13
- package/cli/dist/commercetools-frontend-mc-scripts-cli.cjs.prod.js +14 -13
- package/cli/dist/commercetools-frontend-mc-scripts-cli.esm.js +14 -13
- package/dist/{build-1baf8a00.cjs.dev.js → build-0a5986d1.cjs.dev.js} +7 -7
- package/dist/{build-0b4c6b04.esm.js → build-dbcd0936.esm.js} +7 -7
- package/dist/{build-50f29fb0.cjs.prod.js → build-ec10df64.cjs.prod.js} +7 -7
- package/dist/{build-vite-e26f6c9f.cjs.dev.js → build-vite-16b1a575.cjs.dev.js} +8 -9
- package/dist/{build-vite-85211835.esm.js → build-vite-59e1f185.esm.js} +8 -9
- package/dist/{build-vite-4a6c90c2.cjs.prod.js → build-vite-5d317720.cjs.prod.js} +8 -9
- package/dist/commercetools-frontend-mc-scripts.cjs.dev.js +1 -1
- package/dist/commercetools-frontend-mc-scripts.cjs.prod.js +1 -1
- package/dist/commercetools-frontend-mc-scripts.esm.js +1 -1
- package/dist/{compile-html-adfef598.esm.js → compile-html-025cd493.esm.js} +2 -4
- package/dist/{compile-html-b80f9651.cjs.prod.js → compile-html-50fd05ec.cjs.prod.js} +2 -5
- package/dist/{compile-html-8679f721.cjs.dev.js → compile-html-f4ac88cc.cjs.dev.js} +2 -5
- package/dist/{config-sync-87ba9f28.cjs.prod.js → config-sync-ce05c66c.cjs.prod.js} +70 -78
- package/dist/{config-sync-27ca0c93.cjs.dev.js → config-sync-dbb43993.cjs.dev.js} +72 -80
- package/dist/{config-sync-ff4b1e5b.esm.js → config-sync-e7f53a98.esm.js} +71 -79
- package/dist/{create-postcss-config-e6dfba3f.esm.js → create-postcss-config-0a86560d.esm.js} +1 -1
- package/dist/{create-postcss-config-0e833724.cjs.dev.js → create-postcss-config-381b636b.cjs.dev.js} +1 -1
- package/dist/{create-postcss-config-34bab342.cjs.prod.js → create-postcss-config-91c09596.cjs.prod.js} +1 -1
- package/dist/{create-webpack-config-for-development-fe0945ce.cjs.prod.js → create-webpack-config-for-development-37677a49.cjs.prod.js} +6 -6
- package/dist/{create-webpack-config-for-development-2ac1d86f.cjs.dev.js → create-webpack-config-for-development-488742b2.cjs.dev.js} +6 -6
- package/dist/{create-webpack-config-for-development-be2722d6.esm.js → create-webpack-config-for-development-df3f7f7f.esm.js} +6 -6
- package/dist/{create-webpack-config-for-production-d2c41a9d.cjs.dev.js → create-webpack-config-for-production-46d817cc.cjs.dev.js} +7 -7
- package/dist/{create-webpack-config-for-production-2200e554.cjs.prod.js → create-webpack-config-for-production-aad64e2a.cjs.prod.js} +7 -7
- package/dist/{create-webpack-config-for-production-66c77849.esm.js → create-webpack-config-for-production-e22f78d2.esm.js} +7 -7
- package/dist/{credentials-storage-381abf27.cjs.prod.js → credentials-storage-0b89aa0e.cjs.prod.js} +1 -1
- package/dist/{credentials-storage-7285d7b4.esm.js → credentials-storage-4464313c.esm.js} +1 -1
- package/dist/{credentials-storage-de220814.cjs.dev.js → credentials-storage-cbb5c559.cjs.dev.js} +1 -1
- package/dist/{deployment-previews-set-3697be5e.cjs.dev.js → deployment-previews-set-4edd48db.cjs.dev.js} +22 -28
- package/dist/{deployment-previews-set-e92403f7.cjs.prod.js → deployment-previews-set-636fb1a3.cjs.prod.js} +22 -28
- package/dist/{deployment-previews-set-7f9fbfe5.esm.js → deployment-previews-set-bbef95d2.esm.js} +22 -27
- package/dist/{graphql-requests-bab5fcc3.cjs.dev.js → graphql-requests-0a6eeb3a.cjs.prod.js} +5 -8
- package/dist/{graphql-requests-d8bc2292.esm.js → graphql-requests-14074b2b.esm.js} +5 -8
- package/dist/{graphql-requests-8ef89149.cjs.prod.js → graphql-requests-23f7ddb1.cjs.dev.js} +5 -8
- package/dist/{i18n-message-complilation-8aec9d1b.esm.js → i18n-message-complilation-21d3b0aa.esm.js} +1 -1
- package/dist/{i18n-message-complilation-3f80e8d6.cjs.dev.js → i18n-message-complilation-7311cb29.cjs.dev.js} +1 -1
- package/dist/{i18n-message-complilation-393d344a.cjs.prod.js → i18n-message-complilation-7762da61.cjs.prod.js} +1 -1
- package/dist/{login-9ee43381.esm.js → login-1b222f33.esm.js} +27 -30
- package/dist/{login-5fd67aac.cjs.prod.js → login-54ebae96.cjs.prod.js} +28 -31
- package/dist/{login-9fac9eee.cjs.dev.js → login-a6fd5fbf.cjs.dev.js} +28 -31
- package/dist/{optimizations-ea21b802.cjs.prod.js → optimizations-7789145e.cjs.dev.js} +5 -8
- package/dist/{optimizations-ea71a24a.esm.js → optimizations-bf991634.esm.js} +5 -7
- package/dist/{optimizations-ebbeaf88.cjs.dev.js → optimizations-fb93514f.cjs.prod.js} +5 -8
- package/dist/{package-4bdd2ccf.esm.js → package-a34835d9.esm.js} +9 -9
- package/dist/{package-ff04bcf7.cjs.dev.js → package-d8b1f4c0.cjs.dev.js} +9 -9
- package/dist/{package-428d5001.cjs.prod.js → package-e1f7242c.cjs.prod.js} +9 -9
- package/dist/{paths-7bf7e88e.esm.js → paths-39f22b8b.esm.js} +4 -9
- package/dist/{paths-af1a725a.cjs.prod.js → paths-7768b440.cjs.prod.js} +4 -10
- package/dist/{paths-ec3e3a7d.cjs.dev.js → paths-b76fc753.cjs.dev.js} +4 -10
- package/dist/{serve-04a03d5f.cjs.dev.js → serve-38456e1b.cjs.dev.js} +7 -6
- package/dist/{serve-fb1a0f5a.esm.js → serve-be1f9439.esm.js} +6 -6
- package/dist/{serve-2a863026.cjs.prod.js → serve-cc4a766d.cjs.prod.js} +7 -6
- package/dist/{start-84cdf12b.cjs.prod.js → start-0be8a294.cjs.prod.js} +8 -9
- package/dist/{start-47ea5e04.cjs.dev.js → start-37ec4a7e.cjs.dev.js} +8 -9
- package/dist/{start-643a55bb.esm.js → start-890895df.esm.js} +8 -9
- package/dist/{start-vite-eea72ba9.cjs.dev.js → start-vite-068e9f73.cjs.dev.js} +3 -4
- package/dist/{start-vite-d548c121.cjs.prod.js → start-vite-29078b3a.cjs.prod.js} +3 -4
- package/dist/{start-vite-d649d1f3.esm.js → start-vite-7d1161e8.esm.js} +3 -4
- package/dist/{vite-plugin-svgr-53ef97c7.cjs.dev.js → vite-plugin-svgr-4034a834.cjs.prod.js} +4 -4
- package/dist/{vite-plugin-svgr-5de1cad9.cjs.prod.js → vite-plugin-svgr-7d06f400.cjs.dev.js} +4 -4
- package/dist/{vite-plugin-svgr-22c8d518.esm.js → vite-plugin-svgr-de6ee7da.esm.js} +4 -4
- package/package.json +9 -9
- package/postcss/dist/commercetools-frontend-mc-scripts-postcss.cjs.dev.js +2 -2
- package/postcss/dist/commercetools-frontend-mc-scripts-postcss.cjs.prod.js +2 -2
- package/postcss/dist/commercetools-frontend-mc-scripts-postcss.esm.js +2 -2
- package/webpack/dist/commercetools-frontend-mc-scripts-webpack.cjs.dev.js +6 -6
- package/webpack/dist/commercetools-frontend-mc-scripts-webpack.cjs.prod.js +6 -6
- package/webpack/dist/commercetools-frontend-mc-scripts-webpack.esm.js +6 -6
- package/webpack-loaders/i18n-message-compilation-loader/dist/commercetools-frontend-mc-scripts-webpack-loaders-i18n-message-compilation-loader.cjs.dev.js +1 -1
- package/webpack-loaders/i18n-message-compilation-loader/dist/commercetools-frontend-mc-scripts-webpack-loaders-i18n-message-compilation-loader.cjs.prod.js +1 -1
- package/webpack-loaders/i18n-message-compilation-loader/dist/commercetools-frontend-mc-scripts-webpack-loaders-i18n-message-compilation-loader.esm.js +1 -1
package/application-runtime/dist/commercetools-frontend-mc-scripts-application-runtime.cjs.dev.js
CHANGED
|
@@ -4,4 +4,4 @@
|
|
|
4
4
|
// Dynamically inject webpack `publicPath`, for resolving assets locations.
|
|
5
5
|
// https://webpack.js.org/guides/public-path/#on-the-fly
|
|
6
6
|
// https://webpack.js.org/configuration/output/#output-publicpath
|
|
7
|
-
if (process.env.NODE_ENV !== 'test') __webpack_public_path__ =
|
|
7
|
+
if (process.env.NODE_ENV !== 'test') __webpack_public_path__ = `${window.app.cdnUrl.replace(/\/$/, '')}/`;
|
package/application-runtime/dist/commercetools-frontend-mc-scripts-application-runtime.cjs.prod.js
CHANGED
|
@@ -4,4 +4,4 @@
|
|
|
4
4
|
// Dynamically inject webpack `publicPath`, for resolving assets locations.
|
|
5
5
|
// https://webpack.js.org/guides/public-path/#on-the-fly
|
|
6
6
|
// https://webpack.js.org/configuration/output/#output-publicpath
|
|
7
|
-
__webpack_public_path__ =
|
|
7
|
+
__webpack_public_path__ = `${window.app.cdnUrl.replace(/\/$/, '')}/`;
|
package/application-runtime/dist/commercetools-frontend-mc-scripts-application-runtime.esm.js
CHANGED
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
// Dynamically inject webpack `publicPath`, for resolving assets locations.
|
|
3
3
|
// https://webpack.js.org/guides/public-path/#on-the-fly
|
|
4
4
|
// https://webpack.js.org/configuration/output/#output-publicpath
|
|
5
|
-
if (process.env.NODE_ENV !== 'test') __webpack_public_path__ =
|
|
5
|
+
if (process.env.NODE_ENV !== 'test') __webpack_public_path__ = `${window.app.cdnUrl.replace(/\/$/, '')}/`;
|
|
@@ -10,7 +10,7 @@ var path = require('path');
|
|
|
10
10
|
var commander = require('commander');
|
|
11
11
|
var dotenv = require('dotenv');
|
|
12
12
|
var dotenvExpand = require('dotenv-expand');
|
|
13
|
-
var _package = require('../../dist/package-
|
|
13
|
+
var _package = require('../../dist/package-d8b1f4c0.cjs.dev.js');
|
|
14
14
|
var doesFileExist = require('../../dist/does-file-exist-eb86baca.cjs.dev.js');
|
|
15
15
|
require('node:fs');
|
|
16
16
|
|
|
@@ -24,8 +24,9 @@ var path__default = /*#__PURE__*/_interopDefault(path);
|
|
|
24
24
|
var dotenv__default = /*#__PURE__*/_interopDefault(dotenv);
|
|
25
25
|
var dotenvExpand__default = /*#__PURE__*/_interopDefault(dotenvExpand);
|
|
26
26
|
|
|
27
|
-
commander.program.name('mc-scripts').description('CLI to develop and build Merchant Center customizations.').version(_package.pkgJson.version).option('-e, --env <path...>',
|
|
28
|
-
|
|
27
|
+
commander.program.name('mc-scripts').description('CLI to develop and build Merchant Center customizations.').version(_package.pkgJson.version).option('-e, --env <path...>',
|
|
28
|
+
// Variadic option. It allows multiple `--env` options to be provided.
|
|
29
|
+
`(optional) Parses the file path as a dotenv file and adds the variables to the environment. Multiple flags are allowed.`);
|
|
29
30
|
|
|
30
31
|
// Makes the script crash on unhandled rejections instead of silently
|
|
31
32
|
// ignoring them. In the future, promise rejections that are not handled will
|
|
@@ -53,7 +54,7 @@ async function run() {
|
|
|
53
54
|
console.log('Experimental Vite bundler enabled! 🚀');
|
|
54
55
|
console.log('');
|
|
55
56
|
}
|
|
56
|
-
const startCommand = shouldUseExperimentalBundler ? await Promise.resolve().then(function () { return require('../../dist/start-vite-
|
|
57
|
+
const startCommand = shouldUseExperimentalBundler ? await Promise.resolve().then(function () { return require('../../dist/start-vite-068e9f73.cjs.dev.js'); }) : await Promise.resolve().then(function () { return require('../../dist/start-37ec4a7e.cjs.dev.js'); });
|
|
57
58
|
await startCommand.default();
|
|
58
59
|
});
|
|
59
60
|
|
|
@@ -72,12 +73,12 @@ async function run() {
|
|
|
72
73
|
console.log('Experimental Vite bundler enabled! 🚀');
|
|
73
74
|
console.log('');
|
|
74
75
|
}
|
|
75
|
-
const buildCommand = shouldUseExperimentalBundler ? await Promise.resolve().then(function () { return require('../../dist/build-vite-
|
|
76
|
+
const buildCommand = shouldUseExperimentalBundler ? await Promise.resolve().then(function () { return require('../../dist/build-vite-16b1a575.cjs.dev.js'); }) : await Promise.resolve().then(function () { return require('../../dist/build-0a5986d1.cjs.dev.js'); });
|
|
76
77
|
await buildCommand.default();
|
|
77
78
|
const shouldAlsoCompile = !options.buildOnly;
|
|
78
79
|
if (shouldAlsoCompile) {
|
|
79
80
|
console.log('');
|
|
80
|
-
const compileHtmlCommand = await Promise.resolve().then(function () { return require('../../dist/compile-html-
|
|
81
|
+
const compileHtmlCommand = await Promise.resolve().then(function () { return require('../../dist/compile-html-f4ac88cc.cjs.dev.js'); });
|
|
81
82
|
await compileHtmlCommand.default({
|
|
82
83
|
printSecurityHeaders: false
|
|
83
84
|
});
|
|
@@ -94,7 +95,7 @@ async function run() {
|
|
|
94
95
|
|
|
95
96
|
// Do this as the first thing so that any code reading it knows the right env.
|
|
96
97
|
process.env.NODE_ENV = 'production';
|
|
97
|
-
const compileHtmlCommand = await Promise.resolve().then(function () { return require('../../dist/compile-html-
|
|
98
|
+
const compileHtmlCommand = await Promise.resolve().then(function () { return require('../../dist/compile-html-f4ac88cc.cjs.dev.js'); });
|
|
98
99
|
await compileHtmlCommand.default(options);
|
|
99
100
|
});
|
|
100
101
|
|
|
@@ -108,7 +109,7 @@ async function run() {
|
|
|
108
109
|
|
|
109
110
|
// Do this as the first thing so that any code reading it knows the right env.
|
|
110
111
|
process.env.NODE_ENV = 'production';
|
|
111
|
-
const serveCommand = await Promise.resolve().then(function () { return require('../../dist/serve-
|
|
112
|
+
const serveCommand = await Promise.resolve().then(function () { return require('../../dist/serve-38456e1b.cjs.dev.js'); });
|
|
112
113
|
await serveCommand.default();
|
|
113
114
|
});
|
|
114
115
|
|
|
@@ -124,7 +125,7 @@ async function run() {
|
|
|
124
125
|
|
|
125
126
|
// Do this as the first thing so that any code reading it knows the right env.
|
|
126
127
|
process.env.NODE_ENV = 'production';
|
|
127
|
-
const loginCommand = await Promise.resolve().then(function () { return require('../../dist/login-
|
|
128
|
+
const loginCommand = await Promise.resolve().then(function () { return require('../../dist/login-a6fd5fbf.cjs.dev.js'); });
|
|
128
129
|
await loginCommand.default(options);
|
|
129
130
|
});
|
|
130
131
|
|
|
@@ -138,7 +139,7 @@ async function run() {
|
|
|
138
139
|
|
|
139
140
|
// Do this as the first thing so that any code reading it knows the right env.
|
|
140
141
|
process.env.NODE_ENV = 'production';
|
|
141
|
-
const configSyncCommand = await Promise.resolve().then(function () { return require('../../dist/config-sync-
|
|
142
|
+
const configSyncCommand = await Promise.resolve().then(function () { return require('../../dist/config-sync-dbb43993.cjs.dev.js'); });
|
|
142
143
|
await configSyncCommand.default(options);
|
|
143
144
|
});
|
|
144
145
|
|
|
@@ -152,7 +153,7 @@ async function run() {
|
|
|
152
153
|
|
|
153
154
|
// Do this as the first thing so that any code reading it knows the right env.
|
|
154
155
|
process.env.NODE_ENV = 'production';
|
|
155
|
-
const deploymentsSetCommand = await Promise.resolve().then(function () { return require('../../dist/deployment-previews-set-
|
|
156
|
+
const deploymentsSetCommand = await Promise.resolve().then(function () { return require('../../dist/deployment-previews-set-4edd48db.cjs.dev.js'); });
|
|
156
157
|
await deploymentsSetCommand.default(options);
|
|
157
158
|
});
|
|
158
159
|
commander.program.parse();
|
|
@@ -175,11 +176,11 @@ function loadDotEnvFiles(globalOptions) {
|
|
|
175
176
|
}
|
|
176
177
|
|
|
177
178
|
// https://github.com/bkeepers/dotenv#what-other-env-files-can-i-use
|
|
178
|
-
dotenvFiles.push(..._filterInstanceProperty__default["default"](_context = [
|
|
179
|
+
dotenvFiles.push(..._filterInstanceProperty__default["default"](_context = [`.env.${environment}.local`,
|
|
179
180
|
// Don't include `.env.local` for `test` environment
|
|
180
181
|
// since normally you expect tests to produce the same
|
|
181
182
|
// results for everyone
|
|
182
|
-
process.env.NODE_ENV !== 'test' &&
|
|
183
|
+
process.env.NODE_ENV !== 'test' && `.env.local`, `.env.${environment}`, '.env']).call(_context, Boolean));
|
|
183
184
|
|
|
184
185
|
// Load environment variables from .env* files. Suppress warnings using silent
|
|
185
186
|
// if this file is missing. dotenv will never modify any environment variables
|
|
@@ -10,7 +10,7 @@ var path = require('path');
|
|
|
10
10
|
var commander = require('commander');
|
|
11
11
|
var dotenv = require('dotenv');
|
|
12
12
|
var dotenvExpand = require('dotenv-expand');
|
|
13
|
-
var _package = require('../../dist/package-
|
|
13
|
+
var _package = require('../../dist/package-e1f7242c.cjs.prod.js');
|
|
14
14
|
var doesFileExist = require('../../dist/does-file-exist-be53305d.cjs.prod.js');
|
|
15
15
|
require('node:fs');
|
|
16
16
|
|
|
@@ -24,8 +24,9 @@ var path__default = /*#__PURE__*/_interopDefault(path);
|
|
|
24
24
|
var dotenv__default = /*#__PURE__*/_interopDefault(dotenv);
|
|
25
25
|
var dotenvExpand__default = /*#__PURE__*/_interopDefault(dotenvExpand);
|
|
26
26
|
|
|
27
|
-
commander.program.name('mc-scripts').description('CLI to develop and build Merchant Center customizations.').version(_package.pkgJson.version).option('-e, --env <path...>',
|
|
28
|
-
|
|
27
|
+
commander.program.name('mc-scripts').description('CLI to develop and build Merchant Center customizations.').version(_package.pkgJson.version).option('-e, --env <path...>',
|
|
28
|
+
// Variadic option. It allows multiple `--env` options to be provided.
|
|
29
|
+
`(optional) Parses the file path as a dotenv file and adds the variables to the environment. Multiple flags are allowed.`);
|
|
29
30
|
|
|
30
31
|
// Makes the script crash on unhandled rejections instead of silently
|
|
31
32
|
// ignoring them. In the future, promise rejections that are not handled will
|
|
@@ -53,7 +54,7 @@ async function run() {
|
|
|
53
54
|
console.log('Experimental Vite bundler enabled! 🚀');
|
|
54
55
|
console.log('');
|
|
55
56
|
}
|
|
56
|
-
const startCommand = shouldUseExperimentalBundler ? await Promise.resolve().then(function () { return require('../../dist/start-vite-
|
|
57
|
+
const startCommand = shouldUseExperimentalBundler ? await Promise.resolve().then(function () { return require('../../dist/start-vite-29078b3a.cjs.prod.js'); }) : await Promise.resolve().then(function () { return require('../../dist/start-0be8a294.cjs.prod.js'); });
|
|
57
58
|
await startCommand.default();
|
|
58
59
|
});
|
|
59
60
|
|
|
@@ -72,12 +73,12 @@ async function run() {
|
|
|
72
73
|
console.log('Experimental Vite bundler enabled! 🚀');
|
|
73
74
|
console.log('');
|
|
74
75
|
}
|
|
75
|
-
const buildCommand = shouldUseExperimentalBundler ? await Promise.resolve().then(function () { return require('../../dist/build-vite-
|
|
76
|
+
const buildCommand = shouldUseExperimentalBundler ? await Promise.resolve().then(function () { return require('../../dist/build-vite-5d317720.cjs.prod.js'); }) : await Promise.resolve().then(function () { return require('../../dist/build-ec10df64.cjs.prod.js'); });
|
|
76
77
|
await buildCommand.default();
|
|
77
78
|
const shouldAlsoCompile = !options.buildOnly;
|
|
78
79
|
if (shouldAlsoCompile) {
|
|
79
80
|
console.log('');
|
|
80
|
-
const compileHtmlCommand = await Promise.resolve().then(function () { return require('../../dist/compile-html-
|
|
81
|
+
const compileHtmlCommand = await Promise.resolve().then(function () { return require('../../dist/compile-html-50fd05ec.cjs.prod.js'); });
|
|
81
82
|
await compileHtmlCommand.default({
|
|
82
83
|
printSecurityHeaders: false
|
|
83
84
|
});
|
|
@@ -94,7 +95,7 @@ async function run() {
|
|
|
94
95
|
|
|
95
96
|
// Do this as the first thing so that any code reading it knows the right env.
|
|
96
97
|
process.env.NODE_ENV = 'production';
|
|
97
|
-
const compileHtmlCommand = await Promise.resolve().then(function () { return require('../../dist/compile-html-
|
|
98
|
+
const compileHtmlCommand = await Promise.resolve().then(function () { return require('../../dist/compile-html-50fd05ec.cjs.prod.js'); });
|
|
98
99
|
await compileHtmlCommand.default(options);
|
|
99
100
|
});
|
|
100
101
|
|
|
@@ -108,7 +109,7 @@ async function run() {
|
|
|
108
109
|
|
|
109
110
|
// Do this as the first thing so that any code reading it knows the right env.
|
|
110
111
|
process.env.NODE_ENV = 'production';
|
|
111
|
-
const serveCommand = await Promise.resolve().then(function () { return require('../../dist/serve-
|
|
112
|
+
const serveCommand = await Promise.resolve().then(function () { return require('../../dist/serve-cc4a766d.cjs.prod.js'); });
|
|
112
113
|
await serveCommand.default();
|
|
113
114
|
});
|
|
114
115
|
|
|
@@ -124,7 +125,7 @@ async function run() {
|
|
|
124
125
|
|
|
125
126
|
// Do this as the first thing so that any code reading it knows the right env.
|
|
126
127
|
process.env.NODE_ENV = 'production';
|
|
127
|
-
const loginCommand = await Promise.resolve().then(function () { return require('../../dist/login-
|
|
128
|
+
const loginCommand = await Promise.resolve().then(function () { return require('../../dist/login-54ebae96.cjs.prod.js'); });
|
|
128
129
|
await loginCommand.default(options);
|
|
129
130
|
});
|
|
130
131
|
|
|
@@ -138,7 +139,7 @@ async function run() {
|
|
|
138
139
|
|
|
139
140
|
// Do this as the first thing so that any code reading it knows the right env.
|
|
140
141
|
process.env.NODE_ENV = 'production';
|
|
141
|
-
const configSyncCommand = await Promise.resolve().then(function () { return require('../../dist/config-sync-
|
|
142
|
+
const configSyncCommand = await Promise.resolve().then(function () { return require('../../dist/config-sync-ce05c66c.cjs.prod.js'); });
|
|
142
143
|
await configSyncCommand.default(options);
|
|
143
144
|
});
|
|
144
145
|
|
|
@@ -152,7 +153,7 @@ async function run() {
|
|
|
152
153
|
|
|
153
154
|
// Do this as the first thing so that any code reading it knows the right env.
|
|
154
155
|
process.env.NODE_ENV = 'production';
|
|
155
|
-
const deploymentsSetCommand = await Promise.resolve().then(function () { return require('../../dist/deployment-previews-set-
|
|
156
|
+
const deploymentsSetCommand = await Promise.resolve().then(function () { return require('../../dist/deployment-previews-set-636fb1a3.cjs.prod.js'); });
|
|
156
157
|
await deploymentsSetCommand.default(options);
|
|
157
158
|
});
|
|
158
159
|
commander.program.parse();
|
|
@@ -175,11 +176,11 @@ function loadDotEnvFiles(globalOptions) {
|
|
|
175
176
|
}
|
|
176
177
|
|
|
177
178
|
// https://github.com/bkeepers/dotenv#what-other-env-files-can-i-use
|
|
178
|
-
dotenvFiles.push(..._filterInstanceProperty__default["default"](_context = [
|
|
179
|
+
dotenvFiles.push(..._filterInstanceProperty__default["default"](_context = [`.env.${environment}.local`,
|
|
179
180
|
// Don't include `.env.local` for `test` environment
|
|
180
181
|
// since normally you expect tests to produce the same
|
|
181
182
|
// results for everyone
|
|
182
|
-
|
|
183
|
+
`.env.local`, `.env.${environment}`, '.env']).call(_context, Boolean));
|
|
183
184
|
|
|
184
185
|
// Load environment variables from .env* files. Suppress warnings using silent
|
|
185
186
|
// if this file is missing. dotenv will never modify any environment variables
|
|
@@ -6,12 +6,13 @@ import path from 'path';
|
|
|
6
6
|
import { program } from 'commander';
|
|
7
7
|
import dotenv from 'dotenv';
|
|
8
8
|
import dotenvExpand from 'dotenv-expand';
|
|
9
|
-
import { p as pkgJson } from '../../dist/package-
|
|
9
|
+
import { p as pkgJson } from '../../dist/package-a34835d9.esm.js';
|
|
10
10
|
import { d as doesFileExist } from '../../dist/does-file-exist-32618334.esm.js';
|
|
11
11
|
import 'node:fs';
|
|
12
12
|
|
|
13
|
-
program.name('mc-scripts').description('CLI to develop and build Merchant Center customizations.').version(pkgJson.version).option('-e, --env <path...>',
|
|
14
|
-
|
|
13
|
+
program.name('mc-scripts').description('CLI to develop and build Merchant Center customizations.').version(pkgJson.version).option('-e, --env <path...>',
|
|
14
|
+
// Variadic option. It allows multiple `--env` options to be provided.
|
|
15
|
+
`(optional) Parses the file path as a dotenv file and adds the variables to the environment. Multiple flags are allowed.`);
|
|
15
16
|
|
|
16
17
|
// Makes the script crash on unhandled rejections instead of silently
|
|
17
18
|
// ignoring them. In the future, promise rejections that are not handled will
|
|
@@ -39,7 +40,7 @@ async function run() {
|
|
|
39
40
|
console.log('Experimental Vite bundler enabled! 🚀');
|
|
40
41
|
console.log('');
|
|
41
42
|
}
|
|
42
|
-
const startCommand = shouldUseExperimentalBundler ? await import('../../dist/start-vite-
|
|
43
|
+
const startCommand = shouldUseExperimentalBundler ? await import('../../dist/start-vite-7d1161e8.esm.js') : await import('../../dist/start-890895df.esm.js');
|
|
43
44
|
await startCommand.default();
|
|
44
45
|
});
|
|
45
46
|
|
|
@@ -58,12 +59,12 @@ async function run() {
|
|
|
58
59
|
console.log('Experimental Vite bundler enabled! 🚀');
|
|
59
60
|
console.log('');
|
|
60
61
|
}
|
|
61
|
-
const buildCommand = shouldUseExperimentalBundler ? await import('../../dist/build-vite-
|
|
62
|
+
const buildCommand = shouldUseExperimentalBundler ? await import('../../dist/build-vite-59e1f185.esm.js') : await import('../../dist/build-dbcd0936.esm.js');
|
|
62
63
|
await buildCommand.default();
|
|
63
64
|
const shouldAlsoCompile = !options.buildOnly;
|
|
64
65
|
if (shouldAlsoCompile) {
|
|
65
66
|
console.log('');
|
|
66
|
-
const compileHtmlCommand = await import('../../dist/compile-html-
|
|
67
|
+
const compileHtmlCommand = await import('../../dist/compile-html-025cd493.esm.js');
|
|
67
68
|
await compileHtmlCommand.default({
|
|
68
69
|
printSecurityHeaders: false
|
|
69
70
|
});
|
|
@@ -80,7 +81,7 @@ async function run() {
|
|
|
80
81
|
|
|
81
82
|
// Do this as the first thing so that any code reading it knows the right env.
|
|
82
83
|
process.env.NODE_ENV = 'production';
|
|
83
|
-
const compileHtmlCommand = await import('../../dist/compile-html-
|
|
84
|
+
const compileHtmlCommand = await import('../../dist/compile-html-025cd493.esm.js');
|
|
84
85
|
await compileHtmlCommand.default(options);
|
|
85
86
|
});
|
|
86
87
|
|
|
@@ -94,7 +95,7 @@ async function run() {
|
|
|
94
95
|
|
|
95
96
|
// Do this as the first thing so that any code reading it knows the right env.
|
|
96
97
|
process.env.NODE_ENV = 'production';
|
|
97
|
-
const serveCommand = await import('../../dist/serve-
|
|
98
|
+
const serveCommand = await import('../../dist/serve-be1f9439.esm.js');
|
|
98
99
|
await serveCommand.default();
|
|
99
100
|
});
|
|
100
101
|
|
|
@@ -110,7 +111,7 @@ async function run() {
|
|
|
110
111
|
|
|
111
112
|
// Do this as the first thing so that any code reading it knows the right env.
|
|
112
113
|
process.env.NODE_ENV = 'production';
|
|
113
|
-
const loginCommand = await import('../../dist/login-
|
|
114
|
+
const loginCommand = await import('../../dist/login-1b222f33.esm.js');
|
|
114
115
|
await loginCommand.default(options);
|
|
115
116
|
});
|
|
116
117
|
|
|
@@ -124,7 +125,7 @@ async function run() {
|
|
|
124
125
|
|
|
125
126
|
// Do this as the first thing so that any code reading it knows the right env.
|
|
126
127
|
process.env.NODE_ENV = 'production';
|
|
127
|
-
const configSyncCommand = await import('../../dist/config-sync-
|
|
128
|
+
const configSyncCommand = await import('../../dist/config-sync-e7f53a98.esm.js');
|
|
128
129
|
await configSyncCommand.default(options);
|
|
129
130
|
});
|
|
130
131
|
|
|
@@ -138,7 +139,7 @@ async function run() {
|
|
|
138
139
|
|
|
139
140
|
// Do this as the first thing so that any code reading it knows the right env.
|
|
140
141
|
process.env.NODE_ENV = 'production';
|
|
141
|
-
const deploymentsSetCommand = await import('../../dist/deployment-previews-set-
|
|
142
|
+
const deploymentsSetCommand = await import('../../dist/deployment-previews-set-bbef95d2.esm.js');
|
|
142
143
|
await deploymentsSetCommand.default(options);
|
|
143
144
|
});
|
|
144
145
|
program.parse();
|
|
@@ -161,11 +162,11 @@ function loadDotEnvFiles(globalOptions) {
|
|
|
161
162
|
}
|
|
162
163
|
|
|
163
164
|
// https://github.com/bkeepers/dotenv#what-other-env-files-can-i-use
|
|
164
|
-
dotenvFiles.push(..._filterInstanceProperty(_context = [
|
|
165
|
+
dotenvFiles.push(..._filterInstanceProperty(_context = [`.env.${environment}.local`,
|
|
165
166
|
// Don't include `.env.local` for `test` environment
|
|
166
167
|
// since normally you expect tests to produce the same
|
|
167
168
|
// results for everyone
|
|
168
|
-
process.env.NODE_ENV !== 'test' &&
|
|
169
|
+
process.env.NODE_ENV !== 'test' && `.env.local`, `.env.${environment}`, '.env']).call(_context, Boolean));
|
|
169
170
|
|
|
170
171
|
// Load environment variables from .env* files. Suppress warnings using silent
|
|
171
172
|
// if this file is missing. dotenv will never modify any environment variables
|
|
@@ -10,8 +10,8 @@ var formatWebpackMessages = require('react-dev-utils/formatWebpackMessages');
|
|
|
10
10
|
var printBuildError = require('react-dev-utils/printBuildError');
|
|
11
11
|
var webpack = require('webpack');
|
|
12
12
|
var assets = require('@commercetools-frontend/assets');
|
|
13
|
-
var createWebpackConfigForProduction = require('./create-webpack-config-for-production-
|
|
14
|
-
var paths = require('./paths-
|
|
13
|
+
var createWebpackConfigForProduction = require('./create-webpack-config-for-production-46d817cc.cjs.dev.js');
|
|
14
|
+
var paths = require('./paths-b76fc753.cjs.dev.js');
|
|
15
15
|
var doesFileExist = require('./does-file-exist-eb86baca.cjs.dev.js');
|
|
16
16
|
require('@babel/runtime-corejs3/core-js-stable/object/keys');
|
|
17
17
|
require('@babel/runtime-corejs3/core-js-stable/object/get-own-property-symbols');
|
|
@@ -40,11 +40,11 @@ require('@babel/runtime-corejs3/core-js-stable/instance/bind');
|
|
|
40
40
|
require('@babel/runtime-corejs3/core-js-stable/instance/reduce');
|
|
41
41
|
require('@babel/runtime-corejs3/core-js-stable/object/assign');
|
|
42
42
|
require('fs');
|
|
43
|
-
require('./create-postcss-config-
|
|
43
|
+
require('./create-postcss-config-381b636b.cjs.dev.js');
|
|
44
44
|
require('@babel/runtime-corejs3/helpers/slicedToArray');
|
|
45
|
-
require('./package-
|
|
45
|
+
require('./package-d8b1f4c0.cjs.dev.js');
|
|
46
46
|
require('./has-jsx-runtime-aa5d21ee.cjs.dev.js');
|
|
47
|
-
require('./optimizations-
|
|
47
|
+
require('./optimizations-7789145e.cjs.dev.js');
|
|
48
48
|
require('@babel/runtime-corejs3/core-js-stable/object/entries');
|
|
49
49
|
require('@babel/runtime-corejs3/core-js-stable/instance/includes');
|
|
50
50
|
require('./vendors-to-transpile-6ab4ea06.cjs.dev.js');
|
|
@@ -103,7 +103,7 @@ async function run() {
|
|
|
103
103
|
if (error instanceof Error) {
|
|
104
104
|
printBuildError__default["default"](error);
|
|
105
105
|
}
|
|
106
|
-
throw new Error(
|
|
106
|
+
throw new Error(`Failed to compile`);
|
|
107
107
|
}
|
|
108
108
|
|
|
109
109
|
// Create the production build and print the deployment instructions.
|
|
@@ -134,7 +134,7 @@ async function run() {
|
|
|
134
134
|
warnings: []
|
|
135
135
|
});
|
|
136
136
|
} else {
|
|
137
|
-
messages = formatWebpackMessages__default["default"](stats
|
|
137
|
+
messages = formatWebpackMessages__default["default"](stats?.toJson({
|
|
138
138
|
all: false,
|
|
139
139
|
warnings: true,
|
|
140
140
|
errors: true
|
|
@@ -8,8 +8,8 @@ import formatWebpackMessages from 'react-dev-utils/formatWebpackMessages';
|
|
|
8
8
|
import printBuildError from 'react-dev-utils/printBuildError';
|
|
9
9
|
import webpack from 'webpack';
|
|
10
10
|
import { packageLocation } from '@commercetools-frontend/assets';
|
|
11
|
-
import { c as createWebpackConfigForProduction } from './create-webpack-config-for-production-
|
|
12
|
-
import { p as paths } from './paths-
|
|
11
|
+
import { c as createWebpackConfigForProduction } from './create-webpack-config-for-production-e22f78d2.esm.js';
|
|
12
|
+
import { p as paths } from './paths-39f22b8b.esm.js';
|
|
13
13
|
import { d as doesFileExist } from './does-file-exist-32618334.esm.js';
|
|
14
14
|
import '@babel/runtime-corejs3/core-js-stable/object/keys';
|
|
15
15
|
import '@babel/runtime-corejs3/core-js-stable/object/get-own-property-symbols';
|
|
@@ -38,11 +38,11 @@ import '@babel/runtime-corejs3/core-js-stable/instance/bind';
|
|
|
38
38
|
import '@babel/runtime-corejs3/core-js-stable/instance/reduce';
|
|
39
39
|
import '@babel/runtime-corejs3/core-js-stable/object/assign';
|
|
40
40
|
import 'fs';
|
|
41
|
-
import './create-postcss-config-
|
|
41
|
+
import './create-postcss-config-0a86560d.esm.js';
|
|
42
42
|
import '@babel/runtime-corejs3/helpers/slicedToArray';
|
|
43
|
-
import './package-
|
|
43
|
+
import './package-a34835d9.esm.js';
|
|
44
44
|
import './has-jsx-runtime-e3ecb09b.esm.js';
|
|
45
|
-
import './optimizations-
|
|
45
|
+
import './optimizations-bf991634.esm.js';
|
|
46
46
|
import '@babel/runtime-corejs3/core-js-stable/object/entries';
|
|
47
47
|
import '@babel/runtime-corejs3/core-js-stable/instance/includes';
|
|
48
48
|
import './vendors-to-transpile-7dc84a72.esm.js';
|
|
@@ -89,7 +89,7 @@ async function run() {
|
|
|
89
89
|
if (error instanceof Error) {
|
|
90
90
|
printBuildError(error);
|
|
91
91
|
}
|
|
92
|
-
throw new Error(
|
|
92
|
+
throw new Error(`Failed to compile`);
|
|
93
93
|
}
|
|
94
94
|
|
|
95
95
|
// Create the production build and print the deployment instructions.
|
|
@@ -120,7 +120,7 @@ async function run() {
|
|
|
120
120
|
warnings: []
|
|
121
121
|
});
|
|
122
122
|
} else {
|
|
123
|
-
messages = formatWebpackMessages(stats
|
|
123
|
+
messages = formatWebpackMessages(stats?.toJson({
|
|
124
124
|
all: false,
|
|
125
125
|
warnings: true,
|
|
126
126
|
errors: true
|
|
@@ -10,8 +10,8 @@ var formatWebpackMessages = require('react-dev-utils/formatWebpackMessages');
|
|
|
10
10
|
var printBuildError = require('react-dev-utils/printBuildError');
|
|
11
11
|
var webpack = require('webpack');
|
|
12
12
|
var assets = require('@commercetools-frontend/assets');
|
|
13
|
-
var createWebpackConfigForProduction = require('./create-webpack-config-for-production-
|
|
14
|
-
var paths = require('./paths-
|
|
13
|
+
var createWebpackConfigForProduction = require('./create-webpack-config-for-production-aad64e2a.cjs.prod.js');
|
|
14
|
+
var paths = require('./paths-7768b440.cjs.prod.js');
|
|
15
15
|
var doesFileExist = require('./does-file-exist-be53305d.cjs.prod.js');
|
|
16
16
|
require('@babel/runtime-corejs3/core-js-stable/object/keys');
|
|
17
17
|
require('@babel/runtime-corejs3/core-js-stable/object/get-own-property-symbols');
|
|
@@ -40,11 +40,11 @@ require('@babel/runtime-corejs3/core-js-stable/instance/bind');
|
|
|
40
40
|
require('@babel/runtime-corejs3/core-js-stable/instance/reduce');
|
|
41
41
|
require('@babel/runtime-corejs3/core-js-stable/object/assign');
|
|
42
42
|
require('fs');
|
|
43
|
-
require('./create-postcss-config-
|
|
43
|
+
require('./create-postcss-config-91c09596.cjs.prod.js');
|
|
44
44
|
require('@babel/runtime-corejs3/helpers/slicedToArray');
|
|
45
|
-
require('./package-
|
|
45
|
+
require('./package-e1f7242c.cjs.prod.js');
|
|
46
46
|
require('./has-jsx-runtime-c3202df5.cjs.prod.js');
|
|
47
|
-
require('./optimizations-
|
|
47
|
+
require('./optimizations-fb93514f.cjs.prod.js');
|
|
48
48
|
require('@babel/runtime-corejs3/core-js-stable/object/entries');
|
|
49
49
|
require('@babel/runtime-corejs3/core-js-stable/instance/includes');
|
|
50
50
|
require('./vendors-to-transpile-04a49d40.cjs.prod.js');
|
|
@@ -103,7 +103,7 @@ async function run() {
|
|
|
103
103
|
if (error instanceof Error) {
|
|
104
104
|
printBuildError__default["default"](error);
|
|
105
105
|
}
|
|
106
|
-
throw new Error(
|
|
106
|
+
throw new Error(`Failed to compile`);
|
|
107
107
|
}
|
|
108
108
|
|
|
109
109
|
// Create the production build and print the deployment instructions.
|
|
@@ -134,7 +134,7 @@ async function run() {
|
|
|
134
134
|
warnings: []
|
|
135
135
|
});
|
|
136
136
|
} else {
|
|
137
|
-
messages = formatWebpackMessages__default["default"](stats
|
|
137
|
+
messages = formatWebpackMessages__default["default"](stats?.toJson({
|
|
138
138
|
all: false,
|
|
139
139
|
warnings: true,
|
|
140
140
|
errors: true
|
|
@@ -12,18 +12,17 @@ var vite = require('vite');
|
|
|
12
12
|
var viteBundleAnalyzer = require('vite-bundle-analyzer');
|
|
13
13
|
var assets = require('@commercetools-frontend/assets');
|
|
14
14
|
var mcHtmlTemplate = require('@commercetools-frontend/mc-html-template');
|
|
15
|
-
var optimizations = require('./optimizations-
|
|
16
|
-
var paths = require('./paths-
|
|
15
|
+
var optimizations = require('./optimizations-7789145e.cjs.dev.js');
|
|
16
|
+
var paths = require('./paths-b76fc753.cjs.dev.js');
|
|
17
17
|
var cliLib = require('@formatjs/cli-lib');
|
|
18
18
|
var pluginutils = require('@rollup/pluginutils');
|
|
19
|
-
var i18nMessageComplilation = require('./i18n-message-complilation-
|
|
20
|
-
var vitePluginSvgr = require('./vite-plugin-svgr-
|
|
19
|
+
var i18nMessageComplilation = require('./i18n-message-complilation-7311cb29.cjs.dev.js');
|
|
20
|
+
var vitePluginSvgr = require('./vite-plugin-svgr-7d06f400.cjs.dev.js');
|
|
21
21
|
require('@babel/runtime-corejs3/helpers/defineProperty');
|
|
22
22
|
require('@babel/runtime-corejs3/helpers/slicedToArray');
|
|
23
23
|
require('@babel/runtime-corejs3/core-js-stable/instance/reduce');
|
|
24
24
|
require('@babel/runtime-corejs3/core-js-stable/object/entries');
|
|
25
25
|
require('@babel/runtime-corejs3/core-js-stable/instance/includes');
|
|
26
|
-
require('@babel/runtime-corejs3/core-js-stable/instance/concat');
|
|
27
26
|
require('@babel/runtime-corejs3/core-js-stable/object/keys');
|
|
28
27
|
require('@babel/runtime-corejs3/core-js-stable/object/get-own-property-symbols');
|
|
29
28
|
require('@babel/runtime-corejs3/core-js-stable/object/get-own-property-descriptor');
|
|
@@ -76,7 +75,7 @@ function nonNullable(value) {
|
|
|
76
75
|
// This script/function is injected into the `index.html` and used by Vite
|
|
77
76
|
// on runtime to build the assets URL (for example when using a separate CDN for the assets).
|
|
78
77
|
// Inspired by https://github.com/vitejs/vite/blob/main/playground/assets/vite.config-runtime-base.js
|
|
79
|
-
const dynamicBaseAssetsCode =
|
|
78
|
+
const dynamicBaseAssetsCode = `globalThis.__toCdnUrl = filePath => window.app.cdnUrl.replace(/\\/$/, '') + '/' + filePath;`;
|
|
80
79
|
function vitePluginDynamicBaseAssetsGlobals() {
|
|
81
80
|
return {
|
|
82
81
|
name: 'dynamic-base-assets-globals',
|
|
@@ -137,7 +136,7 @@ async function run() {
|
|
|
137
136
|
const html = mcHtmlTemplate.generateTemplate({
|
|
138
137
|
// Define the module entry point (path relative from the `/public` folder).
|
|
139
138
|
// NOTE: that this is different from the development configuration.
|
|
140
|
-
scriptImports: [
|
|
139
|
+
scriptImports: [`<script type="module" src="/${appEntryPoint}" defer></script>`]
|
|
141
140
|
});
|
|
142
141
|
// Write `index.html` (template) into the `/public` folder.
|
|
143
142
|
fs__default["default"].writeFileSync(paths.paths.appIndexHtml, html, {
|
|
@@ -183,10 +182,10 @@ async function run() {
|
|
|
183
182
|
renderBuiltUrl(filename, _ref) {
|
|
184
183
|
let hostType = _ref.hostType;
|
|
185
184
|
if (hostType === 'html') {
|
|
186
|
-
return
|
|
185
|
+
return `__CDN_URL__${filename}`;
|
|
187
186
|
}
|
|
188
187
|
return {
|
|
189
|
-
runtime:
|
|
188
|
+
runtime: `window.__toCdnUrl(${_JSON$stringify__default["default"](filename)})`
|
|
190
189
|
};
|
|
191
190
|
}
|
|
192
191
|
},
|
|
@@ -10,18 +10,17 @@ import { build } from 'vite';
|
|
|
10
10
|
import { analyzer } from 'vite-bundle-analyzer';
|
|
11
11
|
import { packageLocation } from '@commercetools-frontend/assets';
|
|
12
12
|
import { generateTemplate } from '@commercetools-frontend/mc-html-template';
|
|
13
|
-
import { a as getViteCacheGroups } from './optimizations-
|
|
14
|
-
import { p as paths } from './paths-
|
|
13
|
+
import { a as getViteCacheGroups } from './optimizations-bf991634.esm.js';
|
|
14
|
+
import { p as paths } from './paths-39f22b8b.esm.js';
|
|
15
15
|
import { compile } from '@formatjs/cli-lib';
|
|
16
16
|
import { createFilter } from '@rollup/pluginutils';
|
|
17
|
-
import { g as getI18nMessageFormat, h as handleMessageCompilationError } from './i18n-message-complilation-
|
|
18
|
-
import { v as vitePluginSvgr } from './vite-plugin-svgr-
|
|
17
|
+
import { g as getI18nMessageFormat, h as handleMessageCompilationError } from './i18n-message-complilation-21d3b0aa.esm.js';
|
|
18
|
+
import { v as vitePluginSvgr } from './vite-plugin-svgr-de6ee7da.esm.js';
|
|
19
19
|
import '@babel/runtime-corejs3/helpers/defineProperty';
|
|
20
20
|
import '@babel/runtime-corejs3/helpers/slicedToArray';
|
|
21
21
|
import '@babel/runtime-corejs3/core-js-stable/instance/reduce';
|
|
22
22
|
import '@babel/runtime-corejs3/core-js-stable/object/entries';
|
|
23
23
|
import '@babel/runtime-corejs3/core-js-stable/instance/includes';
|
|
24
|
-
import '@babel/runtime-corejs3/core-js-stable/instance/concat';
|
|
25
24
|
import '@babel/runtime-corejs3/core-js-stable/object/keys';
|
|
26
25
|
import '@babel/runtime-corejs3/core-js-stable/object/get-own-property-symbols';
|
|
27
26
|
import '@babel/runtime-corejs3/core-js-stable/object/get-own-property-descriptor';
|
|
@@ -46,7 +45,7 @@ function nonNullable(value) {
|
|
|
46
45
|
// This script/function is injected into the `index.html` and used by Vite
|
|
47
46
|
// on runtime to build the assets URL (for example when using a separate CDN for the assets).
|
|
48
47
|
// Inspired by https://github.com/vitejs/vite/blob/main/playground/assets/vite.config-runtime-base.js
|
|
49
|
-
const dynamicBaseAssetsCode =
|
|
48
|
+
const dynamicBaseAssetsCode = `globalThis.__toCdnUrl = filePath => window.app.cdnUrl.replace(/\\/$/, '') + '/' + filePath;`;
|
|
50
49
|
function vitePluginDynamicBaseAssetsGlobals() {
|
|
51
50
|
return {
|
|
52
51
|
name: 'dynamic-base-assets-globals',
|
|
@@ -107,7 +106,7 @@ async function run() {
|
|
|
107
106
|
const html = generateTemplate({
|
|
108
107
|
// Define the module entry point (path relative from the `/public` folder).
|
|
109
108
|
// NOTE: that this is different from the development configuration.
|
|
110
|
-
scriptImports: [
|
|
109
|
+
scriptImports: [`<script type="module" src="/${appEntryPoint}" defer></script>`]
|
|
111
110
|
});
|
|
112
111
|
// Write `index.html` (template) into the `/public` folder.
|
|
113
112
|
fs.writeFileSync(paths.appIndexHtml, html, {
|
|
@@ -153,10 +152,10 @@ async function run() {
|
|
|
153
152
|
renderBuiltUrl(filename, _ref) {
|
|
154
153
|
let hostType = _ref.hostType;
|
|
155
154
|
if (hostType === 'html') {
|
|
156
|
-
return
|
|
155
|
+
return `__CDN_URL__${filename}`;
|
|
157
156
|
}
|
|
158
157
|
return {
|
|
159
|
-
runtime:
|
|
158
|
+
runtime: `window.__toCdnUrl(${_JSON$stringify(filename)})`
|
|
160
159
|
};
|
|
161
160
|
}
|
|
162
161
|
},
|
|
@@ -12,18 +12,17 @@ var vite = require('vite');
|
|
|
12
12
|
var viteBundleAnalyzer = require('vite-bundle-analyzer');
|
|
13
13
|
var assets = require('@commercetools-frontend/assets');
|
|
14
14
|
var mcHtmlTemplate = require('@commercetools-frontend/mc-html-template');
|
|
15
|
-
var optimizations = require('./optimizations-
|
|
16
|
-
var paths = require('./paths-
|
|
15
|
+
var optimizations = require('./optimizations-fb93514f.cjs.prod.js');
|
|
16
|
+
var paths = require('./paths-7768b440.cjs.prod.js');
|
|
17
17
|
var cliLib = require('@formatjs/cli-lib');
|
|
18
18
|
var pluginutils = require('@rollup/pluginutils');
|
|
19
|
-
var i18nMessageComplilation = require('./i18n-message-complilation-
|
|
20
|
-
var vitePluginSvgr = require('./vite-plugin-svgr-
|
|
19
|
+
var i18nMessageComplilation = require('./i18n-message-complilation-7762da61.cjs.prod.js');
|
|
20
|
+
var vitePluginSvgr = require('./vite-plugin-svgr-4034a834.cjs.prod.js');
|
|
21
21
|
require('@babel/runtime-corejs3/helpers/defineProperty');
|
|
22
22
|
require('@babel/runtime-corejs3/helpers/slicedToArray');
|
|
23
23
|
require('@babel/runtime-corejs3/core-js-stable/instance/reduce');
|
|
24
24
|
require('@babel/runtime-corejs3/core-js-stable/object/entries');
|
|
25
25
|
require('@babel/runtime-corejs3/core-js-stable/instance/includes');
|
|
26
|
-
require('@babel/runtime-corejs3/core-js-stable/instance/concat');
|
|
27
26
|
require('@babel/runtime-corejs3/core-js-stable/object/keys');
|
|
28
27
|
require('@babel/runtime-corejs3/core-js-stable/object/get-own-property-symbols');
|
|
29
28
|
require('@babel/runtime-corejs3/core-js-stable/object/get-own-property-descriptor');
|
|
@@ -76,7 +75,7 @@ function nonNullable(value) {
|
|
|
76
75
|
// This script/function is injected into the `index.html` and used by Vite
|
|
77
76
|
// on runtime to build the assets URL (for example when using a separate CDN for the assets).
|
|
78
77
|
// Inspired by https://github.com/vitejs/vite/blob/main/playground/assets/vite.config-runtime-base.js
|
|
79
|
-
const dynamicBaseAssetsCode =
|
|
78
|
+
const dynamicBaseAssetsCode = `globalThis.__toCdnUrl = filePath => window.app.cdnUrl.replace(/\\/$/, '') + '/' + filePath;`;
|
|
80
79
|
function vitePluginDynamicBaseAssetsGlobals() {
|
|
81
80
|
return {
|
|
82
81
|
name: 'dynamic-base-assets-globals',
|
|
@@ -137,7 +136,7 @@ async function run() {
|
|
|
137
136
|
const html = mcHtmlTemplate.generateTemplate({
|
|
138
137
|
// Define the module entry point (path relative from the `/public` folder).
|
|
139
138
|
// NOTE: that this is different from the development configuration.
|
|
140
|
-
scriptImports: [
|
|
139
|
+
scriptImports: [`<script type="module" src="/${appEntryPoint}" defer></script>`]
|
|
141
140
|
});
|
|
142
141
|
// Write `index.html` (template) into the `/public` folder.
|
|
143
142
|
fs__default["default"].writeFileSync(paths.paths.appIndexHtml, html, {
|
|
@@ -183,10 +182,10 @@ async function run() {
|
|
|
183
182
|
renderBuiltUrl(filename, _ref) {
|
|
184
183
|
let hostType = _ref.hostType;
|
|
185
184
|
if (hostType === 'html') {
|
|
186
|
-
return
|
|
185
|
+
return `__CDN_URL__${filename}`;
|
|
187
186
|
}
|
|
188
187
|
return {
|
|
189
|
-
runtime:
|
|
188
|
+
runtime: `window.__toCdnUrl(${_JSON$stringify__default["default"](filename)})`
|
|
190
189
|
};
|
|
191
190
|
}
|
|
192
191
|
},
|