@raisenow/tamaro-cli 1.0.8 → 1.0.11

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.
@@ -1,166 +1,68 @@
1
- var __create = Object.create;
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __getOwnPropSymbols = Object.getOwnPropertySymbols;
6
- var __getProtoOf = Object.getPrototypeOf;
7
- var __hasOwnProp = Object.prototype.hasOwnProperty;
8
- var __propIsEnum = Object.prototype.propertyIsEnumerable;
9
- var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
10
- var __spreadValues = (a, b) => {
11
- for (var prop in b || (b = {}))
12
- if (__hasOwnProp.call(b, prop))
13
- __defNormalProp(a, prop, b[prop]);
14
- if (__getOwnPropSymbols)
15
- for (var prop of __getOwnPropSymbols(b)) {
16
- if (__propIsEnum.call(b, prop))
17
- __defNormalProp(a, prop, b[prop]);
18
- }
19
- return a;
20
- };
21
- var __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
22
- var __export = (target, all) => {
23
- for (var name in all)
24
- __defProp(target, name, { get: all[name], enumerable: true });
25
- };
26
- var __reExport = (target, module2, copyDefault, desc) => {
27
- if (module2 && typeof module2 === "object" || typeof module2 === "function") {
28
- for (let key of __getOwnPropNames(module2))
29
- if (!__hasOwnProp.call(target, key) && (copyDefault || key !== "default"))
30
- __defProp(target, key, { get: () => module2[key], enumerable: !(desc = __getOwnPropDesc(module2, key)) || desc.enumerable });
31
- }
32
- return target;
33
- };
34
- var __toESM = (module2, isNodeMode) => {
35
- return __reExport(__markAsModule(__defProp(module2 != null ? __create(__getProtoOf(module2)) : {}, "default", !isNodeMode && module2 && module2.__esModule ? { get: () => module2.default, enumerable: true } : { value: module2, enumerable: true })), module2);
36
- };
37
- var __toCommonJS = /* @__PURE__ */ ((cache) => {
38
- return (module2, temp) => {
39
- return cache && cache.get(module2) || (temp = __reExport(__markAsModule({}), module2, 1), cache && cache.set(module2, temp), temp);
40
- };
41
- })(typeof WeakMap !== "undefined" ? /* @__PURE__ */ new WeakMap() : 0);
1
+ import {
2
+ __spreadValues,
3
+ extensions,
4
+ getIfCoreFns,
5
+ getPaths,
6
+ getRelativePaths,
7
+ getWidgetUuid,
8
+ logDataTable,
9
+ logTitle,
10
+ moduleFileExtensions,
11
+ resolveApp
12
+ } from "./chunk-PIEFLCDU.js";
42
13
 
43
14
  // src/webpack.config.ts
44
- var webpack_config_exports = {};
45
- __export(webpack_config_exports, {
46
- default: () => webpack_config_default
47
- });
48
- var import_path2 = require("path");
49
- var import_glob = __toESM(require("glob"));
50
- var import_webpack_config_utils2 = require("webpack-config-utils");
51
- var import_webpack = __toESM(require("webpack"));
52
- var import_portfinder = require("portfinder");
53
- var import_tsconfig_paths_webpack_plugin = require("tsconfig-paths-webpack-plugin");
54
- var import_clean_webpack_plugin = require("clean-webpack-plugin");
55
- var import_html_webpack_plugin2 = __toESM(require("html-webpack-plugin"));
56
- var import_fork_ts_checker_webpack_plugin = __toESM(require("fork-ts-checker-webpack-plugin"));
57
- var import_react_refresh_webpack_plugin = __toESM(require("@pmmmwh/react-refresh-webpack-plugin"));
58
- var import_mini_css_extract_plugin = __toESM(require("mini-css-extract-plugin"));
59
- var import_css_minimizer_webpack_plugin = __toESM(require("css-minimizer-webpack-plugin"));
60
- var import_eslint_webpack_plugin = __toESM(require("eslint-webpack-plugin"));
61
- var import_copy_webpack_plugin = __toESM(require("copy-webpack-plugin"));
62
- var import_webpack_plugin = __toESM(require("@statoscope/webpack-plugin"));
15
+ import { createRequire as createRequire2 } from "module";
16
+ import { basename, dirname } from "path";
17
+ import { existsSync } from "fs";
18
+ import glob from "glob";
19
+ import { getIfUtils, removeEmpty } from "webpack-config-utils";
20
+ import webpack from "webpack";
21
+ import { TsconfigPathsPlugin } from "tsconfig-paths-webpack-plugin";
22
+ import { CleanWebpackPlugin } from "clean-webpack-plugin";
23
+ import HtmlWebpackPlugin2 from "html-webpack-plugin";
24
+ import ForkTsCheckerWebpackPlugin from "fork-ts-checker-webpack-plugin";
25
+ import ReactRefreshWebpackPlugin from "@pmmmwh/react-refresh-webpack-plugin";
26
+ import MiniCssExtractPlugin from "mini-css-extract-plugin";
27
+ import CssMinimizerPlugin from "css-minimizer-webpack-plugin";
28
+ import ESLintPlugin from "eslint-webpack-plugin";
29
+ import CopyPlugin from "copy-webpack-plugin";
30
+ import StatoscopeWebpackPlugin from "@statoscope/webpack-plugin";
63
31
 
