@commercetools-frontend/mc-scripts 21.8.0 → 21.10.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.
Files changed (60) hide show
  1. package/cli/dist/commercetools-frontend-mc-scripts-cli.cjs.dev.js +34 -21
  2. package/cli/dist/commercetools-frontend-mc-scripts-cli.cjs.prod.js +34 -21
  3. package/cli/dist/commercetools-frontend-mc-scripts-cli.esm.js +34 -21
  4. package/dist/{build-8582b673.esm.js → build-4b9ac48f.esm.js} +3 -3
  5. package/dist/{build-97278377.cjs.dev.js → build-83e7cede.cjs.dev.js} +3 -3
  6. package/dist/{build-9395925a.cjs.prod.js → build-f523f508.cjs.prod.js} +3 -3
  7. package/dist/{build-vite-6c987a60.cjs.dev.js → build-vite-3b82522e.cjs.dev.js} +44 -2
  8. package/dist/{build-vite-a9602b19.esm.js → build-vite-93abdc95.esm.js} +44 -2
  9. package/dist/{build-vite-76d44332.cjs.prod.js → build-vite-b7cd993a.cjs.prod.js} +44 -2
  10. package/dist/commercetools-frontend-mc-scripts.cjs.dev.js +1 -1
  11. package/dist/commercetools-frontend-mc-scripts.cjs.prod.js +1 -1
  12. package/dist/commercetools-frontend-mc-scripts.esm.js +1 -1
  13. package/dist/{compile-html-4832f8c5.esm.js → compile-html-4361a0b3.esm.js} +18 -24
  14. package/dist/{compile-html-7654b5e6.cjs.prod.js → compile-html-d6331c35.cjs.prod.js} +18 -24
  15. package/dist/{compile-html-0c588a89.cjs.dev.js → compile-html-d9e731aa.cjs.dev.js} +18 -24
  16. package/dist/{config-sync-62824317.cjs.prod.js → config-sync-a3170b54.cjs.prod.js} +46 -74
  17. package/dist/{config-sync-d52e73f6.cjs.dev.js → config-sync-ec048923.cjs.dev.js} +46 -74
  18. package/dist/{config-sync-20bc05e8.esm.js → config-sync-f97789c5.esm.js} +46 -74
  19. package/dist/{create-postcss-config-8ea16440.cjs.prod.js → create-postcss-config-0c0236bf.cjs.prod.js} +1 -1
  20. package/dist/{create-postcss-config-4cbe10ab.cjs.dev.js → create-postcss-config-2a0d05b2.cjs.dev.js} +1 -1
  21. package/dist/{create-postcss-config-c1aa3525.esm.js → create-postcss-config-d2bf4c66.esm.js} +1 -1
  22. package/dist/{create-webpack-config-for-development-a5e73092.cjs.prod.js → create-webpack-config-for-development-1da79732.cjs.prod.js} +5 -4
  23. package/dist/{create-webpack-config-for-development-e2735e02.cjs.dev.js → create-webpack-config-for-development-47d59cb3.cjs.dev.js} +5 -4
  24. package/dist/{create-webpack-config-for-development-8a8b84d6.esm.js → create-webpack-config-for-development-a546d54f.esm.js} +5 -4
  25. package/dist/{create-webpack-config-for-production-4e7b56c0.cjs.prod.js → create-webpack-config-for-production-3fd4683d.cjs.prod.js} +5 -4
  26. package/dist/{create-webpack-config-for-production-7dc669e5.esm.js → create-webpack-config-for-production-8d1ce439.esm.js} +5 -4
  27. package/dist/{create-webpack-config-for-production-d9bf281c.cjs.dev.js → create-webpack-config-for-production-db313b50.cjs.dev.js} +5 -4
  28. package/dist/declarations/src/commands/compile-html.d.ts +1 -1
  29. package/dist/declarations/src/commands/config-sync.d.ts +1 -1
  30. package/dist/declarations/src/config/moment-locales.d.ts +2 -0
  31. package/dist/declarations/src/generated/settings.d.ts +110 -8
  32. package/dist/declarations/src/types.d.ts +3 -3
  33. package/dist/declarations/src/vite-plugins/vite-plugin-custom-application.d.ts +4 -0
  34. package/dist/declarations/src/vite-plugins/vite-plugin-dynamic-base-assets-globals.d.ts +3 -0
  35. package/dist/declarations/src/vite-plugins/vite-plugin-svgr.d.ts +3 -0
  36. package/dist/{login-7d94659e.esm.js → login-0f875277.esm.js} +2 -2
  37. package/dist/{login-779552b7.cjs.dev.js → login-47ddbfc2.cjs.dev.js} +2 -2
  38. package/dist/{login-706ccc9a.cjs.prod.js → login-a99bba7b.cjs.prod.js} +2 -2
  39. package/dist/{package-aaf61bf0.cjs.dev.js → package-430e0951.cjs.prod.js} +25 -21
  40. package/dist/{package-b5c040f3.cjs.prod.js → package-7d0afacb.cjs.dev.js} +25 -21
  41. package/dist/{package-a98de907.esm.js → package-b2f3ad5a.esm.js} +25 -21
  42. package/dist/{start-e3ccd672.cjs.prod.js → start-5ba2b72f.cjs.prod.js} +3 -3
  43. package/dist/{start-2b953ab0.cjs.dev.js → start-bfb77660.cjs.dev.js} +3 -3
  44. package/dist/{start-e924bd5d.esm.js → start-f401e82c.esm.js} +3 -3
  45. package/dist/{start-vite-737bacca.cjs.dev.js → start-vite-22de08dc.cjs.dev.js} +7 -5
  46. package/dist/{start-vite-ec5d40b5.esm.js → start-vite-dc046cba.esm.js} +7 -5
  47. package/dist/{start-vite-b0f58ae4.cjs.prod.js → start-vite-fe13330b.cjs.prod.js} +7 -5
  48. package/dist/{user-agent-d18809af.cjs.prod.js → user-agent-837f1c7f.cjs.prod.js} +1 -1
  49. package/dist/{user-agent-8044acd6.esm.js → user-agent-b737c3ac.esm.js} +1 -1
  50. package/dist/{user-agent-5da1830b.cjs.dev.js → user-agent-f4549ad1.cjs.dev.js} +1 -1
  51. package/dist/vite-plugin-svgr-4205f2b5.cjs.dev.js +110 -0
  52. package/dist/vite-plugin-svgr-eb8524fa.esm.js +85 -0
  53. package/dist/vite-plugin-svgr-f3bbedbe.cjs.prod.js +110 -0
  54. package/package.json +25 -21
  55. package/postcss/dist/commercetools-frontend-mc-scripts-postcss.cjs.dev.js +2 -2
  56. package/postcss/dist/commercetools-frontend-mc-scripts-postcss.cjs.prod.js +2 -2
  57. package/postcss/dist/commercetools-frontend-mc-scripts-postcss.esm.js +2 -2
  58. package/webpack/dist/commercetools-frontend-mc-scripts-webpack.cjs.dev.js +4 -4
  59. package/webpack/dist/commercetools-frontend-mc-scripts-webpack.cjs.prod.js +4 -4
  60. package/webpack/dist/commercetools-frontend-mc-scripts-webpack.esm.js +4 -4
