@commercetools-frontend/mc-scripts 25.0.0 → 25.2.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 +28 -14
- package/cli/dist/commercetools-frontend-mc-scripts-cli.cjs.prod.js +28 -14
- package/cli/dist/commercetools-frontend-mc-scripts-cli.esm.js +28 -14
- package/dist/{build-50f29fb0.cjs.prod.js → build-182a099c.cjs.prod.js} +7 -7
- package/dist/{build-0b4c6b04.esm.js → build-220a1658.esm.js} +7 -7
- package/dist/{build-1baf8a00.cjs.dev.js → build-519d246d.cjs.dev.js} +7 -7
- package/dist/{build-vite-e26f6c9f.cjs.dev.js → build-vite-837e7c94.cjs.dev.js} +64 -43
- package/dist/{build-vite-85211835.esm.js → build-vite-8cae71a0.esm.js} +61 -24
- package/dist/{build-vite-4a6c90c2.cjs.prod.js → build-vite-b007241b.cjs.prod.js} +64 -43
- 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-0b96d430.esm.js +255 -0
- package/dist/config-sync-b3072939.cjs.prod.js +265 -0
- package/dist/config-sync-ci-4a09aa00.cjs.prod.js +305 -0
- package/dist/config-sync-ci-85e3fec2.esm.js +294 -0
- package/dist/config-sync-ci-eadb8bfc.cjs.dev.js +305 -0
- package/dist/config-sync-f8fca39f.cjs.dev.js +265 -0
- package/dist/{config-sync-87ba9f28.cjs.prod.js → config-sync-helpers-11fc328f.cjs.prod.js} +193 -326
- package/dist/{config-sync-27ca0c93.cjs.dev.js → config-sync-helpers-dab59ed9.cjs.dev.js} +195 -328
- package/dist/{config-sync-ff4b1e5b.esm.js → config-sync-helpers-fe6ea729.esm.js} +186 -323
- package/dist/{create-postcss-config-34bab342.cjs.prod.js → create-postcss-config-56b74a34.cjs.prod.js} +1 -1
- package/dist/{create-postcss-config-0e833724.cjs.dev.js → create-postcss-config-78879a12.cjs.dev.js} +1 -1
- package/dist/{create-postcss-config-e6dfba3f.esm.js → create-postcss-config-95f9bf62.esm.js} +1 -1
- package/dist/{create-webpack-config-for-development-fe0945ce.cjs.prod.js → create-webpack-config-for-development-3eb1b365.cjs.prod.js} +7 -7
- package/dist/{create-webpack-config-for-development-2ac1d86f.cjs.dev.js → create-webpack-config-for-development-62b89920.cjs.dev.js} +7 -7
- package/dist/{create-webpack-config-for-development-be2722d6.esm.js → create-webpack-config-for-development-a28736fa.esm.js} +7 -7
- package/dist/{create-webpack-config-for-production-66c77849.esm.js → create-webpack-config-for-production-21ea561f.esm.js} +8 -8
- package/dist/{create-webpack-config-for-production-2200e554.cjs.prod.js → create-webpack-config-for-production-3b6599db.cjs.prod.js} +8 -8
- package/dist/{create-webpack-config-for-production-d2c41a9d.cjs.dev.js → create-webpack-config-for-production-e5ed8805.cjs.dev.js} +8 -8
- package/dist/{credentials-storage-381abf27.cjs.prod.js → credentials-storage-6d592cd6.cjs.prod.js} +21 -3
- package/dist/{credentials-storage-de220814.cjs.dev.js → credentials-storage-c4c5980e.cjs.dev.js} +21 -3
- package/dist/{credentials-storage-7285d7b4.esm.js → credentials-storage-fcc77fb6.esm.js} +21 -3
- package/dist/declarations/src/types.d.ts +4 -0
- package/dist/{deployment-previews-set-7f9fbfe5.esm.js → deployment-previews-set-7d49e7df.esm.js} +22 -27
- package/dist/{deployment-previews-set-3697be5e.cjs.dev.js → deployment-previews-set-8d6a1e99.cjs.dev.js} +22 -28
- package/dist/{deployment-previews-set-e92403f7.cjs.prod.js → deployment-previews-set-f8ce3db7.cjs.prod.js} +22 -28
- package/dist/{graphql-requests-bab5fcc3.cjs.dev.js → graphql-requests-b57fca4c.cjs.prod.js} +5 -8
- package/dist/{graphql-requests-d8bc2292.esm.js → graphql-requests-d2fa2ca7.esm.js} +6 -9
- package/dist/{graphql-requests-8ef89149.cjs.prod.js → graphql-requests-da194989.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-5fd67aac.cjs.prod.js → login-9774c9cc.cjs.prod.js} +154 -38
- package/dist/login-abb38213.esm.js +337 -0
- package/dist/{login-9fac9eee.cjs.dev.js → login-f4550251.cjs.dev.js} +154 -38
- 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-ff04bcf7.cjs.dev.js → package-0eebca1b.cjs.dev.js} +21 -11
- package/dist/{package-4bdd2ccf.esm.js → package-9e6910b8.esm.js} +21 -11
- package/dist/{package-428d5001.cjs.prod.js → package-b9298ce3.cjs.prod.js} +21 -11
- 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-643a55bb.esm.js → start-109f9462.esm.js} +8 -9
- package/dist/{start-47ea5e04.cjs.dev.js → start-7765f44c.cjs.dev.js} +8 -9
- package/dist/{start-84cdf12b.cjs.prod.js → start-e014127c.cjs.prod.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 +21 -11
- 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/dist/login-9ee43381.esm.js +0 -223
|
@@ -3,27 +3,29 @@
|
|
|
3
3
|
var _parseInt = require('@babel/runtime-corejs3/core-js-stable/parse-int');
|
|
4
4
|
var _JSON$stringify = require('@babel/runtime-corejs3/core-js-stable/json/stringify');
|
|
5
5
|
var _filterInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/filter');
|
|
6
|
-
var path = require('path');
|
|
6
|
+
var path$1 = require('path');
|
|
7
7
|
var pluginGraphql = require('@rollup/plugin-graphql');
|
|
8
8
|
var pluginReact = require('@vitejs/plugin-react');
|
|
9
|
-
var fs = require('fs-extra');
|
|
9
|
+
var fs$1 = require('fs-extra');
|
|
10
10
|
var rollupPluginVisualizer = require('rollup-plugin-visualizer');
|
|
11
11
|
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
|
|
19
|
+
var i18nMessageComplilation = require('./i18n-message-complilation-7311cb29.cjs.dev.js');
|
|
20
|
+
var fs = require('node:fs');
|
|
21
|
+
var path = require('node:path');
|
|
22
|
+
var glob = require('glob');
|
|
23
|
+
var vitePluginSvgr = require('./vite-plugin-svgr-7d06f400.cjs.dev.js');
|
|
21
24
|
require('@babel/runtime-corejs3/helpers/defineProperty');
|
|
22
25
|
require('@babel/runtime-corejs3/helpers/slicedToArray');
|
|
23
26
|
require('@babel/runtime-corejs3/core-js-stable/instance/reduce');
|
|
24
27
|
require('@babel/runtime-corejs3/core-js-stable/object/entries');
|
|
25
28
|
require('@babel/runtime-corejs3/core-js-stable/instance/includes');
|
|
26
|
-
require('@babel/runtime-corejs3/core-js-stable/instance/concat');
|
|
27
29
|
require('@babel/runtime-corejs3/core-js-stable/object/keys');
|
|
28
30
|
require('@babel/runtime-corejs3/core-js-stable/object/get-own-property-symbols');
|
|
29
31
|
require('@babel/runtime-corejs3/core-js-stable/object/get-own-property-descriptor');
|
|
@@ -35,38 +37,21 @@ require('chalk');
|
|
|
35
37
|
require('@babel/runtime-corejs3/core-js-stable/instance/find');
|
|
36
38
|
require('fs');
|
|
37
39
|
require('./does-file-exist-eb86baca.cjs.dev.js');
|
|
38
|
-
require('node:fs');
|
|
39
40
|
require('@babel/runtime-corejs3/core-js-stable/object/values');
|
|
40
41
|
require('crypto');
|
|
41
42
|
require('@babel/runtime-corejs3/core-js/instance/match-all');
|
|
42
43
|
|
|
43
44
|
function _interopDefault (e) { return e && e.__esModule ? e : { 'default': e }; }
|
|
44
45
|
|
|
45
|
-
function _interopNamespace(e) {
|
|
46
|
-
if (e && e.__esModule) return e;
|
|
47
|
-
var n = Object.create(null);
|
|
48
|
-
if (e) {
|
|
49
|
-
Object.keys(e).forEach(function (k) {
|
|
50
|
-
if (k !== 'default') {
|
|
51
|
-
var d = Object.getOwnPropertyDescriptor(e, k);
|
|
52
|
-
Object.defineProperty(n, k, d.get ? d : {
|
|
53
|
-
enumerable: true,
|
|
54
|
-
get: function () { return e[k]; }
|
|
55
|
-
});
|
|
56
|
-
}
|
|
57
|
-
});
|
|
58
|
-
}
|
|
59
|
-
n["default"] = e;
|
|
60
|
-
return Object.freeze(n);
|
|
61
|
-
}
|
|
62
|
-
|
|
63
46
|
var _parseInt__default = /*#__PURE__*/_interopDefault(_parseInt);
|
|
64
47
|
var _JSON$stringify__default = /*#__PURE__*/_interopDefault(_JSON$stringify);
|
|
65
48
|
var _filterInstanceProperty__default = /*#__PURE__*/_interopDefault(_filterInstanceProperty);
|
|
66
|
-
var path__default = /*#__PURE__*/_interopDefault(path);
|
|
49
|
+
var path__default$1 = /*#__PURE__*/_interopDefault(path$1);
|
|
67
50
|
var pluginGraphql__default = /*#__PURE__*/_interopDefault(pluginGraphql);
|
|
68
51
|
var pluginReact__default = /*#__PURE__*/_interopDefault(pluginReact);
|
|
52
|
+
var fs__default$1 = /*#__PURE__*/_interopDefault(fs$1);
|
|
69
53
|
var fs__default = /*#__PURE__*/_interopDefault(fs);
|
|
54
|
+
var path__default = /*#__PURE__*/_interopDefault(path);
|
|
70
55
|
|
|
71
56
|
// Type guard to help with filtering arrays for nullish elements.
|
|
72
57
|
function nonNullable(value) {
|
|
@@ -76,7 +61,7 @@ function nonNullable(value) {
|
|
|
76
61
|
// This script/function is injected into the `index.html` and used by Vite
|
|
77
62
|
// on runtime to build the assets URL (for example when using a separate CDN for the assets).
|
|
78
63
|
// Inspired by https://github.com/vitejs/vite/blob/main/playground/assets/vite.config-runtime-base.js
|
|
79
|
-
const dynamicBaseAssetsCode =
|
|
64
|
+
const dynamicBaseAssetsCode = `globalThis.__toCdnUrl = filePath => window.app.cdnUrl.replace(/\\/$/, '') + '/' + filePath;`;
|
|
80
65
|
function vitePluginDynamicBaseAssetsGlobals() {
|
|
81
66
|
return {
|
|
82
67
|
name: 'dynamic-base-assets-globals',
|
|
@@ -122,25 +107,62 @@ function vitePluginI18nMessageCompilation() {
|
|
|
122
107
|
};
|
|
123
108
|
}
|
|
124
109
|
|
|
110
|
+
/**
|
|
111
|
+
* A simple Vite plugin to clean up files matching glob patterns after build.
|
|
112
|
+
* Replaces `vite-plugin-post-cleanup` to avoid the `inflight` vulnerability
|
|
113
|
+
* in its transitive dependencies.
|
|
114
|
+
*/
|
|
115
|
+
function pluginPostCleanup(options) {
|
|
116
|
+
return {
|
|
117
|
+
name: 'vite-plugin-post-cleanup',
|
|
118
|
+
apply: 'build',
|
|
119
|
+
closeBundle() {
|
|
120
|
+
const outputDir = options.outputDir,
|
|
121
|
+
patterns = options.patterns,
|
|
122
|
+
verbose = options.verbose;
|
|
123
|
+
let totalFilesDeleted = 0;
|
|
124
|
+
for (const pattern of patterns) {
|
|
125
|
+
const files = glob.globSync(pattern, {
|
|
126
|
+
cwd: outputDir
|
|
127
|
+
});
|
|
128
|
+
for (const file of files) {
|
|
129
|
+
const filePath = path__default["default"].join(outputDir, file);
|
|
130
|
+
try {
|
|
131
|
+
fs__default["default"].unlinkSync(filePath);
|
|
132
|
+
totalFilesDeleted++;
|
|
133
|
+
if (verbose) {
|
|
134
|
+
console.log(`[post-cleanup] Deleted: ${file}`);
|
|
135
|
+
}
|
|
136
|
+
} catch (error) {
|
|
137
|
+
console.warn(`[post-cleanup] Failed to delete ${file}:`, error);
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
if (verbose && patterns.length > 0 && totalFilesDeleted === 0) {
|
|
142
|
+
console.log('[post-cleanup] No files matched the patterns');
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
};
|
|
146
|
+
}
|
|
147
|
+
|
|
125
148
|
async function run() {
|
|
126
149
|
var _context;
|
|
127
|
-
const CleanBuild = (await Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require('vite-plugin-clean-build')); })).default;
|
|
128
150
|
const DEFAULT_PORT = _parseInt__default["default"](String(process.env.HTTP_PORT), 10) || 3001;
|
|
129
151
|
|
|
130
152
|
// Ensure the `/public` folder exists.
|
|
131
|
-
fs__default["default"].mkdirSync(paths.paths.appBuild, {
|
|
153
|
+
fs__default$1["default"].mkdirSync(paths.paths.appBuild, {
|
|
132
154
|
recursive: true
|
|
133
155
|
});
|
|
134
156
|
|
|
135
157
|
// Generate `index.html` (template).
|
|
136
|
-
const appEntryPoint = path__default["default"].relative(paths.paths.appRoot, paths.paths.entryPoint);
|
|
158
|
+
const appEntryPoint = path__default$1["default"].relative(paths.paths.appRoot, paths.paths.entryPoint);
|
|
137
159
|
const html = mcHtmlTemplate.generateTemplate({
|
|
138
160
|
// Define the module entry point (path relative from the `/public` folder).
|
|
139
161
|
// NOTE: that this is different from the development configuration.
|
|
140
|
-
scriptImports: [
|
|
162
|
+
scriptImports: [`<script type="module" src="/${appEntryPoint}" defer></script>`]
|
|
141
163
|
});
|
|
142
164
|
// Write `index.html` (template) into the `/public` folder.
|
|
143
|
-
fs__default["default"].writeFileSync(paths.paths.appIndexHtml, html, {
|
|
165
|
+
fs__default$1["default"].writeFileSync(paths.paths.appIndexHtml, html, {
|
|
144
166
|
encoding: 'utf8'
|
|
145
167
|
});
|
|
146
168
|
const appDependencies = require(paths.paths.appPackageJson).dependencies;
|
|
@@ -183,10 +205,10 @@ async function run() {
|
|
|
183
205
|
renderBuiltUrl(filename, _ref) {
|
|
184
206
|
let hostType = _ref.hostType;
|
|
185
207
|
if (hostType === 'html') {
|
|
186
|
-
return
|
|
208
|
+
return `__CDN_URL__${filename}`;
|
|
187
209
|
}
|
|
188
210
|
return {
|
|
189
|
-
runtime:
|
|
211
|
+
runtime: `window.__toCdnUrl(${_JSON$stringify__default["default"](filename)})`
|
|
190
212
|
};
|
|
191
213
|
}
|
|
192
214
|
},
|
|
@@ -202,12 +224,11 @@ async function run() {
|
|
|
202
224
|
// Enable pre-parse default `formatjs` messages into AST.
|
|
203
225
|
// TODO: make it a CLI option when Vite support becomes stable.
|
|
204
226
|
process.env.ENABLE_I18N_AST === 'true'
|
|
205
|
-
}] : undefined]).call(_context, nonNullable)
|
|
227
|
+
}] : undefined, process.env.ENABLE_BABEL_REACT_COMPILER === 'true' ? 'babel-plugin-react-compiler' : undefined]).call(_context, nonNullable)
|
|
206
228
|
}
|
|
207
229
|
}),
|
|
208
|
-
//
|
|
209
|
-
|
|
210
|
-
CleanBuild({
|
|
230
|
+
// Clean up large SVG assets that are not used after the build.
|
|
231
|
+
pluginPostCleanup({
|
|
211
232
|
outputDir: paths.paths.appBuild,
|
|
212
233
|
patterns: ['*.react-*.svg'],
|
|
213
234
|
verbose: true // logs the files that are removed
|
|
@@ -221,17 +242,17 @@ async function run() {
|
|
|
221
242
|
});
|
|
222
243
|
|
|
223
244
|
// Rename `/public/public/index.html` to `/public/index.html.template`
|
|
224
|
-
fs__default["default"].renameSync(
|
|
245
|
+
fs__default$1["default"].renameSync(
|
|
225
246
|
// Because of our custom entry point path (`/public/index.html`),
|
|
226
247
|
// Vite will write the `index.html` to `/public/public/index.html`.
|
|
227
248
|
// We need to move this file to the `/public` folder and rename it
|
|
228
249
|
// to `index.html.template` (as expected by the `compile-html` command).
|
|
229
|
-
path__default["default"].join(paths.paths.appBuild, 'public/index.html'), paths.paths.appIndexHtmlTemplate);
|
|
250
|
+
path__default$1["default"].join(paths.paths.appBuild, 'public/index.html'), paths.paths.appIndexHtmlTemplate);
|
|
230
251
|
// Clean up nested folder
|
|
231
|
-
fs__default["default"].rmdirSync(path__default["default"].join(paths.paths.appBuild, 'public'));
|
|
252
|
+
fs__default$1["default"].rmdirSync(path__default$1["default"].join(paths.paths.appBuild, 'public'));
|
|
232
253
|
|
|
233
254
|
// Copy public assets
|
|
234
|
-
fs__default["default"].copySync(path__default["default"].join(assets.packageLocation, 'html-page'), paths.paths.appBuild, {
|
|
255
|
+
fs__default$1["default"].copySync(path__default$1["default"].join(assets.packageLocation, 'html-page'), paths.paths.appBuild, {
|
|
235
256
|
dereference: true
|
|
236
257
|
});
|
|
237
258
|
}
|
|
@@ -1,27 +1,29 @@
|
|
|
1
1
|
import _parseInt from '@babel/runtime-corejs3/core-js-stable/parse-int';
|
|
2
2
|
import _JSON$stringify from '@babel/runtime-corejs3/core-js-stable/json/stringify';
|
|
3
3
|
import _filterInstanceProperty from '@babel/runtime-corejs3/core-js-stable/instance/filter';
|
|
4
|
-
import path from 'path';
|
|
4
|
+
import path$1 from 'path';
|
|
5
5
|
import pluginGraphql from '@rollup/plugin-graphql';
|
|
6
6
|
import pluginReact from '@vitejs/plugin-react';
|
|
7
|
-
import fs from 'fs-extra';
|
|
7
|
+
import fs$1 from 'fs-extra';
|
|
8
8
|
import { visualizer } from 'rollup-plugin-visualizer';
|
|
9
9
|
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
|
|
17
|
+
import { g as getI18nMessageFormat, h as handleMessageCompilationError } from './i18n-message-complilation-21d3b0aa.esm.js';
|
|
18
|
+
import fs from 'node:fs';
|
|
19
|
+
import path from 'node:path';
|
|
20
|
+
import { globSync } from 'glob';
|
|
21
|
+
import { v as vitePluginSvgr } from './vite-plugin-svgr-de6ee7da.esm.js';
|
|
19
22
|
import '@babel/runtime-corejs3/helpers/defineProperty';
|
|
20
23
|
import '@babel/runtime-corejs3/helpers/slicedToArray';
|
|
21
24
|
import '@babel/runtime-corejs3/core-js-stable/instance/reduce';
|
|
22
25
|
import '@babel/runtime-corejs3/core-js-stable/object/entries';
|
|
23
26
|
import '@babel/runtime-corejs3/core-js-stable/instance/includes';
|
|
24
|
-
import '@babel/runtime-corejs3/core-js-stable/instance/concat';
|
|
25
27
|
import '@babel/runtime-corejs3/core-js-stable/object/keys';
|
|
26
28
|
import '@babel/runtime-corejs3/core-js-stable/object/get-own-property-symbols';
|
|
27
29
|
import '@babel/runtime-corejs3/core-js-stable/object/get-own-property-descriptor';
|
|
@@ -33,7 +35,6 @@ import 'chalk';
|
|
|
33
35
|
import '@babel/runtime-corejs3/core-js-stable/instance/find';
|
|
34
36
|
import 'fs';
|
|
35
37
|
import './does-file-exist-32618334.esm.js';
|
|
36
|
-
import 'node:fs';
|
|
37
38
|
import '@babel/runtime-corejs3/core-js-stable/object/values';
|
|
38
39
|
import 'crypto';
|
|
39
40
|
import '@babel/runtime-corejs3/core-js/instance/match-all';
|
|
@@ -46,7 +47,7 @@ function nonNullable(value) {
|
|
|
46
47
|
// This script/function is injected into the `index.html` and used by Vite
|
|
47
48
|
// on runtime to build the assets URL (for example when using a separate CDN for the assets).
|
|
48
49
|
// Inspired by https://github.com/vitejs/vite/blob/main/playground/assets/vite.config-runtime-base.js
|
|
49
|
-
const dynamicBaseAssetsCode =
|
|
50
|
+
const dynamicBaseAssetsCode = `globalThis.__toCdnUrl = filePath => window.app.cdnUrl.replace(/\\/$/, '') + '/' + filePath;`;
|
|
50
51
|
function vitePluginDynamicBaseAssetsGlobals() {
|
|
51
52
|
return {
|
|
52
53
|
name: 'dynamic-base-assets-globals',
|
|
@@ -92,25 +93,62 @@ function vitePluginI18nMessageCompilation() {
|
|
|
92
93
|
};
|
|
93
94
|
}
|
|
94
95
|
|
|
96
|
+
/**
|
|
97
|
+
* A simple Vite plugin to clean up files matching glob patterns after build.
|
|
98
|
+
* Replaces `vite-plugin-post-cleanup` to avoid the `inflight` vulnerability
|
|
99
|
+
* in its transitive dependencies.
|
|
100
|
+
*/
|
|
101
|
+
function pluginPostCleanup(options) {
|
|
102
|
+
return {
|
|
103
|
+
name: 'vite-plugin-post-cleanup',
|
|
104
|
+
apply: 'build',
|
|
105
|
+
closeBundle() {
|
|
106
|
+
const outputDir = options.outputDir,
|
|
107
|
+
patterns = options.patterns,
|
|
108
|
+
verbose = options.verbose;
|
|
109
|
+
let totalFilesDeleted = 0;
|
|
110
|
+
for (const pattern of patterns) {
|
|
111
|
+
const files = globSync(pattern, {
|
|
112
|
+
cwd: outputDir
|
|
113
|
+
});
|
|
114
|
+
for (const file of files) {
|
|
115
|
+
const filePath = path.join(outputDir, file);
|
|
116
|
+
try {
|
|
117
|
+
fs.unlinkSync(filePath);
|
|
118
|
+
totalFilesDeleted++;
|
|
119
|
+
if (verbose) {
|
|
120
|
+
console.log(`[post-cleanup] Deleted: ${file}`);
|
|
121
|
+
}
|
|
122
|
+
} catch (error) {
|
|
123
|
+
console.warn(`[post-cleanup] Failed to delete ${file}:`, error);
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
if (verbose && patterns.length > 0 && totalFilesDeleted === 0) {
|
|
128
|
+
console.log('[post-cleanup] No files matched the patterns');
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
};
|
|
132
|
+
}
|
|
133
|
+
|
|
95
134
|
async function run() {
|
|
96
135
|
var _context;
|
|
97
|
-
const CleanBuild = (await import('vite-plugin-clean-build')).default;
|
|
98
136
|
const DEFAULT_PORT = _parseInt(String(process.env.HTTP_PORT), 10) || 3001;
|
|
99
137
|
|
|
100
138
|
// Ensure the `/public` folder exists.
|
|
101
|
-
fs.mkdirSync(paths.appBuild, {
|
|
139
|
+
fs$1.mkdirSync(paths.appBuild, {
|
|
102
140
|
recursive: true
|
|
103
141
|
});
|
|
104
142
|
|
|
105
143
|
// Generate `index.html` (template).
|
|
106
|
-
const appEntryPoint = path.relative(paths.appRoot, paths.entryPoint);
|
|
144
|
+
const appEntryPoint = path$1.relative(paths.appRoot, paths.entryPoint);
|
|
107
145
|
const html = generateTemplate({
|
|
108
146
|
// Define the module entry point (path relative from the `/public` folder).
|
|
109
147
|
// NOTE: that this is different from the development configuration.
|
|
110
|
-
scriptImports: [
|
|
148
|
+
scriptImports: [`<script type="module" src="/${appEntryPoint}" defer></script>`]
|
|
111
149
|
});
|
|
112
150
|
// Write `index.html` (template) into the `/public` folder.
|
|
113
|
-
fs.writeFileSync(paths.appIndexHtml, html, {
|
|
151
|
+
fs$1.writeFileSync(paths.appIndexHtml, html, {
|
|
114
152
|
encoding: 'utf8'
|
|
115
153
|
});
|
|
116
154
|
const appDependencies = require(paths.appPackageJson).dependencies;
|
|
@@ -153,10 +191,10 @@ async function run() {
|
|
|
153
191
|
renderBuiltUrl(filename, _ref) {
|
|
154
192
|
let hostType = _ref.hostType;
|
|
155
193
|
if (hostType === 'html') {
|
|
156
|
-
return
|
|
194
|
+
return `__CDN_URL__${filename}`;
|
|
157
195
|
}
|
|
158
196
|
return {
|
|
159
|
-
runtime:
|
|
197
|
+
runtime: `window.__toCdnUrl(${_JSON$stringify(filename)})`
|
|
160
198
|
};
|
|
161
199
|
}
|
|
162
200
|
},
|
|
@@ -172,12 +210,11 @@ async function run() {
|
|
|
172
210
|
// Enable pre-parse default `formatjs` messages into AST.
|
|
173
211
|
// TODO: make it a CLI option when Vite support becomes stable.
|
|
174
212
|
process.env.ENABLE_I18N_AST === 'true'
|
|
175
|
-
}] : undefined]).call(_context, nonNullable)
|
|
213
|
+
}] : undefined, process.env.ENABLE_BABEL_REACT_COMPILER === 'true' ? 'babel-plugin-react-compiler' : undefined]).call(_context, nonNullable)
|
|
176
214
|
}
|
|
177
215
|
}),
|
|
178
|
-
//
|
|
179
|
-
|
|
180
|
-
CleanBuild({
|
|
216
|
+
// Clean up large SVG assets that are not used after the build.
|
|
217
|
+
pluginPostCleanup({
|
|
181
218
|
outputDir: paths.appBuild,
|
|
182
219
|
patterns: ['*.react-*.svg'],
|
|
183
220
|
verbose: true // logs the files that are removed
|
|
@@ -191,17 +228,17 @@ async function run() {
|
|
|
191
228
|
});
|
|
192
229
|
|
|
193
230
|
// Rename `/public/public/index.html` to `/public/index.html.template`
|
|
194
|
-
fs.renameSync(
|
|
231
|
+
fs$1.renameSync(
|
|
195
232
|
// Because of our custom entry point path (`/public/index.html`),
|
|
196
233
|
// Vite will write the `index.html` to `/public/public/index.html`.
|
|
197
234
|
// We need to move this file to the `/public` folder and rename it
|
|
198
235
|
// to `index.html.template` (as expected by the `compile-html` command).
|
|
199
|
-
path.join(paths.appBuild, 'public/index.html'), paths.appIndexHtmlTemplate);
|
|
236
|
+
path$1.join(paths.appBuild, 'public/index.html'), paths.appIndexHtmlTemplate);
|
|
200
237
|
// Clean up nested folder
|
|
201
|
-
fs.rmdirSync(path.join(paths.appBuild, 'public'));
|
|
238
|
+
fs$1.rmdirSync(path$1.join(paths.appBuild, 'public'));
|
|
202
239
|
|
|
203
240
|
// Copy public assets
|
|
204
|
-
fs.copySync(path.join(packageLocation, 'html-page'), paths.appBuild, {
|
|
241
|
+
fs$1.copySync(path$1.join(packageLocation, 'html-page'), paths.appBuild, {
|
|
205
242
|
dereference: true
|
|
206
243
|
});
|
|
207
244
|
}
|
|
@@ -3,27 +3,29 @@
|
|
|
3
3
|
var _parseInt = require('@babel/runtime-corejs3/core-js-stable/parse-int');
|
|
4
4
|
var _JSON$stringify = require('@babel/runtime-corejs3/core-js-stable/json/stringify');
|
|
5
5
|
var _filterInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/filter');
|
|
6
|
-
var path = require('path');
|
|
6
|
+
var path$1 = require('path');
|
|
7
7
|
var pluginGraphql = require('@rollup/plugin-graphql');
|
|
8
8
|
var pluginReact = require('@vitejs/plugin-react');
|
|
9
|
-
var fs = require('fs-extra');
|
|
9
|
+
var fs$1 = require('fs-extra');
|
|
10
10
|
var rollupPluginVisualizer = require('rollup-plugin-visualizer');
|
|
11
11
|
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
|
|
19
|
+
var i18nMessageComplilation = require('./i18n-message-complilation-7762da61.cjs.prod.js');
|
|
20
|
+
var fs = require('node:fs');
|
|
21
|
+
var path = require('node:path');
|
|
22
|
+
var glob = require('glob');
|
|
23
|
+
var vitePluginSvgr = require('./vite-plugin-svgr-4034a834.cjs.prod.js');
|
|
21
24
|
require('@babel/runtime-corejs3/helpers/defineProperty');
|
|
22
25
|
require('@babel/runtime-corejs3/helpers/slicedToArray');
|
|
23
26
|
require('@babel/runtime-corejs3/core-js-stable/instance/reduce');
|
|
24
27
|
require('@babel/runtime-corejs3/core-js-stable/object/entries');
|
|
25
28
|
require('@babel/runtime-corejs3/core-js-stable/instance/includes');
|
|
26
|
-
require('@babel/runtime-corejs3/core-js-stable/instance/concat');
|
|
27
29
|
require('@babel/runtime-corejs3/core-js-stable/object/keys');
|
|
28
30
|
require('@babel/runtime-corejs3/core-js-stable/object/get-own-property-symbols');
|
|
29
31
|
require('@babel/runtime-corejs3/core-js-stable/object/get-own-property-descriptor');
|
|
@@ -35,38 +37,21 @@ require('chalk');
|
|
|
35
37
|
require('@babel/runtime-corejs3/core-js-stable/instance/find');
|
|
36
38
|
require('fs');
|
|
37
39
|
require('./does-file-exist-be53305d.cjs.prod.js');
|
|
38
|
-
require('node:fs');
|
|
39
40
|
require('@babel/runtime-corejs3/core-js-stable/object/values');
|
|
40
41
|
require('crypto');
|
|
41
42
|
require('@babel/runtime-corejs3/core-js/instance/match-all');
|
|
42
43
|
|
|
43
44
|
function _interopDefault (e) { return e && e.__esModule ? e : { 'default': e }; }
|
|
44
45
|
|
|
45
|
-
function _interopNamespace(e) {
|
|
46
|
-
if (e && e.__esModule) return e;
|
|
47
|
-
var n = Object.create(null);
|
|
48
|
-
if (e) {
|
|
49
|
-
Object.keys(e).forEach(function (k) {
|
|
50
|
-
if (k !== 'default') {
|
|
51
|
-
var d = Object.getOwnPropertyDescriptor(e, k);
|
|
52
|
-
Object.defineProperty(n, k, d.get ? d : {
|
|
53
|
-
enumerable: true,
|
|
54
|
-
get: function () { return e[k]; }
|
|
55
|
-
});
|
|
56
|
-
}
|
|
57
|
-
});
|
|
58
|
-
}
|
|
59
|
-
n["default"] = e;
|
|
60
|
-
return Object.freeze(n);
|
|
61
|
-
}
|
|
62
|
-
|
|
63
46
|
var _parseInt__default = /*#__PURE__*/_interopDefault(_parseInt);
|
|
64
47
|
var _JSON$stringify__default = /*#__PURE__*/_interopDefault(_JSON$stringify);
|
|
65
48
|
var _filterInstanceProperty__default = /*#__PURE__*/_interopDefault(_filterInstanceProperty);
|
|
66
|
-
var path__default = /*#__PURE__*/_interopDefault(path);
|
|
49
|
+
var path__default$1 = /*#__PURE__*/_interopDefault(path$1);
|
|
67
50
|
var pluginGraphql__default = /*#__PURE__*/_interopDefault(pluginGraphql);
|
|
68
51
|
var pluginReact__default = /*#__PURE__*/_interopDefault(pluginReact);
|
|
52
|
+
var fs__default$1 = /*#__PURE__*/_interopDefault(fs$1);
|
|
69
53
|
var fs__default = /*#__PURE__*/_interopDefault(fs);
|
|
54
|
+
var path__default = /*#__PURE__*/_interopDefault(path);
|
|
70
55
|
|
|
71
56
|
// Type guard to help with filtering arrays for nullish elements.
|
|
72
57
|
function nonNullable(value) {
|
|
@@ -76,7 +61,7 @@ function nonNullable(value) {
|
|
|
76
61
|
// This script/function is injected into the `index.html` and used by Vite
|
|
77
62
|
// on runtime to build the assets URL (for example when using a separate CDN for the assets).
|
|
78
63
|
// Inspired by https://github.com/vitejs/vite/blob/main/playground/assets/vite.config-runtime-base.js
|
|
79
|
-
const dynamicBaseAssetsCode =
|
|
64
|
+
const dynamicBaseAssetsCode = `globalThis.__toCdnUrl = filePath => window.app.cdnUrl.replace(/\\/$/, '') + '/' + filePath;`;
|
|
80
65
|
function vitePluginDynamicBaseAssetsGlobals() {
|
|
81
66
|
return {
|
|
82
67
|
name: 'dynamic-base-assets-globals',
|
|
@@ -122,25 +107,62 @@ function vitePluginI18nMessageCompilation() {
|
|
|
122
107
|
};
|
|
123
108
|
}
|
|
124
109
|
|
|
110
|
+
/**
|
|
111
|
+
* A simple Vite plugin to clean up files matching glob patterns after build.
|
|
112
|
+
* Replaces `vite-plugin-post-cleanup` to avoid the `inflight` vulnerability
|
|
113
|
+
* in its transitive dependencies.
|
|
114
|
+
*/
|
|
115
|
+
function pluginPostCleanup(options) {
|
|
116
|
+
return {
|
|
117
|
+
name: 'vite-plugin-post-cleanup',
|
|
118
|
+
apply: 'build',
|
|
119
|
+
closeBundle() {
|
|
120
|
+
const outputDir = options.outputDir,
|
|
121
|
+
patterns = options.patterns,
|
|
122
|
+
verbose = options.verbose;
|
|
123
|
+
let totalFilesDeleted = 0;
|
|
124
|
+
for (const pattern of patterns) {
|
|
125
|
+
const files = glob.globSync(pattern, {
|
|
126
|
+
cwd: outputDir
|
|
127
|
+
});
|
|
128
|
+
for (const file of files) {
|
|
129
|
+
const filePath = path__default["default"].join(outputDir, file);
|
|
130
|
+
try {
|
|
131
|
+
fs__default["default"].unlinkSync(filePath);
|
|
132
|
+
totalFilesDeleted++;
|
|
133
|
+
if (verbose) {
|
|
134
|
+
console.log(`[post-cleanup] Deleted: ${file}`);
|
|
135
|
+
}
|
|
136
|
+
} catch (error) {
|
|
137
|
+
console.warn(`[post-cleanup] Failed to delete ${file}:`, error);
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
if (verbose && patterns.length > 0 && totalFilesDeleted === 0) {
|
|
142
|
+
console.log('[post-cleanup] No files matched the patterns');
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
};
|
|
146
|
+
}
|
|
147
|
+
|
|
125
148
|
async function run() {
|
|
126
149
|
var _context;
|
|
127
|
-
const CleanBuild = (await Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require('vite-plugin-clean-build')); })).default;
|
|
128
150
|
const DEFAULT_PORT = _parseInt__default["default"](String(process.env.HTTP_PORT), 10) || 3001;
|
|
129
151
|
|
|
130
152
|
// Ensure the `/public` folder exists.
|
|
131
|
-
fs__default["default"].mkdirSync(paths.paths.appBuild, {
|
|
153
|
+
fs__default$1["default"].mkdirSync(paths.paths.appBuild, {
|
|
132
154
|
recursive: true
|
|
133
155
|
});
|
|
134
156
|
|
|
135
157
|
// Generate `index.html` (template).
|
|
136
|
-
const appEntryPoint = path__default["default"].relative(paths.paths.appRoot, paths.paths.entryPoint);
|
|
158
|
+
const appEntryPoint = path__default$1["default"].relative(paths.paths.appRoot, paths.paths.entryPoint);
|
|
137
159
|
const html = mcHtmlTemplate.generateTemplate({
|
|
138
160
|
// Define the module entry point (path relative from the `/public` folder).
|
|
139
161
|
// NOTE: that this is different from the development configuration.
|
|
140
|
-
scriptImports: [
|
|
162
|
+
scriptImports: [`<script type="module" src="/${appEntryPoint}" defer></script>`]
|
|
141
163
|
});
|
|
142
164
|
// Write `index.html` (template) into the `/public` folder.
|
|
143
|
-
fs__default["default"].writeFileSync(paths.paths.appIndexHtml, html, {
|
|
165
|
+
fs__default$1["default"].writeFileSync(paths.paths.appIndexHtml, html, {
|
|
144
166
|
encoding: 'utf8'
|
|
145
167
|
});
|
|
146
168
|
const appDependencies = require(paths.paths.appPackageJson).dependencies;
|
|
@@ -183,10 +205,10 @@ async function run() {
|
|
|
183
205
|
renderBuiltUrl(filename, _ref) {
|
|
184
206
|
let hostType = _ref.hostType;
|
|
185
207
|
if (hostType === 'html') {
|
|
186
|
-
return
|
|
208
|
+
return `__CDN_URL__${filename}`;
|
|
187
209
|
}
|
|
188
210
|
return {
|
|
189
|
-
runtime:
|
|
211
|
+
runtime: `window.__toCdnUrl(${_JSON$stringify__default["default"](filename)})`
|
|
190
212
|
};
|
|
191
213
|
}
|
|
192
214
|
},
|
|
@@ -202,12 +224,11 @@ async function run() {
|
|
|
202
224
|
// Enable pre-parse default `formatjs` messages into AST.
|
|
203
225
|
// TODO: make it a CLI option when Vite support becomes stable.
|
|
204
226
|
process.env.ENABLE_I18N_AST === 'true'
|
|
205
|
-
}] : undefined]).call(_context, nonNullable)
|
|
227
|
+
}] : undefined, process.env.ENABLE_BABEL_REACT_COMPILER === 'true' ? 'babel-plugin-react-compiler' : undefined]).call(_context, nonNullable)
|
|
206
228
|
}
|
|
207
229
|
}),
|
|
208
|
-
//
|
|
209
|
-
|
|
210
|
-
CleanBuild({
|
|
230
|
+
// Clean up large SVG assets that are not used after the build.
|
|
231
|
+
pluginPostCleanup({
|
|
211
232
|
outputDir: paths.paths.appBuild,
|
|
212
233
|
patterns: ['*.react-*.svg'],
|
|
213
234
|
verbose: true // logs the files that are removed
|
|
@@ -221,17 +242,17 @@ async function run() {
|
|
|
221
242
|
});
|
|
222
243
|
|
|
223
244
|
// Rename `/public/public/index.html` to `/public/index.html.template`
|
|
224
|
-
fs__default["default"].renameSync(
|
|
245
|
+
fs__default$1["default"].renameSync(
|
|
225
246
|
// Because of our custom entry point path (`/public/index.html`),
|
|
226
247
|
// Vite will write the `index.html` to `/public/public/index.html`.
|
|
227
248
|
// We need to move this file to the `/public` folder and rename it
|
|
228
249
|
// to `index.html.template` (as expected by the `compile-html` command).
|
|
229
|
-
path__default["default"].join(paths.paths.appBuild, 'public/index.html'), paths.paths.appIndexHtmlTemplate);
|
|
250
|
+
path__default$1["default"].join(paths.paths.appBuild, 'public/index.html'), paths.paths.appIndexHtmlTemplate);
|
|
230
251
|
// Clean up nested folder
|
|
231
|
-
fs__default["default"].rmdirSync(path__default["default"].join(paths.paths.appBuild, 'public'));
|
|
252
|
+
fs__default$1["default"].rmdirSync(path__default$1["default"].join(paths.paths.appBuild, 'public'));
|
|
232
253
|
|
|
233
254
|
// Copy public assets
|
|
234
|
-
fs__default["default"].copySync(path__default["default"].join(assets.packageLocation, 'html-page'), paths.paths.appBuild, {
|
|
255
|
+
fs__default$1["default"].copySync(path__default$1["default"].join(assets.packageLocation, 'html-page'), paths.paths.appBuild, {
|
|
235
256
|
dereference: true
|
|
236
257
|
});
|
|
237
258
|
}
|
|
@@ -5,7 +5,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
5
5
|
var vendorsToTranspile = require('./vendors-to-transpile-6ab4ea06.cjs.dev.js');
|
|
6
6
|
|
|
7
7
|
// NOTE: This string will be replaced on build time with the package version.
|
|
8
|
-
var version = "25.
|
|
8
|
+
var version = "25.2.0";
|
|
9
9
|
|
|
10
10
|
// These exports are deprecated.
|
|
11
11
|
|
|
@@ -5,7 +5,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
5
5
|
var vendorsToTranspile = require('./vendors-to-transpile-04a49d40.cjs.prod.js');
|
|
6
6
|
|
|
7
7
|
// NOTE: This string will be replaced on build time with the package version.
|
|
8
|
-
var version = "25.
|
|
8
|
+
var version = "25.2.0";
|
|
9
9
|
|
|
10
10
|
// These exports are deprecated.
|
|
11
11
|
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import _concatInstanceProperty from '@babel/runtime-corejs3/core-js-stable/instance/concat';
|
|
2
1
|
import _JSON$stringify from '@babel/runtime-corejs3/core-js-stable/json/stringify';
|
|
3
2
|
import fs from 'fs';
|
|
4
3
|
import chalk from 'chalk';
|
|
5
4
|
import { compileHtml } from '@commercetools-frontend/mc-html-template';
|
|
6
|
-
import { p as paths } from './paths-
|
|
5
|
+
import { p as paths } from './paths-39f22b8b.esm.js';
|
|
7
6
|
import '@babel/runtime-corejs3/core-js-stable/instance/find';
|
|
8
7
|
import 'path';
|
|
9
8
|
import './does-file-exist-32618334.esm.js';
|
|
@@ -24,8 +23,7 @@ async function run(options) {
|
|
|
24
23
|
const transformerFn = require(transformerPath);
|
|
25
24
|
transformerFn(compiled);
|
|
26
25
|
} catch (error) {
|
|
27
|
-
|
|
28
|
-
throw new Error(_concatInstanceProperty(_context = "Could not load transformer module \"".concat(options.transformer, "\"\n")).call(_context, error instanceof Error ? error.stack : ''));
|
|
26
|
+
throw new Error(`Could not load transformer module "${options.transformer}"\n${error instanceof Error ? error.stack : ''}`);
|
|
29
27
|
}
|
|
30
28
|
} else if (options.printSecurityHeaders) {
|
|
31
29
|
console.log(_JSON$stringify(compiled.headers));
|