64
32
  // src/lib/InterpolateHtmlPlugin.ts
65
- var import_html_webpack_plugin = __toESM(require("html-webpack-plugin"));
66
- var import_escape_string_regexp = __toESM(require("escape-string-regexp"));
33
+ import HtmlWebpackPlugin from "html-webpack-plugin";
34
+ import escapeStringRegexp from "escape-string-regexp";
35
+ var PLUGIN_NAME = "InterpolateHtmlPlugin";
67
36
  var InterpolateHtmlPlugin = class {
68
37
  replacements;
69
38
  constructor(replacements) {
70
39
  this.replacements = __spreadValues({}, replacements);
71
40
  }
72
41
  apply(compiler) {
73
- compiler.hooks.compilation.tap("InterpolateHtmlPlugin", (compilation) => {
74
- const hooks = import_html_webpack_plugin.default.getHooks(compilation);
75
- hooks.alterAssetTagGroups.tap("InterpolateHtmlPlugin", (assets) => {
42
+ compiler.hooks.compilation.tap(PLUGIN_NAME, (compilation) => {
43
+ const hooks = HtmlWebpackPlugin.getHooks(compilation);
44
+ hooks.alterAssetTagGroups.tap(PLUGIN_NAME, (assets) => {
76
45
  this.replacements["ENTRY"] = assets.headTags[0].attributes["src"];
77
46
  return assets;
78
47
  });
79
- hooks.afterTemplateExecution.tap("InterpolateHtmlPlugin", (data) => {
48
+ hooks.afterTemplateExecution.tap(PLUGIN_NAME, (data) => {
80
49
  Object.entries(this.replacements).forEach(([key, value]) => {
81
- data.html = data.html.replace(new RegExp(`%${(0, import_escape_string_regexp.default)(key)}%`, "g"), value);
50
+ data.html = data.html.replace(new RegExp(`%${escapeStringRegexp(key)}%`, "g"), value);
82
51
  });
83
52
  return data;
84
53
  });
85
54
  });
86
55
  }
87
56
  };
88
- var InterpolateHtmlPlugin_default = InterpolateHtmlPlugin;
89
57
 
90
- // src/lib/helpers.ts
91
- var import_path = require("path");
92
- var import_fs = require("fs");
93
- var import_chalk = __toESM(require("chalk"));
94
- var import_node_notifier = require("node-notifier");
95
- var import_webpack_config_utils = require("webpack-config-utils");
96
- var import_columnify = __toESM(require("columnify"));
97
- var import_boxen = __toESM(require("boxen"));
98
- var import_dotenv_expand = require("dotenv-expand");
99
- var import_dotenv = require("dotenv");
100
- var import_strip_indent = __toESM(require("strip-indent"));
101
- var TAMARO_CORE_PACKAGE_NAMES = ["@raisenow/tamaro-core", "demo-tamaro-core"];
102
- var TAMARO_CONFIGURATIONS_PACKAGE_NAMES = [
103
- "@raisenow/tamaro-configurations",
104
- "demo-tamaro-configurations"
105
- ];
106
- var getIfCoreFns = () => {
107
- const corePkgPath = resolveApp("package.json");
108
- const configsPkgPath = resolveApp("../../package.json");
109
- if ((0, import_fs.existsSync)(corePkgPath)) {
110
- const { name } = require(corePkgPath);
111
- if (TAMARO_CORE_PACKAGE_NAMES.includes(name)) {
112
- return (0, import_webpack_config_utils.getIfUtils)({ core: true }, ["core"]);
113
- }
114
- }
115
- if ((0, import_fs.existsSync)(configsPkgPath)) {
116
- const { name } = require(configsPkgPath);
117
- if (TAMARO_CONFIGURATIONS_PACKAGE_NAMES.includes(name)) {
118
- return (0, import_webpack_config_utils.getIfUtils)({ core: false }, ["core"]);
119
- }
120
- }
121
- console.error(import_chalk.default.red((0, import_strip_indent.default)(` You must run "npx @raisenow/tamaro-cli" commands from:
122
- 1. Root of "${import_chalk.default.bold(TAMARO_CORE_PACKAGE_NAMES[0])}" package folder.
123
- 2. Root of particular customer configuration folder of "${import_chalk.default.bold(TAMARO_CONFIGURATIONS_PACKAGE_NAMES[0])}" package.
124
- You are currently in "${import_chalk.default.bold((0, import_fs.realpathSync)(process.cwd()))}".
125
- `)));
126
- process.exit(0);
127
- };
128
- var moduleFileExtensions = ["ts", "tsx", "js", "jsx"];
129
- var extensions = moduleFileExtensions.map((v) => `.${v}`);
130
- var resolveApp = (relativePath) => (0, import_path.resolve)((0, import_fs.realpathSync)(process.cwd()), relativePath);
131
- var resolveOwn = (relativePath) => (0, import_path.resolve)(__dirname, "..", relativePath);
132
- var resolveModule = (resolveFn, filePath) => {
133
- const extension = moduleFileExtensions.find((extension2) => (0, import_fs.existsSync)(resolveFn(`${filePath}.${extension2}`)));
134
- if (extension) {
135
- return resolveFn(`${filePath}.${extension}`);
136
- }
137
- return resolveFn(`${filePath}.js`);
138
- };
139
- var getWidgetUuid = () => (0, import_path.basename)(resolveApp("."));
140
- var getPaths = (ifCore) => {
141
- return ifCore({
142
- app: resolveApp("."),
143
- appEntry: resolveModule(resolveApp, "src/index"),
144
- appDist: resolveApp("dist"),
145
- appNodeModules: resolveApp("node_modules"),
146
- appTsConfig: resolveApp("tsconfig.json"),
147
- appHtml: resolveApp("src/*.html"),
148
- appEnv: resolveApp(".env"),
149
- appTailwindConfig: resolveApp("tailwind.config.js")
150
- }, {
151
- app: resolveApp("."),
152
- appEntry: resolveModule(resolveApp, "widget"),
153
- appDist: resolveApp(`../../dist/${getWidgetUuid()}`),
154
- appNodeModules: resolveApp("../../node_modules"),
155
- appTsConfig: resolveApp("tsconfig.json"),
156
- appHtml: resolveApp("*.html"),
157
- appEnv: resolveApp(".env"),
158
- appTailwindConfig: void 0
159
- });
160
- };
58
+ // src/lib/env.ts
59
+ import { createRequire } from "module";
60
+ import { expand as dotenvExpand } from "dotenv-expand";
61
+ import { config as dotenvConfig } from "dotenv";
62
+ var require2 = createRequire(import.meta.url);
161
63
  var getEnvVars = (filePath, ifMin, ifCore, ifLocalCore) => {
162
64
  var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n;
163
- (0, import_dotenv_expand.expand)((0, import_dotenv.config)({ path: filePath }));
65
+ dotenvExpand(dotenvConfig({ path: filePath }));
164
66
  (_b = (_a = process.env).NODE_ENV) != null ? _b : _a.NODE_ENV = ifMin("production", "development");
165
67
  (_d = (_c = process.env).BABEL_ENV) != null ? _d : _c.BABEL_ENV = ifMin("production", "development");
166
68
  (_f = (_e = process.env).EXPOSE_VAR) != null ? _f : _e.EXPOSE_VAR = ifCore("rnw.tamaroCore", "rnw.tamaro");
@@ -170,7 +72,7 @@ var getEnvVars = (filePath, ifMin, ifCore, ifLocalCore) => {
170
72
  if (ifCore()) {
171
73
  process.env.PRODUCT_NAME = "tamaro";
172
74
  const corePkgPath = resolveApp("package.json");
173
- const { version } = require(corePkgPath);
75
+ const { version } = require2(corePkgPath);
174
76
  process.env.PRODUCT_VERSION = version;
175
77
  }
176
78
  if (!ifCore()) {
@@ -208,42 +110,29 @@ var getEnvVars = (filePath, ifMin, ifCore, ifLocalCore) => {
208
110
  };
209
111
  return { raw, stringified };
210
112
  };
211
- var logDataTable = (vars, title) => {
212
- const boxTitle = import_chalk.default.bold(`${title}:
213
- `);
214
- const boxTable = (0, import_columnify.default)(vars, { showHeaders: false });
215
- console.log((0, import_boxen.default)(`${boxTitle}
216
- ${boxTable}`, {
217
- margin: 0,
218
- padding: {
219
- top: 0,
220
- right: 1,
221
- bottom: 0,
222
- left: 1
223
- },
224
- borderColor: "green"
225
- }));
226
- };
227
113
 
228
114
  // src/webpack.config.ts
115
+ var require3 = createRequire2(import.meta.url);
229
116
  var imageInlineSizeLimit = 0;
230
117
  var getWebpackConfig = async (env) => {
231
- const { ifMin, ifNotMin } = (0, import_webpack_config_utils2.getIfUtils)(env, ["min"]);
232
- const { ifAnalyze } = (0, import_webpack_config_utils2.getIfUtils)(env, ["analyze"]);
233
- const { ifLocalCore } = (0, import_webpack_config_utils2.getIfUtils)(env, ["localCore"]);
118
+ const { ifMin, ifNotMin } = getIfUtils(env, ["min"]);
119
+ const { ifAnalyze } = getIfUtils(env, ["analyze"]);
120
+ const { ifLocalCore } = getIfUtils(env, ["localCore"]);
234
121
  const { ifCore } = getIfCoreFns();
235
122
  const paths = getPaths(ifCore);
236
- const appHtmlFiles = import_glob.default.sync(paths.appHtml);
123
+ const appHtmlFiles = glob.sync(paths.appHtml);
237
124
  const envVars = getEnvVars(paths.appEnv, ifMin, ifCore, ifLocalCore);
238
- const { ifHmr } = (0, import_webpack_config_utils2.getIfUtils)({ hmr: process.env.HMR_ENABLED === "true" }, ["hmr"]);
239
- const port = await (0, import_portfinder.getPortPromise)({ port: 1234 });
240
- logDataTable(paths, "Paths");
241
- logDataTable(envVars.raw, "Environment variables");
125
+ const { ifHmr } = getIfUtils({ hmr: process.env.HMR_ENABLED === "true" }, ["hmr"]);
126
+ const useTailwind = ifCore() && paths.appTailwindConfig && existsSync(paths.appTailwindConfig);
127
+ logTitle("Paths:");
128
+ logDataTable(getRelativePaths(paths));
129
+ logTitle("Environment variables:");
130
+ logDataTable(envVars.raw);
242
131
  const getCssLoaders = (cssOptions = {}) => {
243
- return (0, import_webpack_config_utils2.removeEmpty)([
244
- ifMin({ loader: import_mini_css_extract_plugin.default.loader }),
132
+ return removeEmpty([
133
+ ifMin({ loader: MiniCssExtractPlugin.loader }),
245
134
  ifNotMin({
246
- loader: require.resolve("style-loader"),
135
+ loader: require3.resolve("style-loader"),
247
136
  options: {
248
137
  attributes: {
249
138
  "data-widget": process.env.ELEMENT_ATTRIBUTE_DATA_WIDGET
@@ -251,30 +140,35 @@ var getWebpackConfig = async (env) => {
251
140
  }
252
141
  }),
253
142
  {
254
- loader: require.resolve("css-loader"),
143
+ loader: require3.resolve("css-loader"),
255
144
  options: __spreadValues({
256
145
  sourceMap: ifNotMin(),
257
146
  importLoaders: 3
258
147
  }, cssOptions)
259
148
  },
260
149
  {
261
- loader: require.resolve("postcss-loader"),
150
+ loader: require3.resolve("postcss-loader"),
262
151
  options: {
263
152
  postcssOptions: {
264
- plugins: (0, import_webpack_config_utils2.removeEmpty)([
265
- ifCore([require.resolve("tailwindcss"), paths.appTailwindConfig]),
266
- require.resolve("postcss-custom-properties"),
267
- require.resolve("autoprefixer")
153
+ plugins: removeEmpty([
154
+ useTailwind ? [
155
+ require3.resolve("tailwindcss", {
156
+ paths: [paths.appNodeModules]
157
+ }),
158
+ paths.appTailwindConfig
159
+ ] : void 0,
160
+ require3.resolve("postcss-custom-properties"),
161
+ require3.resolve("autoprefixer")
268
162
  ])
269
163
  }
270
164
  }
271
165
  },
272
166
  {
273
- loader: require.resolve("resolve-url-loader"),
167
+ loader: require3.resolve("resolve-url-loader"),
274
168
  options: { sourceMap: ifNotMin() }
275
169
  },
276
170
  {
277
- loader: require.resolve("sass-loader"),
171
+ loader: require3.resolve("sass-loader"),
278
172
  options: { sourceMap: true }
279
173
  }
280
174
  ]);
@@ -286,13 +180,13 @@ var getWebpackConfig = async (env) => {
286
180
  extensions: [...extensions, "..."],
287
181
  modules: ["node_modules", paths.appNodeModules],
288
182
  plugins: [
289
- new import_tsconfig_paths_webpack_plugin.TsconfigPathsPlugin({
183
+ new TsconfigPathsPlugin({
290
184
  configFile: paths.appTsConfig,
291
185
  extensions
292
186
  })
293
187
  ]
294
188
  },
295
- entry: [resolveOwn("src/lib/polyfills.js"), paths.appEntry],
189
+ entry: paths.appEntry,
296
190
  output: {
297
191
  publicPath: "auto",
298
192
  path: ifMin(paths.appDist, void 0),
@@ -314,12 +208,12 @@ var getWebpackConfig = async (env) => {
314
208
  errorDetails: true
315
209
  }),
316
210
  module: {
317
- rules: (0, import_webpack_config_utils2.removeEmpty)([
211
+ rules: removeEmpty([
318
212
  ifNotMin({
319
213
  enforce: "pre",
320
214
  exclude: /@babel\/runtime/,
321
215
  test: /\.(js|jsx|ts|tsx|css|scss)$/,
322
- use: require.resolve("source-map-loader")
216
+ use: require3.resolve("source-map-loader")
323
217
  }),
324
218
  {
325
219
  oneOf: [
@@ -330,42 +224,42 @@ var getWebpackConfig = async (env) => {
330
224
  resolveApp("node_modules/micromark"),
331
225
  resolveApp("node_modules/decode-named-character-reference")
332
226
  ], [resolveApp("."), resolveApp("../../src")]),
333
- loader: require.resolve("babel-loader"),
227
+ loader: require3.resolve("babel-loader"),
334
228
  options: {
335
229
  babelrc: false,
336
230
  configFile: false,
337
231
  sourceMaps: ifNotMin(),
338
232
  inputSourceMap: ifNotMin(),
339
233
  presets: [
340
- require.resolve("@babel/preset-env"),
234
+ require3.resolve("@babel/preset-env"),
341
235
  [
342
- require.resolve("@babel/preset-typescript"),
236
+ require3.resolve("@babel/preset-typescript"),
343
237
  {
344
238
  allowDeclareFields: true
345
239
  }
346
240
  ],
347
- require.resolve("@babel/preset-react")
241
+ require3.resolve("@babel/preset-react")
348
242
  ],
349
- plugins: (0, import_webpack_config_utils2.removeEmpty)([
243
+ plugins: removeEmpty([
350
244
  [
351
- require.resolve("@babel/plugin-transform-runtime"),
245
+ require3.resolve("@babel/plugin-transform-runtime"),
352
246
  {
353
247
  corejs: {
354
248
  version: 3,
355
249
  proposals: true
356
250
  },
357
- absoluteRuntime: (0, import_path2.dirname)(require.resolve("@babel/runtime-corejs3/package.json"))
251
+ absoluteRuntime: dirname(require3.resolve("@babel/runtime-corejs3/package.json"))
358
252
  }
359
253
  ],
360
254
  [
361
- require.resolve("@babel/plugin-proposal-decorators"),
255
+ require3.resolve("@babel/plugin-proposal-decorators"),
362
256
  {
363
257
  legacy: true
364
258
  }
365
259
  ],
366
- require.resolve("@babel/plugin-syntax-dynamic-import"),
367
- require.resolve("babel-plugin-lodash"),
368
- ifHmr(require.resolve("react-refresh/babel"))
260
+ require3.resolve("@babel/plugin-syntax-dynamic-import"),
261
+ require3.resolve("babel-plugin-lodash"),
262
+ ifHmr(require3.resolve("react-refresh/babel"))
369
263
  ])
370
264
  }
371
265
  },
@@ -400,7 +294,7 @@ var getWebpackConfig = async (env) => {
400
294
  issuer: [/\.(ts|tsx|js|jsx|md|mdx)$/],
401
295
  use: [
402
296
  {
403
- loader: require.resolve("@svgr/webpack"),
297
+ loader: require3.resolve("@svgr/webpack"),
404
298
  options: {
405
299
  svgoConfig: {
406
300
  plugins: [
@@ -417,7 +311,7 @@ var getWebpackConfig = async (env) => {
417
311
  }
418
312
  },
419
313
  {
420
- loader: require.resolve("url-loader"),
314
+ loader: require3.resolve("url-loader"),
421
315
  options: {
422
316
  name: "assets/[name]-[contenthash:16].[ext]",
423
317
  limit: imageInlineSizeLimit
@@ -437,13 +331,13 @@ var getWebpackConfig = async (env) => {
437
331
  {
438
332
  test: /\.ya?ml$/,
439
333
  use: [
440
- { loader: require.resolve("json-loader") },
441
- { loader: require.resolve("yaml-loader") }
334
+ { loader: require3.resolve("json-loader") },
335
+ { loader: require3.resolve("yaml-loader") }
442
336
  ]
443
337
  },
444
338
  {
445
339
  test: /\.html$/,
446
- loader: require.resolve("html-loader"),
340
+ loader: require3.resolve("html-loader"),
447
341
  options: {
448
342
  minimize: false
449
343
  }
@@ -458,7 +352,6 @@ var getWebpackConfig = async (env) => {
458
352
  },
459
353
  devtool: ifMin(false, "cheap-module-source-map"),
460
354
  devServer: {
461
- port,
462
355
  static: false,
463
356
  historyApiFallback: {
464
357
  disableDotRule: true
@@ -476,28 +369,28 @@ var getWebpackConfig = async (env) => {
476
369
  },
477
370
  optimization: {
478
371
  removeEmptyChunks: true,
479
- minimizer: ["...", new import_css_minimizer_webpack_plugin.default()]
372
+ minimizer: ["...", new CssMinimizerPlugin()]
480
373
  },
481
- plugins: (0, import_webpack_config_utils2.removeEmpty)([
482
- new import_webpack.ProgressPlugin(),
483
- new import_eslint_webpack_plugin.default({
374
+ plugins: removeEmpty([
375
+ new webpack.ProgressPlugin(),
376
+ new ESLintPlugin({
484
377
  extensions: moduleFileExtensions,
485
- eslintPath: require.resolve("eslint"),
378
+ eslintPath: require3.resolve("eslint"),
486
379
  cwd: paths.app,
487
380
  resolvePluginsRelativeTo: paths.app
488
381
  }),
489
- ifMin(new import_clean_webpack_plugin.CleanWebpackPlugin({})),
490
- ...appHtmlFiles.map((file) => new import_html_webpack_plugin2.default({
382
+ ifMin(new CleanWebpackPlugin({})),
383
+ ...appHtmlFiles.map((file) => new HtmlWebpackPlugin2({
491
384
  template: file,
492
- filename: (0, import_path2.basename)(file),
385
+ filename: basename(file),
493
386
  inject: false,
494
387
  minify: false
495
388
  })),
496
- new InterpolateHtmlPlugin_default(envVars.raw),
497
- new import_webpack.DefinePlugin(envVars.stringified),
498
- new import_fork_ts_checker_webpack_plugin.default({
389
+ new InterpolateHtmlPlugin(envVars.raw),
390
+ new webpack.DefinePlugin(envVars.stringified),
391
+ new ForkTsCheckerWebpackPlugin({
499
392
  typescript: {
500
- typescriptPath: require.resolve("typescript", {
393
+ typescriptPath: require3.resolve("typescript", {
501
394
  paths: [paths.appNodeModules]
502
395
  }),
503
396
  configFile: paths.appTsConfig,
@@ -510,8 +403,8 @@ var getWebpackConfig = async (env) => {
510
403
  }
511
404
  }
512
405
  }),
513
- ifHmr(new import_react_refresh_webpack_plugin.default()),
514
- ifMin(new import_mini_css_extract_plugin.default({
406
+ ifHmr(new ReactRefreshWebpackPlugin()),
407
+ ifMin(new MiniCssExtractPlugin({
515
408
  filename: "[name]-[contenthash:16].css",
516
409
  chunkFilename: "[name]-[contenthash:16].css",
517
410
  ignoreOrder: true,
@@ -519,31 +412,30 @@ var getWebpackConfig = async (env) => {
519
412
  "data-widget": `${process.env.ELEMENT_ATTRIBUTE_DATA_WIDGET}`
520
413
  }
521
414
  })),
522
- new import_webpack.IgnorePlugin({
415
+ new webpack.IgnorePlugin({
523
416
  resourceRegExp: /^\.\/locale$/,
524
417
  contextRegExp: /moment$/
525
418
  }),
526
- ifMin(new import_webpack.default.ids.HashedModuleIdsPlugin()),
527
- ifMin() && ifCore() ? new import_copy_webpack_plugin.default({
528
- patterns: [
529
- {
530
- from: "docs",
531
- to: "docs"
532
- }
533
- ]
419
+ ifMin(new webpack.ids.HashedModuleIdsPlugin()),
420
+ ifMin() && ifCore() ? new CopyPlugin({
421
+ patterns: ["README.md", "readme.html"]
534
422
  }) : void 0,
535
- ifMin() && ifAnalyze() ? new import_webpack_plugin.default({
423
+ ifMin() && ifAnalyze() ? new StatoscopeWebpackPlugin({
536
424
  name: ifCore("tamaro-core", "tamaro-customer-config"),
537
425
  saveReportTo: "reports/report.html",
538
426
  saveStatsTo: "reports/stats-[name]-[hash].json",
539
- additionalStats: import_glob.default.sync("reports/*.json"),
427
+ additionalStats: glob.sync("reports/*.json"),
540
428
  open: false
541
429
  }) : void 0
542
- ])
430
+ ]),
431
+ infrastructureLogging: {
432
+ stream: process.stdout,
433
+ appendOnly: false
434
+ }
543
435
  };
544
- return (0, import_webpack_config_utils2.removeEmpty)(config);
436
+ return removeEmpty(config);
545
437
  };
546
438
  var webpack_config_default = getWebpackConfig;
547
- module.exports = __toCommonJS(webpack_config_exports);
548
- // Annotate the CommonJS export names for ESM import in node:
549
- 0 && (module.exports = {});
439
+ export {
440
+ webpack_config_default as default
441
+ };