@@ -12,9 +12,11 @@ var pluginReact = require('@vitejs/plugin-react');
12
12
  var mcHtmlTemplate = require('@commercetools-frontend/mc-html-template');
13
13
  var assets = require('@commercetools-frontend/assets');
14
14
  var paths = require('./paths-16823f56.cjs.dev.js');
15
+ var vitePluginSvgr = require('./vite-plugin-svgr-4205f2b5.cjs.dev.js');
15
16
  require('@babel/runtime-corejs3/core-js-stable/instance/find');
16
17
  require('@babel/runtime-corejs3/core-js-stable/instance/concat');
17
18
  require('fs');
19
+ require('@rollup/pluginutils');
18
20
 
19
21
  function _interopDefault (e) { return e && e.__esModule ? e : { 'default': e }; }
20
22
 
@@ -26,6 +28,31 @@ var path__default = /*#__PURE__*/_interopDefault(path);
26
28
  var pluginGraphql__default = /*#__PURE__*/_interopDefault(pluginGraphql);
27
29
  var pluginReact__default = /*#__PURE__*/_interopDefault(pluginReact);
28
30
 
31
+ // This script/function is injected into the `index.html` and used by Vite
32
+ // on runtime to build the assets URL (for example when using a separate CDN for the assets).
33
+ // Inspired by https://github.com/vitejs/vite/blob/main/playground/assets/vite.config-runtime-base.js
34
+ var dynamicBaseAssetsCode = "globalThis.__toCdnUrl = filePath => window.app.cdnUrl.replace(/\\/$/, '') + '/' + filePath;";
35
+
36
+ function vitePluginDynamicBaseAssetsGlobals() {
37
+ return {
38
+ name: 'dynamic-base-assets-globals',
39
+ transformIndexHtml: function transformIndexHtml(html, ctx) {
40
+ if (ctx.bundle) {
41
+ // Only inject during build
42
+ return [{
43
+ tag: 'script',
44
+ attrs: {
45
+ type: 'module'
46
+ },
47
+ children: dynamicBaseAssetsCode
48
+ }];
49
+ }
50
+
51
+ return html;
52
+ }
53
+ };
54
+ }
55
+
29
56
  function run() {
30
57
  return _run.apply(this, arguments);
31
58
  }
