@commercetools-frontend/mc-html-template 20.12.3 → 21.0.0-rc.4
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/build/process-headers.js
CHANGED
|
@@ -50,7 +50,7 @@ const toStructuredHeaderString = (directives = {}) => {
|
|
|
50
50
|
};
|
|
51
51
|
|
|
52
52
|
const processHeaders = applicationConfig => {
|
|
53
|
-
var _context4, _context5, _context6
|
|
53
|
+
var _context4, _context5, _context6;
|
|
54
54
|
|
|
55
55
|
const isMcDevEnv = applicationConfig.env.env === 'development'; // List hashes for injected inline scripts.
|
|
56
56
|
// https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy/script-src
|
|
@@ -92,7 +92,7 @@ const processHeaders = applicationConfig => {
|
|
|
92
92
|
// GTM and Intercom scripts are apparently not meant for this)
|
|
93
93
|
); // Recursively merge the directives
|
|
94
94
|
|
|
95
|
-
const mergedCsp = mergeCspDirectives(cspDirectives,
|
|
95
|
+
const mergedCsp = mergeCspDirectives(cspDirectives, applicationConfig.headers.csp ?? {});
|
|
96
96
|
return { // Default security headers.
|
|
97
97
|
...HTTP_SECURITY_HEADERS,
|
|
98
98
|
// The `Content-Security-Policy` header is always generated
|
|
@@ -16,7 +16,7 @@ const getGtmTrackingScript = gtmId => {
|
|
|
16
16
|
`;
|
|
17
17
|
};
|
|
18
18
|
|
|
19
|
-
const replaceHtmlPlaceholders = (indexHtmlContent, options) => indexHtmlContent.replace(new RegExp('__CSP__', 'g'), options.headers
|
|
19
|
+
const replaceHtmlPlaceholders = (indexHtmlContent, options) => indexHtmlContent.replace(new RegExp('__CSP__', 'g'), options.headers ? options.headers['Content-Security-Policy'] : '').replace(new RegExp('__CDN_URL__', 'g'), options.env.cdnUrl ? // Ensure there is a trailing slash
|
|
20
20
|
`${trimTrailingSlash(options.env.cdnUrl)}/` : '').replace(new RegExp('__MC_API_URL__', 'g'), trimTrailingSlash(options.env.mcApiUrl)).replace(new RegExp('__APP_ENVIRONMENT__', 'g'), sanitizeAppEnvironment(options.env)).replace(new RegExp('__GTM_SCRIPT__', 'g'), getGtmTrackingScript(options.env.trackingGtm)).replace(new RegExp('__DATALAYER_JS__', 'g'), htmlScripts.dataLayer).replace(new RegExp('__LOADING_SCREEN_JS__', 'g'), htmlScripts.loadingScreen).replace(new RegExp('__LOADING_SCREEN_CSS__', 'g'), htmlStyles.loadingScreen);
|
|
21
21
|
|
|
22
22
|
module.exports = replaceHtmlPlaceholders;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@commercetools-frontend/mc-html-template",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "21.0.0-rc.4",
|
|
4
4
|
"description": "Everything related to render the index.html for a MC application",
|
|
5
5
|
"bugs": "https://github.com/commercetools/merchant-center-application-kit/issues",
|
|
6
6
|
"repository": {
|
|
@@ -29,22 +29,22 @@
|
|
|
29
29
|
"build:bundles:watch": "yarn build -w"
|
|
30
30
|
},
|
|
31
31
|
"dependencies": {
|
|
32
|
-
"@babel/runtime": "7.16.
|
|
33
|
-
"@babel/runtime-corejs3": "7.16.
|
|
34
|
-
"@commercetools-frontend/application-config": "
|
|
35
|
-
"@commercetools-frontend/constants": "
|
|
36
|
-
"core-js": "3.20.
|
|
32
|
+
"@babel/runtime": "^7.16.7",
|
|
33
|
+
"@babel/runtime-corejs3": "^7.16.8",
|
|
34
|
+
"@commercetools-frontend/application-config": "21.0.0-rc.4",
|
|
35
|
+
"@commercetools-frontend/constants": "21.0.0-rc.3",
|
|
36
|
+
"core-js": "^3.20.3",
|
|
37
37
|
"serialize-javascript": "6.0.0",
|
|
38
38
|
"uglify-js": "3.14.5",
|
|
39
39
|
"uglifycss": "0.0.29"
|
|
40
40
|
},
|
|
41
41
|
"devDependencies": {
|
|
42
|
-
"@babel/plugin-transform-runtime": "7.16.
|
|
43
|
-
"@babel/preset-env": "7.16.
|
|
42
|
+
"@babel/plugin-transform-runtime": "^7.16.10",
|
|
43
|
+
"@babel/preset-env": "^7.16.11",
|
|
44
44
|
"rimraf": "3.0.2"
|
|
45
45
|
},
|
|
46
46
|
"engines": {
|
|
47
|
-
"node": ">=
|
|
47
|
+
"node": ">=14"
|
|
48
48
|
},
|
|
49
49
|
"babel": {
|
|
50
50
|
"presets": [
|
|
@@ -52,7 +52,7 @@
|
|
|
52
52
|
"@babel/preset-env",
|
|
53
53
|
{
|
|
54
54
|
"targets": {
|
|
55
|
-
"node": "
|
|
55
|
+
"node": "14"
|
|
56
56
|
},
|
|
57
57
|
"modules": "commonjs",
|
|
58
58
|
"useBuiltIns": "usage",
|