@commercetools-frontend/mc-scripts 22.2.1 → 22.3.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/cli/dist/commercetools-frontend-mc-scripts-cli.cjs.dev.js +51 -41
- package/cli/dist/commercetools-frontend-mc-scripts-cli.cjs.prod.js +51 -41
- package/cli/dist/commercetools-frontend-mc-scripts-cli.esm.js +51 -41
- package/dist/{build-72d9896f.esm.js → build-8227e71d.esm.js} +22 -31
- package/dist/{build-4773d61a.cjs.dev.js → build-a888cacd.cjs.dev.js} +22 -31
- package/dist/{build-0ef080b9.cjs.prod.js → build-a9f085a0.cjs.prod.js} +22 -31
- package/dist/{build-vite-2dc2b366.cjs.prod.js → build-vite-1ba28dd8.cjs.prod.js} +18 -19
- package/dist/{build-vite-290aaf04.esm.js → build-vite-9de4820c.esm.js} +18 -19
- package/dist/{build-vite-b5c7ac91.cjs.dev.js → build-vite-e7a6315c.cjs.dev.js} +18 -19
- package/dist/commercetools-frontend-mc-scripts.cjs.dev.js +2 -3
- package/dist/commercetools-frontend-mc-scripts.cjs.prod.js +2 -3
- package/dist/commercetools-frontend-mc-scripts.esm.js +2 -3
- package/dist/{compile-html-41195e35.cjs.dev.js → compile-html-079067bd.cjs.prod.js} +1 -7
- package/dist/{compile-html-5abd78aa.cjs.prod.js → compile-html-3ff2fed0.cjs.dev.js} +1 -7
- package/dist/{compile-html-f9de842c.esm.js → compile-html-606b302e.esm.js} +1 -7
- package/dist/{config-sync-8e8e18a9.cjs.prod.js → config-sync-058dca05.cjs.prod.js} +81 -193
- package/dist/{config-sync-c914ca7a.cjs.dev.js → config-sync-866d8c22.cjs.dev.js} +83 -194
- package/dist/{config-sync-54299066.esm.js → config-sync-dc5a68ed.esm.js} +83 -194
- package/dist/{create-postcss-config-f39f54b5.esm.js → create-postcss-config-9d266de4.esm.js} +9 -13
- package/dist/{create-postcss-config-a0659cf5.cjs.dev.js → create-postcss-config-a29e83fc.cjs.dev.js} +9 -13
- package/dist/{create-postcss-config-6277233e.cjs.prod.js → create-postcss-config-d4f8ca51.cjs.prod.js} +9 -13
- package/dist/{create-webpack-config-for-development-629a8982.cjs.prod.js → create-webpack-config-for-development-02fa9041.cjs.prod.js} +46 -37
- package/dist/{create-webpack-config-for-development-9539f804.esm.js → create-webpack-config-for-development-17376d1f.esm.js} +46 -37
- package/dist/{create-webpack-config-for-development-9aa85081.cjs.dev.js → create-webpack-config-for-development-ac4ad0b2.cjs.dev.js} +46 -37
- package/dist/{create-webpack-config-for-production-84e2db7d.cjs.prod.js → create-webpack-config-for-production-190c7797.cjs.prod.js} +37 -32
- package/dist/{create-webpack-config-for-production-4476fc5f.esm.js → create-webpack-config-for-production-25d7c593.esm.js} +37 -32
- package/dist/{create-webpack-config-for-production-0fac47e1.cjs.dev.js → create-webpack-config-for-production-c1ec1058.cjs.dev.js} +37 -32
- package/dist/{credentials-storage-5939dd35.esm.js → credentials-storage-5a3b88be.esm.js} +3 -15
- package/dist/{credentials-storage-da0754c9.cjs.dev.js → credentials-storage-5d3da1c0.cjs.prod.js} +3 -15
- package/dist/{credentials-storage-fc0c59c3.cjs.prod.js → credentials-storage-6c51d561.cjs.dev.js} +3 -15
- package/dist/declarations/src/generated/settings.d.ts +90 -1172
- package/dist/{has-jsx-runtime-0b03b72e.cjs.prod.js → has-jsx-runtime-aa5d21ee.cjs.dev.js} +0 -2
- package/dist/{has-jsx-runtime-3d4bb633.cjs.dev.js → has-jsx-runtime-c3202df5.cjs.prod.js} +0 -2
- package/dist/{has-jsx-runtime-8314226e.esm.js → has-jsx-runtime-e3ecb09b.esm.js} +0 -2
- package/dist/{login-9f821336.cjs.dev.js → login-0dc4f62a.cjs.prod.js} +12 -23
- package/dist/{login-d1c2268a.esm.js → login-1b051481.esm.js} +12 -23
- package/dist/{login-f747390f.cjs.prod.js → login-9f35d543.cjs.dev.js} +12 -23
- package/dist/{package-83202e32.cjs.prod.js → package-46d27f5f.cjs.dev.js} +15 -13
- package/dist/{package-e6713e98.esm.js → package-4fcd2667.esm.js} +15 -13
- package/dist/{package-cc5b8665.cjs.dev.js → package-6ee0354d.cjs.prod.js} +15 -13
- package/dist/{paths-284c77fb.cjs.prod.js → paths-854af5ef.cjs.prod.js} +8 -12
- package/dist/{paths-db35ac0f.cjs.dev.js → paths-d1febc82.cjs.dev.js} +8 -12
- package/dist/{paths-55c5d5a2.esm.js → paths-ded20ae1.esm.js} +8 -12
- package/dist/{serve-b8063204.cjs.dev.js → serve-12571b42.cjs.prod.js} +1 -2
- package/dist/{serve-660e2ee0.esm.js → serve-65b5a149.esm.js} +1 -2
- package/dist/{serve-41077dad.cjs.prod.js → serve-7339c495.cjs.dev.js} +1 -2
- package/dist/{start-33fd6d70.cjs.dev.js → start-216f84b7.cjs.dev.js} +26 -34
- package/dist/{start-93205b87.esm.js → start-4a922c4f.esm.js} +26 -34
- package/dist/{start-f93c62f9.cjs.prod.js → start-b2e2dab7.cjs.prod.js} +26 -34
- package/dist/{start-vite-8f03b0df.cjs.dev.js → start-vite-3966d625.cjs.dev.js} +18 -17
- package/dist/{start-vite-324af14d.cjs.prod.js → start-vite-5c78605b.cjs.prod.js} +18 -17
- package/dist/{start-vite-7d10ae71.esm.js → start-vite-cf0213a1.esm.js} +18 -17
- package/dist/{vite-plugin-svgr-f17db78a.esm.js → vite-plugin-svgr-5c953fe7.esm.js} +1 -6
- package/dist/{vite-plugin-svgr-fdb37ccf.cjs.dev.js → vite-plugin-svgr-5eb1c511.cjs.dev.js} +1 -6
- package/dist/{vite-plugin-svgr-9a4e7f77.cjs.prod.js → vite-plugin-svgr-a732f8df.cjs.prod.js} +1 -6
- package/package.json +31 -17
- 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
|
@@ -9,8 +9,8 @@ var fs = require('fs-extra');
|
|
|
9
9
|
var vite = require('vite');
|
|
10
10
|
var assets = require('@commercetools-frontend/assets');
|
|
11
11
|
var mcHtmlTemplate = require('@commercetools-frontend/mc-html-template');
|
|
12
|
-
var paths = require('./paths-
|
|
13
|
-
var vitePluginSvgr = require('./vite-plugin-svgr-
|
|
12
|
+
var paths = require('./paths-d1febc82.cjs.dev.js');
|
|
13
|
+
var vitePluginSvgr = require('./vite-plugin-svgr-5eb1c511.cjs.dev.js');
|
|
14
14
|
require('@babel/runtime-corejs3/core-js-stable/instance/find');
|
|
15
15
|
require('@babel/runtime-corejs3/core-js-stable/instance/concat');
|
|
16
16
|
require('fs');
|
|
@@ -29,11 +29,9 @@ var fs__default = /*#__PURE__*/_interopDefault(fs);
|
|
|
29
29
|
// on runtime to build the assets URL (for example when using a separate CDN for the assets).
|
|
30
30
|
// Inspired by https://github.com/vitejs/vite/blob/main/playground/assets/vite.config-runtime-base.js
|
|
31
31
|
const dynamicBaseAssetsCode = "globalThis.__toCdnUrl = filePath => window.app.cdnUrl.replace(/\\/$/, '') + '/' + filePath;";
|
|
32
|
-
|
|
33
32
|
function vitePluginDynamicBaseAssetsGlobals() {
|
|
34
33
|
return {
|
|
35
34
|
name: 'dynamic-base-assets-globals',
|
|
36
|
-
|
|
37
35
|
transformIndexHtml(html, ctx) {
|
|
38
36
|
if (ctx.bundle) {
|
|
39
37
|
// Only inject during build
|
|
@@ -45,27 +43,27 @@ function vitePluginDynamicBaseAssetsGlobals() {
|
|
|
45
43
|
children: dynamicBaseAssetsCode
|
|
46
44
|
}];
|
|
47
45
|
}
|
|
48
|
-
|
|
49
46
|
return html;
|
|
50
47
|
}
|
|
51
|
-
|
|
52
48
|
};
|
|
53
49
|
}
|
|
54
50
|
|
|
55
51
|
async function run() {
|
|
56
|
-
const DEFAULT_PORT = _parseInt__default["default"](String(process.env.HTTP_PORT), 10) || 3001;
|
|
52
|
+
const DEFAULT_PORT = _parseInt__default["default"](String(process.env.HTTP_PORT), 10) || 3001;
|
|
57
53
|
|
|
54
|
+
// Ensure the `/public` folder exists.
|
|
58
55
|
fs__default["default"].mkdirSync(paths.paths.appBuild, {
|
|
59
56
|
recursive: true
|
|
60
|
-
});
|
|
57
|
+
});
|
|
61
58
|
|
|
59
|
+
// Generate `index.html` (template).
|
|
62
60
|
const appEntryPoint = path__default["default"].relative(paths.paths.appRoot, paths.paths.entryPoint);
|
|
63
61
|
const html = mcHtmlTemplate.generateTemplate({
|
|
64
62
|
// Define the module entry point (path relative from the `/public` folder).
|
|
65
63
|
// NOTE: that this is different from the development configuration.
|
|
66
64
|
scriptImports: ["<script type=\"module\" src=\"/".concat(appEntryPoint, "\"></script>")]
|
|
67
|
-
});
|
|
68
|
-
|
|
65
|
+
});
|
|
66
|
+
// Write `index.html` (template) into the `/public` folder.
|
|
69
67
|
fs__default["default"].writeFileSync(paths.paths.appIndexHtml, html, {
|
|
70
68
|
encoding: 'utf8'
|
|
71
69
|
});
|
|
@@ -89,7 +87,8 @@ async function run() {
|
|
|
89
87
|
// https://github.com/vitejs/vite/issues/2433#issuecomment-1361094727
|
|
90
88
|
cache: false
|
|
91
89
|
},
|
|
92
|
-
sourcemap:
|
|
90
|
+
sourcemap:
|
|
91
|
+
// Generating sourcemaps can increase the memory footprint of the build process,
|
|
93
92
|
// therefore it's an opt-in option.
|
|
94
93
|
// TODO: make it a CLI option when Vite support becomes stable.
|
|
95
94
|
process.env.ENABLE_EXPERIMENTAL_VITE_BUNDLER_SOURCEMAP === 'true'
|
|
@@ -101,16 +100,13 @@ async function run() {
|
|
|
101
100
|
// https://vitejs.dev/guide/build.html#advanced-base-options
|
|
102
101
|
renderBuiltUrl(filename, _ref) {
|
|
103
102
|
let hostType = _ref.hostType;
|
|
104
|
-
|
|
105
103
|
if (hostType === 'html') {
|
|
106
104
|
return "__CDN_URL__".concat(filename);
|
|
107
105
|
}
|
|
108
|
-
|
|
109
106
|
return {
|
|
110
107
|
runtime: "window.__toCdnUrl(".concat(_JSON$stringify__default["default"](filename), ")")
|
|
111
108
|
};
|
|
112
109
|
}
|
|
113
|
-
|
|
114
110
|
},
|
|
115
111
|
plugins: [pluginGraphql__default["default"](), pluginReact__default["default"]({
|
|
116
112
|
jsxImportSource: '@emotion/react',
|
|
@@ -118,16 +114,19 @@ async function run() {
|
|
|
118
114
|
plugins: ['@emotion/babel-plugin', '@babel/plugin-proposal-do-expressions']
|
|
119
115
|
}
|
|
120
116
|
}), vitePluginSvgr.vitePluginSvgr(), vitePluginDynamicBaseAssetsGlobals()]
|
|
121
|
-
});
|
|
117
|
+
});
|
|
122
118
|
|
|
123
|
-
|
|
119
|
+
// Rename `/public/public/index.html` to `/public/index.html.template`
|
|
120
|
+
fs__default["default"].renameSync(
|
|
121
|
+
// Because of our custom entry point path (`/public/index.html`),
|
|
124
122
|
// Vite will write the `index.html` to `/public/public/index.html`.
|
|
125
123
|
// We need to move this file to the `/public` folder and rename it
|
|
126
124
|
// to `index.html.template` (as expected by the `compile-html` command).
|
|
127
|
-
path__default["default"].join(paths.paths.appBuild, 'public/index.html'), paths.paths.appIndexHtmlTemplate);
|
|
128
|
-
|
|
129
|
-
fs__default["default"].rmdirSync(path__default["default"].join(paths.paths.appBuild, 'public'));
|
|
125
|
+
path__default["default"].join(paths.paths.appBuild, 'public/index.html'), paths.paths.appIndexHtmlTemplate);
|
|
126
|
+
// Clean up nested folder
|
|
127
|
+
fs__default["default"].rmdirSync(path__default["default"].join(paths.paths.appBuild, 'public'));
|
|
130
128
|
|
|
129
|
+
// Copy public assets
|
|
131
130
|
fs__default["default"].copySync(path__default["default"].join(assets.packageLocation, 'html-page'), paths.paths.appBuild, {
|
|
132
131
|
dereference: true
|
|
133
132
|
});
|
|
@@ -5,19 +5,18 @@ 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 = "22.
|
|
8
|
+
var version = "22.3.0";
|
|
9
9
|
|
|
10
10
|
// These exports are deprecated.
|
|
11
|
+
|
|
11
12
|
function createWebpackConfigForDevelopment(options) {
|
|
12
13
|
console.log('Importing the function "createWebpackConfigForDevelopment" from the main entry point "@commercetools-frontend/mc-scripts" is deprecated. Use the entry point "@commercetools-frontend/mc-scripts/create-webpack-config" instead.');
|
|
13
14
|
return require('@commercetools-frontend/mc-scripts/webpack').createWebpackConfigForDevelopment(options);
|
|
14
15
|
}
|
|
15
|
-
|
|
16
16
|
function createWebpackConfigForProduction(options) {
|
|
17
17
|
console.log('Importing the function "createWebpackConfigForProduction" from the main entry point "@commercetools-frontend/mc-scripts" is deprecated. Use the entry point "@commercetools-frontend/mc-scripts/create-webpack-config" instead.');
|
|
18
18
|
return require('@commercetools-frontend/mc-scripts/webpack').createWebpackConfigForProduction(options);
|
|
19
19
|
}
|
|
20
|
-
|
|
21
20
|
function createPostcssConfig(options) {
|
|
22
21
|
console.log('Importing the function "createPostcssConfig" from the main entry point "@commercetools-frontend/mc-scripts" is deprecated. Use the entry point "@commercetools-frontend/mc-scripts/create-postcss-config" instead.');
|
|
23
22
|
return require('@commercetools-frontend/mc-scripts/postcss').createPostcssConfig(options);
|
|
@@ -5,19 +5,18 @@ 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 = "22.
|
|
8
|
+
var version = "22.3.0";
|
|
9
9
|
|
|
10
10
|
// These exports are deprecated.
|
|
11
|
+
|
|
11
12
|
function createWebpackConfigForDevelopment(options) {
|
|
12
13
|
console.log('Importing the function "createWebpackConfigForDevelopment" from the main entry point "@commercetools-frontend/mc-scripts" is deprecated. Use the entry point "@commercetools-frontend/mc-scripts/create-webpack-config" instead.');
|
|
13
14
|
return require('@commercetools-frontend/mc-scripts/webpack').createWebpackConfigForDevelopment(options);
|
|
14
15
|
}
|
|
15
|
-
|
|
16
16
|
function createWebpackConfigForProduction(options) {
|
|
17
17
|
console.log('Importing the function "createWebpackConfigForProduction" from the main entry point "@commercetools-frontend/mc-scripts" is deprecated. Use the entry point "@commercetools-frontend/mc-scripts/create-webpack-config" instead.');
|
|
18
18
|
return require('@commercetools-frontend/mc-scripts/webpack').createWebpackConfigForProduction(options);
|
|
19
19
|
}
|
|
20
|
-
|
|
21
20
|
function createPostcssConfig(options) {
|
|
22
21
|
console.log('Importing the function "createPostcssConfig" from the main entry point "@commercetools-frontend/mc-scripts" is deprecated. Use the entry point "@commercetools-frontend/mc-scripts/create-postcss-config" instead.');
|
|
23
22
|
return require('@commercetools-frontend/mc-scripts/postcss').createPostcssConfig(options);
|
|
@@ -1,19 +1,18 @@
|
|
|
1
1
|
export { v as vendorsToTranspile } from './vendors-to-transpile-7dc84a72.esm.js';
|
|
2
2
|
|
|
3
3
|
// NOTE: This string will be replaced on build time with the package version.
|
|
4
|
-
var version = "22.
|
|
4
|
+
var version = "22.3.0";
|
|
5
5
|
|
|
6
6
|
// These exports are deprecated.
|
|
7
|
+
|
|
7
8
|
function createWebpackConfigForDevelopment(options) {
|
|
8
9
|
console.log('Importing the function "createWebpackConfigForDevelopment" from the main entry point "@commercetools-frontend/mc-scripts" is deprecated. Use the entry point "@commercetools-frontend/mc-scripts/create-webpack-config" instead.');
|
|
9
10
|
return require('@commercetools-frontend/mc-scripts/webpack').createWebpackConfigForDevelopment(options);
|
|
10
11
|
}
|
|
11
|
-
|
|
12
12
|
function createWebpackConfigForProduction(options) {
|
|
13
13
|
console.log('Importing the function "createWebpackConfigForProduction" from the main entry point "@commercetools-frontend/mc-scripts" is deprecated. Use the entry point "@commercetools-frontend/mc-scripts/create-webpack-config" instead.');
|
|
14
14
|
return require('@commercetools-frontend/mc-scripts/webpack').createWebpackConfigForProduction(options);
|
|
15
15
|
}
|
|
16
|
-
|
|
17
16
|
function createPostcssConfig(options) {
|
|
18
17
|
console.log('Importing the function "createPostcssConfig" from the main entry point "@commercetools-frontend/mc-scripts" is deprecated. Use the entry point "@commercetools-frontend/mc-scripts/create-postcss-config" instead.');
|
|
19
18
|
return require('@commercetools-frontend/mc-scripts/postcss').createPostcssConfig(options);
|
|
@@ -5,7 +5,7 @@ var _JSON$stringify = require('@babel/runtime-corejs3/core-js-stable/json/string
|
|
|
5
5
|
var fs = require('fs');
|
|
6
6
|
var chalk = require('chalk');
|
|
7
7
|
var mcHtmlTemplate = require('@commercetools-frontend/mc-html-template');
|
|
8
|
-
var paths = require('./paths-
|
|
8
|
+
var paths = require('./paths-854af5ef.cjs.prod.js');
|
|
9
9
|
require('@babel/runtime-corejs3/core-js-stable/instance/find');
|
|
10
10
|
require('path');
|
|
11
11
|
|
|
@@ -17,32 +17,26 @@ var fs__default = /*#__PURE__*/_interopDefault(fs);
|
|
|
17
17
|
var chalk__default = /*#__PURE__*/_interopDefault(chalk);
|
|
18
18
|
|
|
19
19
|
const appDirectory = fs__default["default"].realpathSync(process.cwd());
|
|
20
|
-
|
|
21
20
|
async function run(options) {
|
|
22
21
|
console.log('Compiling index.html...');
|
|
23
22
|
const compiled = await mcHtmlTemplate.compileHtml(paths.paths.appIndexHtmlTemplate);
|
|
24
23
|
fs__default["default"].writeFileSync(paths.paths.appIndexHtml, compiled.indexHtmlContent, {
|
|
25
24
|
encoding: 'utf8'
|
|
26
25
|
});
|
|
27
|
-
|
|
28
26
|
if (options.transformer) {
|
|
29
27
|
try {
|
|
30
28
|
const transformerPath = require.resolve(options.transformer, {
|
|
31
29
|
paths: [appDirectory]
|
|
32
30
|
});
|
|
33
|
-
|
|
34
31
|
const transformerFn = require(transformerPath);
|
|
35
|
-
|
|
36
32
|
transformerFn(compiled);
|
|
37
33
|
} catch (error) {
|
|
38
34
|
var _context;
|
|
39
|
-
|
|
40
35
|
throw new Error(_concatInstanceProperty__default["default"](_context = "Could not load transformer module \"".concat(options.transformer, "\"\n")).call(_context, error instanceof Error ? error.stack : ''));
|
|
41
36
|
}
|
|
42
37
|
} else if (options.printSecurityHeaders) {
|
|
43
38
|
console.log(_JSON$stringify__default["default"](compiled.headers));
|
|
44
39
|
}
|
|
45
|
-
|
|
46
40
|
console.log(chalk__default["default"].green('Compiled successfully.\n'));
|
|
47
41
|
}
|
|
48
42
|
|
|
@@ -5,7 +5,7 @@ var _JSON$stringify = require('@babel/runtime-corejs3/core-js-stable/json/string
|
|
|
5
5
|
var fs = require('fs');
|
|
6
6
|
var chalk = require('chalk');
|
|
7
7
|
var mcHtmlTemplate = require('@commercetools-frontend/mc-html-template');
|
|
8
|
-
var paths = require('./paths-
|
|
8
|
+
var paths = require('./paths-d1febc82.cjs.dev.js');
|
|
9
9
|
require('@babel/runtime-corejs3/core-js-stable/instance/find');
|
|
10
10
|
require('path');
|
|
11
11
|
|
|
@@ -17,32 +17,26 @@ var fs__default = /*#__PURE__*/_interopDefault(fs);
|
|
|
17
17
|
var chalk__default = /*#__PURE__*/_interopDefault(chalk);
|
|
18
18
|
|
|
19
19
|
const appDirectory = fs__default["default"].realpathSync(process.cwd());
|
|
20
|
-
|
|
21
20
|
async function run(options) {
|
|
22
21
|
console.log('Compiling index.html...');
|
|
23
22
|
const compiled = await mcHtmlTemplate.compileHtml(paths.paths.appIndexHtmlTemplate);
|
|
24
23
|
fs__default["default"].writeFileSync(paths.paths.appIndexHtml, compiled.indexHtmlContent, {
|
|
25
24
|
encoding: 'utf8'
|
|
26
25
|
});
|
|
27
|
-
|
|
28
26
|
if (options.transformer) {
|
|
29
27
|
try {
|
|
30
28
|
const transformerPath = require.resolve(options.transformer, {
|
|
31
29
|
paths: [appDirectory]
|
|
32
30
|
});
|
|
33
|
-
|
|
34
31
|
const transformerFn = require(transformerPath);
|
|
35
|
-
|
|
36
32
|
transformerFn(compiled);
|
|
37
33
|
} catch (error) {
|
|
38
34
|
var _context;
|
|
39
|
-
|
|
40
35
|
throw new Error(_concatInstanceProperty__default["default"](_context = "Could not load transformer module \"".concat(options.transformer, "\"\n")).call(_context, error instanceof Error ? error.stack : ''));
|
|
41
36
|
}
|
|
42
37
|
} else if (options.printSecurityHeaders) {
|
|
43
38
|
console.log(_JSON$stringify__default["default"](compiled.headers));
|
|
44
39
|
}
|
|
45
|
-
|
|
46
40
|
console.log(chalk__default["default"].green('Compiled successfully.\n'));
|
|
47
41
|
}
|
|
48
42
|
|
|
@@ -3,37 +3,31 @@ import _JSON$stringify from '@babel/runtime-corejs3/core-js-stable/json/stringif
|
|
|
3
3
|
import fs from 'fs';
|
|
4
4
|
import chalk from 'chalk';
|
|
5
5
|
import { compileHtml } from '@commercetools-frontend/mc-html-template';
|
|
6
|
-
import { p as paths } from './paths-
|
|
6
|
+
import { p as paths } from './paths-ded20ae1.esm.js';
|
|
7
7
|
import '@babel/runtime-corejs3/core-js-stable/instance/find';
|
|
8
8
|
import 'path';
|
|
9
9
|
|
|
10
10
|
const appDirectory = fs.realpathSync(process.cwd());
|
|
11
|
-
|
|
12
11
|
async function run(options) {
|
|
13
12
|
console.log('Compiling index.html...');
|
|
14
13
|
const compiled = await compileHtml(paths.appIndexHtmlTemplate);
|
|
15
14
|
fs.writeFileSync(paths.appIndexHtml, compiled.indexHtmlContent, {
|
|
16
15
|
encoding: 'utf8'
|
|
17
16
|
});
|
|
18
|
-
|
|
19
17
|
if (options.transformer) {
|
|
20
18
|
try {
|
|
21
19
|
const transformerPath = require.resolve(options.transformer, {
|
|
22
20
|
paths: [appDirectory]
|
|
23
21
|
});
|
|
24
|
-
|
|
25
22
|
const transformerFn = require(transformerPath);
|
|
26
|
-
|
|
27
23
|
transformerFn(compiled);
|
|
28
24
|
} catch (error) {
|
|
29
25
|
var _context;
|
|
30
|
-
|
|
31
26
|
throw new Error(_concatInstanceProperty(_context = "Could not load transformer module \"".concat(options.transformer, "\"\n")).call(_context, error instanceof Error ? error.stack : ''));
|
|
32
27
|
}
|
|
33
28
|
} else if (options.printSecurityHeaders) {
|
|
34
29
|
console.log(_JSON$stringify(compiled.headers));
|
|
35
30
|
}
|
|
36
|
-
|
|
37
31
|
console.log(chalk.green('Compiled successfully.\n'));
|
|
38
32
|
}
|
|
39
33
|
|