@@ -56,13 +83,14 @@ function _run() {
56
83
  _context.next = 7;
57
84
  return vite.build({
58
85
  root: paths.paths.appRoot,
86
+ base: './',
87
+ // <-- Important to allow configuring the runtime base path.
59
88
  define: {
60
89
  'process.env.DEBUG': _JSON$stringify__default["default"](false),
61
90
  'process.env.NODE_ENV': _JSON$stringify__default["default"]('production')
62
91
  },
63
92
  build: {
64
93
  outDir: 'public',
65
- assetsDir: '.',
66
94
  rollupOptions: {
67
95
  // This is necessary to instruct Vite that the `index.html` (template)
68
96
  // is located in the `/public` folder.
@@ -74,12 +102,26 @@ function _run() {
74
102
  server: {
75
103
  port: DEFAULT_PORT
76
104
  },
105
+ experimental: {
106
+ // https://vitejs.dev/guide/build.html#advanced-base-options
107
+ renderBuiltUrl: function renderBuiltUrl(filename, _ref) {
108
+ var hostType = _ref.hostType;
109
+
110
+ if (hostType === 'html') {
111
+ return "__CDN_URL__".concat(filename);
112
+ }
113
+
114
+ return {
115
+ runtime: "window.__toCdnUrl(".concat(_JSON$stringify__default["default"](filename), ")")
116
+ };
117
+ }
118
+ },
77
119
  plugins: [pluginGraphql__default["default"](), pluginReact__default["default"]({
78
120
  jsxImportSource: '@emotion/react',
79
121
  babel: {
80
122
  plugins: ['@emotion/babel-plugin']
81
123
  }
82
- })]
124
+ }), vitePluginSvgr.vitePluginSvgr(), vitePluginDynamicBaseAssetsGlobals()]
83
125
  });
84
126
 
85
127
  case 7:
@@ -10,9 +10,36 @@ import pluginReact from '@vitejs/plugin-react';
10
10
  import { generateTemplate } from '@commercetools-frontend/mc-html-template';
11
11
  import { packageLocation } from '@commercetools-frontend/assets';
12
12
  import { p as paths } from './paths-ed23d5a1.esm.js';
13
+ import { v as vitePluginSvgr } from './vite-plugin-svgr-eb8524fa.esm.js';
13
14
  import '@babel/runtime-corejs3/core-js-stable/instance/find';
14
15
  import '@babel/runtime-corejs3/core-js-stable/instance/concat';
15
16
  import 'fs';
17
+ import '@rollup/pluginutils';
18
+
19
+ // This script/function is injected into the `index.html` and used by Vite
20
+ // on runtime to build the assets URL (for example when using a separate CDN for the assets).
21
+ // Inspired by https://github.com/vitejs/vite/blob/main/playground/assets/vite.config-runtime-base.js
22
+ var dynamicBaseAssetsCode = "globalThis.__toCdnUrl = filePath => window.app.cdnUrl.replace(/\\/$/, '') + '/' + filePath;";
23
+
24
+ function vitePluginDynamicBaseAssetsGlobals() {
25
+ return {
26
+ name: 'dynamic-base-assets-globals',
27
+ transformIndexHtml: function transformIndexHtml(html, ctx) {
28
+ if (ctx.bundle) {
29
+ // Only inject during build
30
+ return [{
31
+ tag: 'script',
32
+ attrs: {
33
+ type: 'module'
34
+ },
35
+ children: dynamicBaseAssetsCode
36
+ }];
37
+ }
38
+
39
+ return html;
40
+ }
41
+ };
42
+ }
16
43
 
17
44
  function run() {
18
45
  return _run.apply(this, arguments);
@@ -44,13 +71,14 @@ function _run() {
44
71
  _context.next = 7;
45
72
  return build({
46
73
  root: paths.appRoot,
74
+ base: './',
75
+ // <-- Important to allow configuring the runtime base path.
47
76
  define: {
48
77
  'process.env.DEBUG': _JSON$stringify(false),
49
78
  'process.env.NODE_ENV': _JSON$stringify('production')
50
79
  },
51
80
  build: {
52
81
  outDir: 'public',
53
- assetsDir: '.',
54
82
  rollupOptions: {
55
83
  // This is necessary to instruct Vite that the `index.html` (template)
56
84
  // is located in the `/public` folder.
@@ -62,12 +90,26 @@ function _run() {
62
90
  server: {
63
91
  port: DEFAULT_PORT
64
92
  },
93
+ experimental: {
94
+ // https://vitejs.dev/guide/build.html#advanced-base-options
95
+ renderBuiltUrl: function renderBuiltUrl(filename, _ref) {
96
+ var hostType = _ref.hostType;
97
+
98
+ if (hostType === 'html') {
99
+ return "__CDN_URL__".concat(filename);
100
+ }
101
+
102
+ return {
103
+ runtime: "window.__toCdnUrl(".concat(_JSON$stringify(filename), ")")
104
+ };
105
+ }
106
+ },
65
107
  plugins: [pluginGraphql(), pluginReact({
66
108
  jsxImportSource: '@emotion/react',
67
109
  babel: {
68
110
  plugins: ['@emotion/babel-plugin']
69
111
  }
70
- })]
112
+ }), vitePluginSvgr(), vitePluginDynamicBaseAssetsGlobals()]
71
113
  });
72
114
 
73
115
  case 7:
@@ -12,9 +12,11 @@ var pluginReact = require('@vitejs/plugin-react');
12
12
  var mcHtmlTemplate = require('@commercetools-frontend/mc-html-template');
13
13
  var assets = require('@commercetools-frontend/assets');
14
14
  var paths = require('./paths-76b66e74.cjs.prod.js');
15
+ var vitePluginSvgr = require('./vite-plugin-svgr-f3bbedbe.cjs.prod.js');
15
16
  require('@babel/runtime-corejs3/core-js-stable/instance/find');
16
17
  require('@babel/runtime-corejs3/core-js-stable/instance/concat');
17
18
  require('fs');
19
+ require('@rollup/pluginutils');
18
20
 
19
21
  function _interopDefault (e) { return e && e.__esModule ? e : { 'default': e }; }
20
22
 
@@ -26,6 +28,31 @@ var path__default = /*#__PURE__*/_interopDefault(path);
26
28
  var pluginGraphql__default = /*#__PURE__*/_interopDefault(pluginGraphql);
27
29
  var pluginReact__default = /*#__PURE__*/_interopDefault(pluginReact);
28
30
 
31
+ // This script/function is injected into the `index.html` and used by Vite
32
+ // on runtime to build the assets URL (for example when using a separate CDN for the assets).
33
+ // Inspired by https://github.com/vitejs/vite/blob/main/playground/assets/vite.config-runtime-base.js
34
+ var dynamicBaseAssetsCode = "globalThis.__toCdnUrl = filePath => window.app.cdnUrl.replace(/\\/$/, '') + '/' + filePath;";
35
+
36
+ function vitePluginDynamicBaseAssetsGlobals() {
37
+ return {
38
+ name: 'dynamic-base-assets-globals',
39
+ transformIndexHtml: function transformIndexHtml(html, ctx) {
40
+ if (ctx.bundle) {
41
+ // Only inject during build
42
+ return [{
43
+ tag: 'script',
44
+ attrs: {
45
+ type: 'module'
46
+ },
47
+ children: dynamicBaseAssetsCode
48
+ }];
49
+ }
50
+
51
+ return html;
52
+ }
53
+ };
54
+ }
55
+
29
56
  function run() {
30
57
  return _run.apply(this, arguments);
31
58
  }
@@ -56,13 +83,14 @@ function _run() {
56
83
  _context.next = 7;
57
84
  return vite.build({
58
85
  root: paths.paths.appRoot,
86
+ base: './',
87
+ // <-- Important to allow configuring the runtime base path.
59
88
  define: {
60
89
  'process.env.DEBUG': _JSON$stringify__default["default"](false),
61
90
  'process.env.NODE_ENV': _JSON$stringify__default["default"]('production')
62
91
  },
63
92
  build: {
64
93
  outDir: 'public',
65
- assetsDir: '.',
66
94
  rollupOptions: {
67
95
  // This is necessary to instruct Vite that the `index.html` (template)
68
96
  // is located in the `/public` folder.
@@ -74,12 +102,26 @@ function _run() {
74
102
  server: {
75
103
  port: DEFAULT_PORT
76
104
  },
105
+ experimental: {
106
+ // https://vitejs.dev/guide/build.html#advanced-base-options
107
+ renderBuiltUrl: function renderBuiltUrl(filename, _ref) {
108
+ var hostType = _ref.hostType;
109
+
110
+ if (hostType === 'html') {
111
+ return "__CDN_URL__".concat(filename);
112
+ }
113
+
114
+ return {
115
+ runtime: "window.__toCdnUrl(".concat(_JSON$stringify__default["default"](filename), ")")
116
+ };
117
+ }
118
+ },
77
119
  plugins: [pluginGraphql__default["default"](), pluginReact__default["default"]({
78
120
  jsxImportSource: '@emotion/react',
79
121
  babel: {
80
122
  plugins: ['@emotion/babel-plugin']
81
123
  }
82
- })]
124
+ }), vitePluginSvgr.vitePluginSvgr(), vitePluginDynamicBaseAssetsGlobals()]
83
125
  });
84
126
 
85
127
  case 7:
@@ -5,7 +5,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
5
5
  var vendorsToTranspile = require('./vendors-to-transpile-b51af5d3.cjs.dev.js');
6
6
 
7
7
  // NOTE: This string will be replaced on build time with the package version.
8
- var version = "21.8.0";
8
+ var version = "21.10.0";
9
9
 
10
10
  // These exports are deprecated.
11
11
  function createWebpackConfigForDevelopment(options) {
@@ -5,7 +5,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
5
5
  var vendorsToTranspile = require('./vendors-to-transpile-367e0ba8.cjs.prod.js');
6
6
 
7
7
  // NOTE: This string will be replaced on build time with the package version.
8
- var version = "21.8.0";
8
+ var version = "21.10.0";
9
9
 
10
10
  // These exports are deprecated.
11
11
  function createWebpackConfigForDevelopment(options) {
@@ -1,7 +1,7 @@
1
1
  export { v as vendorsToTranspile } from './vendors-to-transpile-68e03526.esm.js';
2
2
 
3
3
  // NOTE: This string will be replaced on build time with the package version.
4
- var version = "21.8.0";
4
+ var version = "21.10.0";
5
5
 
6
6
  // These exports are deprecated.
7
7
  function createWebpackConfigForDevelopment(options) {
@@ -11,71 +11,65 @@ import 'path';
11
11
 
12
12
  var appDirectory = fs.realpathSync(process.cwd());
13
13
 
14
- function run() {
14
+ function run(_x) {
15
15
  return _run.apply(this, arguments);
16
16
  }
17
17
 
18
18
  function _run() {
19
- _run = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
20
- var options,
21
- compiled,
22
- transformerPath,
23
- transformerFn,
24
- _context,
25
- _args = arguments;
19
+ _run = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(options) {
20
+ var compiled, transformerPath, transformerFn, _context;
26
21
 
27
22
  return _regeneratorRuntime.wrap(function _callee$(_context2) {
28
23
  while (1) {
29
24
  switch (_context2.prev = _context2.next) {
30
25
  case 0:
31
- options = _args.length > 0 && _args[0] !== undefined ? _args[0] : {};
32
26
  console.log('Compiling index.html...');
33
- _context2.next = 4;
27
+ _context2.next = 3;
34
28
  return compileHtml(paths.appIndexHtmlTemplate);
35
29
 
36
- case 4:
30
+ case 3:
37
31
  compiled = _context2.sent;
38
32
  fs.writeFileSync(paths.appIndexHtml, compiled.indexHtmlContent, {
39
33
  encoding: 'utf8'
40
34
  });
41
35
 
42
36
  if (!options.transformer) {
43
- _context2.next = 18;
37
+ _context2.next = 17;
44
38
  break;
45
39
  }
46
40
 
47
- _context2.prev = 7;
41
+ _context2.prev = 6;
48
42
  transformerPath = require.resolve(options.transformer, {
49
43
  paths: [appDirectory]
50
44
  });
51
45
  transformerFn = require(transformerPath);
52
46
  transformerFn(compiled);
53
- _context2.next = 16;
47
+ _context2.next = 15;
54
48
  break;
55
49
 
56
- case 13:
57
- _context2.prev = 13;
58
- _context2.t0 = _context2["catch"](7);
50
+ case 12:
51
+ _context2.prev = 12;
52
+ _context2.t0 = _context2["catch"](6);
59
53
  throw new Error(_concatInstanceProperty(_context = "Could not load transformer module \"".concat(options.transformer, "\"\n")).call(_context, _context2.t0 instanceof Error ? _context2.t0.stack : ''));
60
54
 
61
- case 16:
62
- _context2.next = 19;
55
+ case 15:
56
+ _context2.next = 18;
63
57
  break;
64
58
 
65
- case 18:
66
- if (options['print-security-headers']) {
59
+ case 17:
60
+ if (options.printSecurityHeaders) {
67
61
  console.log(_JSON$stringify(compiled.headers));
68
62
  }
69
63
 
70
- case 19:
64
+ case 18:
71
65
  console.log(chalk.green('Compiled successfully.\n'));
72
66
 
73
- case 20:
67
+ case 19:
74
68
  case "end":
75
69
  return _context2.stop();
76
70
  }
77
71
  }
78
- }, _callee, null, [[7, 13]]);
72
+ }, _callee, null, [[6, 12]]);
79
73
  }));
80
74
  return _run.apply(this, arguments);
81
75
  }
@@ -21,71 +21,65 @@ var chalk__default = /*#__PURE__*/_interopDefault(chalk);
21
21
 
22
22
  var appDirectory = fs__default["default"].realpathSync(process.cwd());
23
23
 
24
- function run() {
24
+ function run(_x) {
25
25
  return _run.apply(this, arguments);
26
26
  }
27
27
 
28
28
  function _run() {
29
- _run = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _callee() {
30
- var options,
31
- compiled,
32
- transformerPath,
33
- transformerFn,
34
- _context,
35
- _args = arguments;
29
+ _run = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _callee(options) {
30
+ var compiled, transformerPath, transformerFn, _context;
36
31
 
37
32
  return _regeneratorRuntime__default["default"].wrap(function _callee$(_context2) {
38
33
  while (1) {
39
34
  switch (_context2.prev = _context2.next) {
40
35
  case 0:
41
- options = _args.length > 0 && _args[0] !== undefined ? _args[0] : {};
42
36
  console.log('Compiling index.html...');
43
- _context2.next = 4;
37
+ _context2.next = 3;
44
38
  return mcHtmlTemplate.compileHtml(paths.paths.appIndexHtmlTemplate);
45
39
 
46
- case 4:
40
+ case 3:
47
41
  compiled = _context2.sent;
48
42
  fs__default["default"].writeFileSync(paths.paths.appIndexHtml, compiled.indexHtmlContent, {
49
43
  encoding: 'utf8'
50
44
  });
51
45
 
52
46
  if (!options.transformer) {
53
- _context2.next = 18;
47
+ _context2.next = 17;
54
48
  break;
55
49
  }
56
50
 
57
- _context2.prev = 7;
51
+ _context2.prev = 6;
58
52
  transformerPath = require.resolve(options.transformer, {
59
53
  paths: [appDirectory]
60
54
  });
61
55
  transformerFn = require(transformerPath);
62
56
  transformerFn(compiled);
63
- _context2.next = 16;
57
+ _context2.next = 15;
64
58
  break;
65
59
 
66
- case 13:
67
- _context2.prev = 13;
68
- _context2.t0 = _context2["catch"](7);
60
+ case 12:
61
+ _context2.prev = 12;
62
+ _context2.t0 = _context2["catch"](6);
69
63
  throw new Error(_concatInstanceProperty__default["default"](_context = "Could not load transformer module \"".concat(options.transformer, "\"\n")).call(_context, _context2.t0 instanceof Error ? _context2.t0.stack : ''));
70
64
 
71
- case 16:
72
- _context2.next = 19;
65
+ case 15:
66
+ _context2.next = 18;
73
67
  break;
74
68
 
75
- case 18:
76
- if (options['print-security-headers']) {
69
+ case 17:
70
+ if (options.printSecurityHeaders) {
77
71
  console.log(_JSON$stringify__default["default"](compiled.headers));
78
72
  }
79
73
 
80
- case 19:
74
+ case 18:
81
75
  console.log(chalk__default["default"].green('Compiled successfully.\n'));
82
76
 
83
- case 20:
77
+ case 19:
84
78
  case "end":
85
79
  return _context2.stop();
86
80
  }
87
81
  }
88
- }, _callee, null, [[7, 13]]);
82
+ }, _callee, null, [[6, 12]]);
89
83
  }));
90
84
  return _run.apply(this, arguments);
91
85
  }
@@ -21,71 +21,65 @@ var chalk__default = /*#__PURE__*/_interopDefault(chalk);
21
21
 
22
22
  var appDirectory = fs__default["default"].realpathSync(process.cwd());
23
23
 
24
- function run() {
24
+ function run(_x) {
25
25
  return _run.apply(this, arguments);
26
26
  }
27
27
 
28
28
  function _run() {
29
- _run = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _callee() {
30
- var options,
31
- compiled,
32
- transformerPath,
33
- transformerFn,
34
- _context,
35
- _args = arguments;
29
+ _run = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _callee(options) {
30
+ var compiled, transformerPath, transformerFn, _context;
36
31
 
37
32
  return _regeneratorRuntime__default["default"].wrap(function _callee$(_context2) {
38
33
  while (1) {
39
34
  switch (_context2.prev = _context2.next) {
40
35
  case 0:
41
- options = _args.length > 0 && _args[0] !== undefined ? _args[0] : {};
42
36
  console.log('Compiling index.html...');
43
- _context2.next = 4;
37
+ _context2.next = 3;
44
38
  return mcHtmlTemplate.compileHtml(paths.paths.appIndexHtmlTemplate);
45
39
 
46
- case 4:
40
+ case 3:
47
41
  compiled = _context2.sent;
48
42
  fs__default["default"].writeFileSync(paths.paths.appIndexHtml, compiled.indexHtmlContent, {
49
43
  encoding: 'utf8'
50
44
  });
51
45
 
52
46
  if (!options.transformer) {
53
- _context2.next = 18;
47
+ _context2.next = 17;
54
48
  break;
55
49
  }
56
50
 
57
- _context2.prev = 7;
51
+ _context2.prev = 6;
58
52
  transformerPath = require.resolve(options.transformer, {
59
53
  paths: [appDirectory]
60
54
  });
61
55
  transformerFn = require(transformerPath);
62
56
  transformerFn(compiled);
63
- _context2.next = 16;
57
+ _context2.next = 15;
64
58
  break;
65
59
 
66
- case 13:
67
- _context2.prev = 13;
68
- _context2.t0 = _context2["catch"](7);
60
+ case 12:
61
+ _context2.prev = 12;
62
+ _context2.t0 = _context2["catch"](6);
69
63
  throw new Error(_concatInstanceProperty__default["default"](_context = "Could not load transformer module \"".concat(options.transformer, "\"\n")).call(_context, _context2.t0 instanceof Error ? _context2.t0.stack : ''));
70
64
 
71
- case 16:
72
- _context2.next = 19;
65
+ case 15:
66
+ _context2.next = 18;
73
67
  break;
74
68
 
75
- case 18:
76
- if (options['print-security-headers']) {
69
+ case 17:
70
+ if (options.printSecurityHeaders) {
77
71
  console.log(_JSON$stringify__default["default"](compiled.headers));
78
72
  }
79
73
 
80
- case 19:
74
+ case 18:
81
75
  console.log(chalk__default["default"].green('Compiled successfully.\n'));
82
76
 
83
- case 20:
77
+ case 19:
84
78
  case "end":
85
79
  return _context2.stop();
86
80
  }
87
81
  }
88
- }, _callee, null, [[7, 13]]);
82
+ }, _callee, null, [[6, 12]]);
89
83
  }));
90
84
  return _run.apply(this, arguments);
91
85
  }