@commercetools-frontend/mc-scripts 27.6.3 → 27.8.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 +7 -7
- package/cli/dist/commercetools-frontend-mc-scripts-cli.cjs.prod.js +7 -7
- package/cli/dist/commercetools-frontend-mc-scripts-cli.esm.js +7 -7
- package/dist/{build-52bd5e84.cjs.dev.js → build-37bc930a.cjs.dev.js} +4 -3
- package/dist/{build-ac5d374e.esm.js → build-5cf73f12.esm.js} +4 -3
- package/dist/{build-44ca5f62.cjs.prod.js → build-cd4fa021.cjs.prod.js} +4 -3
- package/dist/{build-vite-a9c1c374.esm.js → build-vite-2ea8a241.esm.js} +6 -1
- package/dist/{build-vite-73361390.cjs.prod.js → build-vite-377f721f.cjs.prod.js} +6 -1
- package/dist/{build-vite-8453739c.cjs.dev.js → build-vite-e4eeb1a3.cjs.dev.js} +6 -1
- 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/{config-sync-2edee049.esm.js → config-sync-92843fd3.esm.js} +3 -3
- package/dist/{config-sync-7592aa12.cjs.prod.js → config-sync-b4cdfff2.cjs.prod.js} +3 -3
- package/dist/{config-sync-c42e7ac4.cjs.dev.js → config-sync-ce00b14f.cjs.dev.js} +3 -3
- package/dist/{config-sync-ci-d1b22fbc.esm.js → config-sync-ci-5f63ed76.esm.js} +3 -3
- package/dist/{config-sync-ci-65a5a226.cjs.dev.js → config-sync-ci-887a171d.cjs.dev.js} +3 -3
- package/dist/{config-sync-ci-907e66f2.cjs.prod.js → config-sync-ci-f154ff74.cjs.prod.js} +3 -3
- package/dist/{config-sync-helpers-ea3cecc4.esm.js → config-sync-helpers-131446d1.esm.js} +1 -1
- package/dist/{config-sync-helpers-3a93452b.cjs.prod.js → config-sync-helpers-2a1ad393.cjs.prod.js} +1 -1
- package/dist/{config-sync-helpers-8faf3ef7.cjs.dev.js → config-sync-helpers-99d009c2.cjs.dev.js} +1 -1
- package/dist/{create-postcss-config-67b60980.cjs.dev.js → create-postcss-config-2552844c.cjs.dev.js} +1 -1
- package/dist/{create-postcss-config-157f9e41.cjs.prod.js → create-postcss-config-94621a5d.cjs.prod.js} +1 -1
- package/dist/{create-postcss-config-9ca4adcb.esm.js → create-postcss-config-fd5f1790.esm.js} +1 -1
- package/dist/{create-webpack-config-for-development-b0c2cada.cjs.prod.js → create-webpack-config-for-development-1a51db3d.cjs.prod.js} +5 -2
- package/dist/{create-webpack-config-for-development-f8831aa5.esm.js → create-webpack-config-for-development-1d8ac187.esm.js} +5 -2
- package/dist/{create-webpack-config-for-development-671269f7.cjs.dev.js → create-webpack-config-for-development-7be672b8.cjs.dev.js} +5 -2
- package/dist/{create-webpack-config-for-production-541c8ebd.esm.js → create-webpack-config-for-production-25dbb5e6.esm.js} +5 -2
- package/dist/{create-webpack-config-for-production-21622788.cjs.dev.js → create-webpack-config-for-production-659d28ad.cjs.dev.js} +5 -2
- package/dist/{create-webpack-config-for-production-e95413d1.cjs.prod.js → create-webpack-config-for-production-d8a4b779.cjs.prod.js} +5 -2
- package/dist/{deployment-previews-set-1ef321ba.esm.js → deployment-previews-set-3dae0f4a.esm.js} +2 -2
- package/dist/{deployment-previews-set-3c10cd68.cjs.dev.js → deployment-previews-set-92355471.cjs.dev.js} +2 -2
- package/dist/{deployment-previews-set-a3b53bef.cjs.prod.js → deployment-previews-set-d8d80d4c.cjs.prod.js} +2 -2
- package/dist/{graphql-requests-c584b284.cjs.prod.js → graphql-requests-4d1d361b.cjs.prod.js} +1 -1
- package/dist/{graphql-requests-03695a70.esm.js → graphql-requests-ab8202cb.esm.js} +1 -1
- package/dist/{graphql-requests-95ad4f52.cjs.dev.js → graphql-requests-f3dc11f7.cjs.dev.js} +1 -1
- package/dist/{login-001d01db.esm.js → login-093e2fe2.esm.js} +1 -1
- package/dist/{login-0be4aeff.cjs.prod.js → login-389005dc.cjs.prod.js} +1 -1
- package/dist/{login-b198ccfc.cjs.dev.js → login-3d0c7aec.cjs.dev.js} +1 -1
- package/dist/{package-1d8a1cc3.cjs.prod.js → package-29009841.cjs.dev.js} +3 -1
- package/dist/{package-4375c787.cjs.dev.js → package-8c1a8425.cjs.prod.js} +3 -1
- package/dist/{package-31f44b37.esm.js → package-92325d69.esm.js} +3 -1
- package/dist/{start-4529b654.esm.js → start-5fcaad9b.esm.js} +4 -3
- package/dist/{start-784b0a29.cjs.prod.js → start-925a7852.cjs.prod.js} +4 -3
- package/dist/{start-02bc4f0e.cjs.dev.js → start-ec6bcea2.cjs.dev.js} +4 -3
- package/dist/{start-vite-7d1161e8.esm.js → start-vite-4b0df191.esm.js} +6 -1
- package/dist/{start-vite-068e9f73.cjs.dev.js → start-vite-698c9e82.cjs.dev.js} +6 -1
- package/dist/{start-vite-29078b3a.cjs.prod.js → start-vite-dd8a1e26.cjs.prod.js} +6 -1
- package/dist/try-load-nimbus-plugins-2f528d8f.esm.js +105 -0
- package/dist/try-load-nimbus-plugins-a713d7d3.cjs.prod.js +108 -0
- package/dist/try-load-nimbus-plugins-d502a5fe.cjs.dev.js +108 -0
- package/nimbus-stub.js +12 -0
- package/package.json +10 -8
- 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 +5 -4
- package/webpack/dist/commercetools-frontend-mc-scripts-webpack.cjs.prod.js +5 -4
- package/webpack/dist/commercetools-frontend-mc-scripts-webpack.esm.js +5 -4
|
@@ -18,12 +18,13 @@ import HtmlWebpackPlugin from 'html-webpack-plugin';
|
|
|
18
18
|
import MomentLocalesPlugin from 'moment-locales-webpack-plugin';
|
|
19
19
|
import webpack from 'webpack';
|
|
20
20
|
import WebpackBar from 'webpackbar';
|
|
21
|
+
import { l as loadNimbusWebpackPlugin } from './try-load-nimbus-plugins-2f528d8f.esm.js';
|
|
21
22
|
import _classCallCheck from '@babel/runtime-corejs3/helpers/esm/classCallCheck';
|
|
22
23
|
import _createClass from '@babel/runtime-corejs3/helpers/esm/createClass';
|
|
23
24
|
import _Object$assign from '@babel/runtime-corejs3/core-js-stable/object/assign';
|
|
24
25
|
import { processConfig } from '@commercetools-frontend/application-config';
|
|
25
26
|
import { replaceHtmlPlaceholders } from '@commercetools-frontend/mc-html-template';
|
|
26
|
-
import { c as createPostcssConfig } from './create-postcss-config-
|
|
27
|
+
import { c as createPostcssConfig } from './create-postcss-config-fd5f1790.esm.js';
|
|
27
28
|
import { g as getWepbackCacheGroups, h as hasJsxRuntime } from './optimizations-54382f7b.esm.js';
|
|
28
29
|
import { p as paths } from './paths-39f22b8b.esm.js';
|
|
29
30
|
import { v as vendorsToTranspile } from './vendors-to-transpile-7dc84a72.esm.js';
|
|
@@ -176,7 +177,9 @@ function createWebpackConfigForDevelopment() {
|
|
|
176
177
|
// Point sourcemap entries to the original disk location (format as URL on Windows)
|
|
177
178
|
devtoolModuleFilenameTemplate: info => path.resolve(info.absoluteResourcePath).replace(/\\/g, '/')
|
|
178
179
|
},
|
|
179
|
-
plugins: _filterInstanceProperty(_context3 = [
|
|
180
|
+
plugins: _filterInstanceProperty(_context3 = [loadNimbusWebpackPlugin({
|
|
181
|
+
cwd: paths.appRoot
|
|
182
|
+
}), new WebpackBar(),
|
|
180
183
|
// Allows to "assign" custom options to the `webpack` object.
|
|
181
184
|
// At the moment, this is used to share some props with `postcss.config`.
|
|
182
185
|
new webpack.LoaderOptionsPlugin({
|
|
@@ -20,12 +20,13 @@ var HtmlWebpackPlugin = require('html-webpack-plugin');
|
|
|
20
20
|
var MomentLocalesPlugin = require('moment-locales-webpack-plugin');
|
|
21
21
|
var webpack = require('webpack');
|
|
22
22
|
var WebpackBar = require('webpackbar');
|
|
23
|
+
var tryLoadNimbusPlugins = require('./try-load-nimbus-plugins-d502a5fe.cjs.dev.js');
|
|
23
24
|
var _classCallCheck = require('@babel/runtime-corejs3/helpers/classCallCheck');
|
|
24
25
|
var _createClass = require('@babel/runtime-corejs3/helpers/createClass');
|
|
25
26
|
var _Object$assign = require('@babel/runtime-corejs3/core-js-stable/object/assign');
|
|
26
27
|
var applicationConfig = require('@commercetools-frontend/application-config');
|
|
27
28
|
var mcHtmlTemplate = require('@commercetools-frontend/mc-html-template');
|
|
28
|
-
var createPostcssConfig = require('./create-postcss-config-
|
|
29
|
+
var createPostcssConfig = require('./create-postcss-config-2552844c.cjs.dev.js');
|
|
29
30
|
var optimizations = require('./optimizations-56be74d6.cjs.dev.js');
|
|
30
31
|
var paths = require('./paths-b76fc753.cjs.dev.js');
|
|
31
32
|
var vendorsToTranspile = require('./vendors-to-transpile-6ab4ea06.cjs.dev.js');
|
|
@@ -201,7 +202,9 @@ function createWebpackConfigForDevelopment() {
|
|
|
201
202
|
// Point sourcemap entries to the original disk location (format as URL on Windows)
|
|
202
203
|
devtoolModuleFilenameTemplate: info => path__default["default"].resolve(info.absoluteResourcePath).replace(/\\/g, '/')
|
|
203
204
|
},
|
|
204
|
-
plugins: _filterInstanceProperty__default["default"](_context3 = [
|
|
205
|
+
plugins: _filterInstanceProperty__default["default"](_context3 = [tryLoadNimbusPlugins.loadNimbusWebpackPlugin({
|
|
206
|
+
cwd: paths.paths.appRoot
|
|
207
|
+
}), new WebpackBar__default["default"](),
|
|
205
208
|
// Allows to "assign" custom options to the `webpack` object.
|
|
206
209
|
// At the moment, this is used to share some props with `postcss.config`.
|
|
207
210
|
new webpack__default["default"].LoaderOptionsPlugin({
|
|
@@ -20,6 +20,7 @@ import MomentLocalesPlugin from 'moment-locales-webpack-plugin';
|
|
|
20
20
|
import TerserPlugin from 'terser-webpack-plugin';
|
|
21
21
|
import webpack from 'webpack';
|
|
22
22
|
import { BundleAnalyzerPlugin } from 'webpack-bundle-analyzer';
|
|
23
|
+
import { l as loadNimbusWebpackPlugin } from './try-load-nimbus-plugins-2f528d8f.esm.js';
|
|
23
24
|
import _classCallCheck from '@babel/runtime-corejs3/helpers/esm/classCallCheck';
|
|
24
25
|
import _createClass from '@babel/runtime-corejs3/helpers/esm/createClass';
|
|
25
26
|
import _bindInstanceProperty from '@babel/runtime-corejs3/core-js-stable/instance/bind';
|
|
@@ -27,7 +28,7 @@ import _reduceInstanceProperty from '@babel/runtime-corejs3/core-js-stable/insta
|
|
|
27
28
|
import _Object$assign from '@babel/runtime-corejs3/core-js-stable/object/assign';
|
|
28
29
|
import fs from 'fs';
|
|
29
30
|
import path from 'path';
|
|
30
|
-
import { c as createPostcssConfig } from './create-postcss-config-
|
|
31
|
+
import { c as createPostcssConfig } from './create-postcss-config-fd5f1790.esm.js';
|
|
31
32
|
import { g as getWepbackCacheGroups, h as hasJsxRuntime } from './optimizations-54382f7b.esm.js';
|
|
32
33
|
import { p as paths } from './paths-39f22b8b.esm.js';
|
|
33
34
|
import { v as vendorsToTranspile } from './vendors-to-transpile-7dc84a72.esm.js';
|
|
@@ -223,7 +224,9 @@ function createWebpackConfigForProduction() {
|
|
|
223
224
|
// Will be injected on runtime. See `packages/application-shell/src/public-path.js`
|
|
224
225
|
publicPath: ''
|
|
225
226
|
},
|
|
226
|
-
plugins: [
|
|
227
|
+
plugins: [loadNimbusWebpackPlugin({
|
|
228
|
+
cwd: paths.appRoot
|
|
229
|
+
}),
|
|
227
230
|
// Allows to "assign" custom options to the `webpack` object.
|
|
228
231
|
// At the moment, this is used to share some props with `postcss.config`.
|
|
229
232
|
new webpack.LoaderOptionsPlugin({
|
|
@@ -22,6 +22,7 @@ var MomentLocalesPlugin = require('moment-locales-webpack-plugin');
|
|
|
22
22
|
var TerserPlugin = require('terser-webpack-plugin');
|
|
23
23
|
var webpack = require('webpack');
|
|
24
24
|
var webpackBundleAnalyzer = require('webpack-bundle-analyzer');
|
|
25
|
+
var tryLoadNimbusPlugins = require('./try-load-nimbus-plugins-d502a5fe.cjs.dev.js');
|
|
25
26
|
var _classCallCheck = require('@babel/runtime-corejs3/helpers/classCallCheck');
|
|
26
27
|
var _createClass = require('@babel/runtime-corejs3/helpers/createClass');
|
|
27
28
|
var _bindInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/bind');
|
|
@@ -29,7 +30,7 @@ var _reduceInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/ins
|
|
|
29
30
|
var _Object$assign = require('@babel/runtime-corejs3/core-js-stable/object/assign');
|
|
30
31
|
var fs = require('fs');
|
|
31
32
|
var path = require('path');
|
|
32
|
-
var createPostcssConfig = require('./create-postcss-config-
|
|
33
|
+
var createPostcssConfig = require('./create-postcss-config-2552844c.cjs.dev.js');
|
|
33
34
|
var optimizations = require('./optimizations-56be74d6.cjs.dev.js');
|
|
34
35
|
var paths = require('./paths-b76fc753.cjs.dev.js');
|
|
35
36
|
var vendorsToTranspile = require('./vendors-to-transpile-6ab4ea06.cjs.dev.js');
|
|
@@ -253,7 +254,9 @@ function createWebpackConfigForProduction() {
|
|
|
253
254
|
// Will be injected on runtime. See `packages/application-shell/src/public-path.js`
|
|
254
255
|
publicPath: ''
|
|
255
256
|
},
|
|
256
|
-
plugins: [
|
|
257
|
+
plugins: [tryLoadNimbusPlugins.loadNimbusWebpackPlugin({
|
|
258
|
+
cwd: paths.paths.appRoot
|
|
259
|
+
}),
|
|
257
260
|
// Allows to "assign" custom options to the `webpack` object.
|
|
258
261
|
// At the moment, this is used to share some props with `postcss.config`.
|
|
259
262
|
new webpack__default["default"].LoaderOptionsPlugin({
|
|
@@ -22,6 +22,7 @@ var MomentLocalesPlugin = require('moment-locales-webpack-plugin');
|
|
|
22
22
|
var TerserPlugin = require('terser-webpack-plugin');
|
|
23
23
|
var webpack = require('webpack');
|
|
24
24
|
var webpackBundleAnalyzer = require('webpack-bundle-analyzer');
|
|
25
|
+
var tryLoadNimbusPlugins = require('./try-load-nimbus-plugins-a713d7d3.cjs.prod.js');
|
|
25
26
|
var _classCallCheck = require('@babel/runtime-corejs3/helpers/classCallCheck');
|
|
26
27
|
var _createClass = require('@babel/runtime-corejs3/helpers/createClass');
|
|
27
28
|
var _bindInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/bind');
|
|
@@ -29,7 +30,7 @@ var _reduceInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/ins
|
|
|
29
30
|
var _Object$assign = require('@babel/runtime-corejs3/core-js-stable/object/assign');
|
|
30
31
|
var fs = require('fs');
|
|
31
32
|
var path = require('path');
|
|
32
|
-
var createPostcssConfig = require('./create-postcss-config-
|
|
33
|
+
var createPostcssConfig = require('./create-postcss-config-94621a5d.cjs.prod.js');
|
|
33
34
|
var optimizations = require('./optimizations-da5a0cfa.cjs.prod.js');
|
|
34
35
|
var paths = require('./paths-7768b440.cjs.prod.js');
|
|
35
36
|
var vendorsToTranspile = require('./vendors-to-transpile-04a49d40.cjs.prod.js');
|
|
@@ -253,7 +254,9 @@ function createWebpackConfigForProduction() {
|
|
|
253
254
|
// Will be injected on runtime. See `packages/application-shell/src/public-path.js`
|
|
254
255
|
publicPath: ''
|
|
255
256
|
},
|
|
256
|
-
plugins: [
|
|
257
|
+
plugins: [tryLoadNimbusPlugins.loadNimbusWebpackPlugin({
|
|
258
|
+
cwd: paths.paths.appRoot
|
|
259
|
+
}),
|
|
257
260
|
// Allows to "assign" custom options to the `webpack` object.
|
|
258
261
|
// At the moment, this is used to share some props with `postcss.config`.
|
|
259
262
|
new webpack__default["default"].LoaderOptionsPlugin({
|
package/dist/{deployment-previews-set-1ef321ba.esm.js → deployment-previews-set-3dae0f4a.esm.js}
RENAMED
|
@@ -6,7 +6,7 @@ import chalk from 'chalk';
|
|
|
6
6
|
import prompts from 'prompts';
|
|
7
7
|
import { processConfig } from '@commercetools-frontend/application-config';
|
|
8
8
|
import { C as CredentialsStorage } from './credentials-storage-67deadc3.esm.js';
|
|
9
|
-
import { d as fetchCustomApplication, g as updateCustomApplicationDeploymentPreview, h as createCustomApplicationDeploymentPreview } from './graphql-requests-
|
|
9
|
+
import { d as fetchCustomApplication, g as updateCustomApplicationDeploymentPreview, h as createCustomApplicationDeploymentPreview } from './graphql-requests-ab8202cb.esm.js';
|
|
10
10
|
import '@babel/runtime-corejs3/helpers/classCallCheck';
|
|
11
11
|
import '@babel/runtime-corejs3/helpers/createClass';
|
|
12
12
|
import '@babel/runtime-corejs3/core-js-stable/json/stringify';
|
|
@@ -28,7 +28,7 @@ import 'graphql';
|
|
|
28
28
|
import 'graphql-request';
|
|
29
29
|
import '@commercetools-frontend/constants';
|
|
30
30
|
import '@commercetools/http-user-agent';
|
|
31
|
-
import './package-
|
|
31
|
+
import './package-92325d69.esm.js';
|
|
32
32
|
|
|
33
33
|
const credentialsStorage = new CredentialsStorage();
|
|
34
34
|
const validateUrl = function () {
|
|
@@ -8,7 +8,7 @@ var chalk = require('chalk');
|
|
|
8
8
|
var prompts = require('prompts');
|
|
9
9
|
var applicationConfig = require('@commercetools-frontend/application-config');
|
|
10
10
|
var credentialsStorage$1 = require('./credentials-storage-fd195144.cjs.dev.js');
|
|
11
|
-
var graphqlRequests = require('./graphql-requests-
|
|
11
|
+
var graphqlRequests = require('./graphql-requests-f3dc11f7.cjs.dev.js');
|
|
12
12
|
require('@babel/runtime-corejs3/helpers/classCallCheck');
|
|
13
13
|
require('@babel/runtime-corejs3/helpers/createClass');
|
|
14
14
|
require('@babel/runtime-corejs3/core-js-stable/json/stringify');
|
|
@@ -30,7 +30,7 @@ require('graphql');
|
|
|
30
30
|
require('graphql-request');
|
|
31
31
|
require('@commercetools-frontend/constants');
|
|
32
32
|
require('@commercetools/http-user-agent');
|
|
33
|
-
require('./package-
|
|
33
|
+
require('./package-29009841.cjs.dev.js');
|
|
34
34
|
|
|
35
35
|
function _interopDefault (e) { return e && e.__esModule ? e : { 'default': e }; }
|
|
36
36
|
|
|
@@ -8,7 +8,7 @@ var chalk = require('chalk');
|
|
|
8
8
|
var prompts = require('prompts');
|
|
9
9
|
var applicationConfig = require('@commercetools-frontend/application-config');
|
|
10
10
|
var credentialsStorage$1 = require('./credentials-storage-ea1c16dc.cjs.prod.js');
|
|
11
|
-
var graphqlRequests = require('./graphql-requests-
|
|
11
|
+
var graphqlRequests = require('./graphql-requests-4d1d361b.cjs.prod.js');
|
|
12
12
|
require('@babel/runtime-corejs3/helpers/classCallCheck');
|
|
13
13
|
require('@babel/runtime-corejs3/helpers/createClass');
|
|
14
14
|
require('@babel/runtime-corejs3/core-js-stable/json/stringify');
|
|
@@ -30,7 +30,7 @@ require('graphql');
|
|
|
30
30
|
require('graphql-request');
|
|
31
31
|
require('@commercetools-frontend/constants');
|
|
32
32
|
require('@commercetools/http-user-agent');
|
|
33
|
-
require('./package-
|
|
33
|
+
require('./package-8c1a8425.cjs.prod.js');
|
|
34
34
|
|
|
35
35
|
function _interopDefault (e) { return e && e.__esModule ? e : { 'default': e }; }
|
|
36
36
|
|
package/dist/{graphql-requests-c584b284.cjs.prod.js → graphql-requests-4d1d361b.cjs.prod.js}
RENAMED
|
@@ -16,7 +16,7 @@ var graphqlRequest = require('graphql-request');
|
|
|
16
16
|
var constants = require('@commercetools-frontend/constants');
|
|
17
17
|
var credentialsStorage$1 = require('./credentials-storage-ea1c16dc.cjs.prod.js');
|
|
18
18
|
var createHttpUserAgent = require('@commercetools/http-user-agent');
|
|
19
|
-
var _package = require('./package-
|
|
19
|
+
var _package = require('./package-8c1a8425.cjs.prod.js');
|
|
20
20
|
|
|
21
21
|
function _interopDefault (e) { return e && e.__esModule ? e : { 'default': e }; }
|
|
22
22
|
|
|
@@ -14,7 +14,7 @@ import { GraphQLClient, ClientError } from 'graphql-request';
|
|
|
14
14
|
import { GRAPHQL_TARGETS, SUPPORTED_HEADERS } from '@commercetools-frontend/constants';
|
|
15
15
|
import { C as CredentialsStorage } from './credentials-storage-67deadc3.esm.js';
|
|
16
16
|
import createHttpUserAgent from '@commercetools/http-user-agent';
|
|
17
|
-
import { p as pkgJson } from './package-
|
|
17
|
+
import { p as pkgJson } from './package-92325d69.esm.js';
|
|
18
18
|
|
|
19
19
|
const userAgent = createHttpUserAgent({
|
|
20
20
|
name: 'graphql-request',
|
|
@@ -16,7 +16,7 @@ var graphqlRequest = require('graphql-request');
|
|
|
16
16
|
var constants = require('@commercetools-frontend/constants');
|
|
17
17
|
var credentialsStorage$1 = require('./credentials-storage-fd195144.cjs.dev.js');
|
|
18
18
|
var createHttpUserAgent = require('@commercetools/http-user-agent');
|
|
19
|
-
var _package = require('./package-
|
|
19
|
+
var _package = require('./package-29009841.cjs.dev.js');
|
|
20
20
|
|
|
21
21
|
function _interopDefault (e) { return e && e.__esModule ? e : { 'default': e }; }
|
|
22
22
|
|
|
@@ -13,7 +13,7 @@ import crypto from 'node:crypto';
|
|
|
13
13
|
import process, { exit } from 'node:process';
|
|
14
14
|
import chalk from 'chalk';
|
|
15
15
|
import { processConfig } from '@commercetools-frontend/application-config';
|
|
16
|
-
import { p as pkgJson } from './package-
|
|
16
|
+
import { p as pkgJson } from './package-92325d69.esm.js';
|
|
17
17
|
import http from 'node:http';
|
|
18
18
|
import jwtDecode from 'jwt-decode';
|
|
19
19
|
import { C as CredentialsStorage } from './credentials-storage-67deadc3.esm.js';
|
|
@@ -15,7 +15,7 @@ var crypto = require('node:crypto');
|
|
|
15
15
|
var process = require('node:process');
|
|
16
16
|
var chalk = require('chalk');
|
|
17
17
|
var applicationConfig = require('@commercetools-frontend/application-config');
|
|
18
|
-
var _package = require('./package-
|
|
18
|
+
var _package = require('./package-8c1a8425.cjs.prod.js');
|
|
19
19
|
var http = require('node:http');
|
|
20
20
|
var jwtDecode = require('jwt-decode');
|
|
21
21
|
var credentialsStorage$1 = require('./credentials-storage-ea1c16dc.cjs.prod.js');
|
|
@@ -15,7 +15,7 @@ var crypto = require('node:crypto');
|
|
|
15
15
|
var process = require('node:process');
|
|
16
16
|
var chalk = require('chalk');
|
|
17
17
|
var applicationConfig = require('@commercetools-frontend/application-config');
|
|
18
|
-
var _package = require('./package-
|
|
18
|
+
var _package = require('./package-29009841.cjs.dev.js');
|
|
19
19
|
var http = require('node:http');
|
|
20
20
|
var jwtDecode = require('jwt-decode');
|
|
21
21
|
var credentialsStorage$1 = require('./credentials-storage-fd195144.cjs.dev.js');
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
var pkgJson = {
|
|
4
4
|
name: "@commercetools-frontend/mc-scripts",
|
|
5
|
-
version: "27.
|
|
5
|
+
version: "27.8.0",
|
|
6
6
|
description: "Configuration and scripts for developing a MC application",
|
|
7
7
|
bugs: "https://github.com/commercetools/merchant-center-application-kit/issues",
|
|
8
8
|
repository: {
|
|
@@ -42,6 +42,7 @@ var pkgJson = {
|
|
|
42
42
|
"postcss",
|
|
43
43
|
"webpack",
|
|
44
44
|
"webpack-loaders",
|
|
45
|
+
"nimbus-stub.js",
|
|
45
46
|
"package.json",
|
|
46
47
|
"LICENSE",
|
|
47
48
|
"README.md"
|
|
@@ -139,6 +140,7 @@ var pkgJson = {
|
|
|
139
140
|
},
|
|
140
141
|
devDependencies: {
|
|
141
142
|
"@commercetools/composable-commerce-test-data": "catalog:",
|
|
143
|
+
"@commercetools/nimbus": "catalog:nimbus",
|
|
142
144
|
"@tsconfig/node22": "catalog:",
|
|
143
145
|
"@types/fs-extra": "catalog:",
|
|
144
146
|
"@types/lodash": "catalog:",
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
var pkgJson = {
|
|
4
4
|
name: "@commercetools-frontend/mc-scripts",
|
|
5
|
-
version: "27.
|
|
5
|
+
version: "27.8.0",
|
|
6
6
|
description: "Configuration and scripts for developing a MC application",
|
|
7
7
|
bugs: "https://github.com/commercetools/merchant-center-application-kit/issues",
|
|
8
8
|
repository: {
|
|
@@ -42,6 +42,7 @@ var pkgJson = {
|
|
|
42
42
|
"postcss",
|
|
43
43
|
"webpack",
|
|
44
44
|
"webpack-loaders",
|
|
45
|
+
"nimbus-stub.js",
|
|
45
46
|
"package.json",
|
|
46
47
|
"LICENSE",
|
|
47
48
|
"README.md"
|
|
@@ -139,6 +140,7 @@ var pkgJson = {
|
|
|
139
140
|
},
|
|
140
141
|
devDependencies: {
|
|
141
142
|
"@commercetools/composable-commerce-test-data": "catalog:",
|
|
143
|
+
"@commercetools/nimbus": "catalog:nimbus",
|
|
142
144
|
"@tsconfig/node22": "catalog:",
|
|
143
145
|
"@types/fs-extra": "catalog:",
|
|
144
146
|
"@types/lodash": "catalog:",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
var pkgJson = {
|
|
2
2
|
name: "@commercetools-frontend/mc-scripts",
|
|
3
|
-
version: "27.
|
|
3
|
+
version: "27.8.0",
|
|
4
4
|
description: "Configuration and scripts for developing a MC application",
|
|
5
5
|
bugs: "https://github.com/commercetools/merchant-center-application-kit/issues",
|
|
6
6
|
repository: {
|
|
@@ -40,6 +40,7 @@ var pkgJson = {
|
|
|
40
40
|
"postcss",
|
|
41
41
|
"webpack",
|
|
42
42
|
"webpack-loaders",
|
|
43
|
+
"nimbus-stub.js",
|
|
43
44
|
"package.json",
|
|
44
45
|
"LICENSE",
|
|
45
46
|
"README.md"
|
|
@@ -137,6 +138,7 @@ var pkgJson = {
|
|
|
137
138
|
},
|
|
138
139
|
devDependencies: {
|
|
139
140
|
"@commercetools/composable-commerce-test-data": "catalog:",
|
|
141
|
+
"@commercetools/nimbus": "catalog:nimbus",
|
|
140
142
|
"@tsconfig/node22": "catalog:",
|
|
141
143
|
"@types/fs-extra": "catalog:",
|
|
142
144
|
"@types/lodash": "catalog:",
|
|
@@ -7,7 +7,7 @@ import openBrowser from 'react-dev-utils/openBrowser';
|
|
|
7
7
|
import { choosePort, prepareUrls, createCompiler } from 'react-dev-utils/WebpackDevServerUtils';
|
|
8
8
|
import webpack from 'webpack';
|
|
9
9
|
import WebpackDevServer from 'webpack-dev-server';
|
|
10
|
-
import { c as createWebpackConfigForDevelopment } from './create-webpack-config-for-development-
|
|
10
|
+
import { c as createWebpackConfigForDevelopment } from './create-webpack-config-for-development-1d8ac187.esm.js';
|
|
11
11
|
import { p as paths } from './paths-39f22b8b.esm.js';
|
|
12
12
|
import { processConfig } from '@commercetools-frontend/application-config';
|
|
13
13
|
import { createMcDevAuthenticationMiddleware } from '@commercetools-frontend/mc-dev-authentication';
|
|
@@ -31,12 +31,13 @@ import '@pmmmwh/react-refresh-webpack-plugin';
|
|
|
31
31
|
import 'html-webpack-plugin';
|
|
32
32
|
import 'moment-locales-webpack-plugin';
|
|
33
33
|
import 'webpackbar';
|
|
34
|
+
import './try-load-nimbus-plugins-2f528d8f.esm.js';
|
|
34
35
|
import '@babel/runtime-corejs3/helpers/classCallCheck';
|
|
35
36
|
import '@babel/runtime-corejs3/helpers/createClass';
|
|
36
37
|
import '@babel/runtime-corejs3/core-js-stable/object/assign';
|
|
37
|
-
import './create-postcss-config-
|
|
38
|
+
import './create-postcss-config-fd5f1790.esm.js';
|
|
38
39
|
import '@babel/runtime-corejs3/helpers/slicedToArray';
|
|
39
|
-
import './package-
|
|
40
|
+
import './package-92325d69.esm.js';
|
|
40
41
|
import './optimizations-54382f7b.esm.js';
|
|
41
42
|
import '@babel/runtime-corejs3/core-js-stable/instance/reduce';
|
|
42
43
|
import '@babel/runtime-corejs3/core-js-stable/object/entries';
|
|
@@ -9,7 +9,7 @@ var openBrowser = require('react-dev-utils/openBrowser');
|
|
|
9
9
|
var WebpackDevServerUtils = require('react-dev-utils/WebpackDevServerUtils');
|
|
10
10
|
var webpack = require('webpack');
|
|
11
11
|
var WebpackDevServer = require('webpack-dev-server');
|
|
12
|
-
var createWebpackConfigForDevelopment = require('./create-webpack-config-for-development-
|
|
12
|
+
var createWebpackConfigForDevelopment = require('./create-webpack-config-for-development-1a51db3d.cjs.prod.js');
|
|
13
13
|
var paths = require('./paths-7768b440.cjs.prod.js');
|
|
14
14
|
var applicationConfig = require('@commercetools-frontend/application-config');
|
|
15
15
|
var mcDevAuthentication = require('@commercetools-frontend/mc-dev-authentication');
|
|
@@ -33,12 +33,13 @@ require('@pmmmwh/react-refresh-webpack-plugin');
|
|
|
33
33
|
require('html-webpack-plugin');
|
|
34
34
|
require('moment-locales-webpack-plugin');
|
|
35
35
|
require('webpackbar');
|
|
36
|
+
require('./try-load-nimbus-plugins-a713d7d3.cjs.prod.js');
|
|
36
37
|
require('@babel/runtime-corejs3/helpers/classCallCheck');
|
|
37
38
|
require('@babel/runtime-corejs3/helpers/createClass');
|
|
38
39
|
require('@babel/runtime-corejs3/core-js-stable/object/assign');
|
|
39
|
-
require('./create-postcss-config-
|
|
40
|
+
require('./create-postcss-config-94621a5d.cjs.prod.js');
|
|
40
41
|
require('@babel/runtime-corejs3/helpers/slicedToArray');
|
|
41
|
-
require('./package-
|
|
42
|
+
require('./package-8c1a8425.cjs.prod.js');
|
|
42
43
|
require('./optimizations-da5a0cfa.cjs.prod.js');
|
|
43
44
|
require('@babel/runtime-corejs3/core-js-stable/instance/reduce');
|
|
44
45
|
require('@babel/runtime-corejs3/core-js-stable/object/entries');
|
|
@@ -9,7 +9,7 @@ var openBrowser = require('react-dev-utils/openBrowser');
|
|
|
9
9
|
var WebpackDevServerUtils = require('react-dev-utils/WebpackDevServerUtils');
|
|
10
10
|
var webpack = require('webpack');
|
|
11
11
|
var WebpackDevServer = require('webpack-dev-server');
|
|
12
|
-
var createWebpackConfigForDevelopment = require('./create-webpack-config-for-development-
|
|
12
|
+
var createWebpackConfigForDevelopment = require('./create-webpack-config-for-development-7be672b8.cjs.dev.js');
|
|
13
13
|
var paths = require('./paths-b76fc753.cjs.dev.js');
|
|
14
14
|
var applicationConfig = require('@commercetools-frontend/application-config');
|
|
15
15
|
var mcDevAuthentication = require('@commercetools-frontend/mc-dev-authentication');
|
|
@@ -33,12 +33,13 @@ require('@pmmmwh/react-refresh-webpack-plugin');
|
|
|
33
33
|
require('html-webpack-plugin');
|
|
34
34
|
require('moment-locales-webpack-plugin');
|
|
35
35
|
require('webpackbar');
|
|
36
|
+
require('./try-load-nimbus-plugins-d502a5fe.cjs.dev.js');
|
|
36
37
|
require('@babel/runtime-corejs3/helpers/classCallCheck');
|
|
37
38
|
require('@babel/runtime-corejs3/helpers/createClass');
|
|
38
39
|
require('@babel/runtime-corejs3/core-js-stable/object/assign');
|
|
39
|
-
require('./create-postcss-config-
|
|
40
|
+
require('./create-postcss-config-2552844c.cjs.dev.js');
|
|
40
41
|
require('@babel/runtime-corejs3/helpers/slicedToArray');
|
|
41
|
-
require('./package-
|
|
42
|
+
require('./package-29009841.cjs.dev.js');
|
|
42
43
|
require('./optimizations-56be74d6.cjs.dev.js');
|
|
43
44
|
require('@babel/runtime-corejs3/core-js-stable/instance/reduce');
|
|
44
45
|
require('@babel/runtime-corejs3/core-js-stable/object/entries');
|
|
@@ -9,6 +9,7 @@ import { processConfig } from '@commercetools-frontend/application-config';
|
|
|
9
9
|
import { packageLocation } from '@commercetools-frontend/assets';
|
|
10
10
|
import { processHeaders, replaceHtmlPlaceholders, generateTemplate } from '@commercetools-frontend/mc-html-template';
|
|
11
11
|
import { p as paths } from './paths-39f22b8b.esm.js';
|
|
12
|
+
import { a as loadNimbusVitePlugin } from './try-load-nimbus-plugins-2f528d8f.esm.js';
|
|
12
13
|
import _Object$assign from '@babel/runtime-corejs3/core-js-stable/object/assign';
|
|
13
14
|
import { createMcDevAuthenticationMiddleware } from '@commercetools-frontend/mc-dev-authentication';
|
|
14
15
|
import { v as vitePluginSvgr } from './vite-plugin-svgr-de6ee7da.esm.js';
|
|
@@ -16,6 +17,8 @@ import '@babel/runtime-corejs3/core-js-stable/instance/find';
|
|
|
16
17
|
import 'fs';
|
|
17
18
|
import './does-file-exist-32618334.esm.js';
|
|
18
19
|
import 'node:fs';
|
|
20
|
+
import '@babel/runtime-corejs3/helpers/classCallCheck';
|
|
21
|
+
import '@babel/runtime-corejs3/helpers/createClass';
|
|
19
22
|
import 'crypto';
|
|
20
23
|
import '@rollup/pluginutils';
|
|
21
24
|
import '@babel/runtime-corejs3/core-js/instance/match-all';
|
|
@@ -100,7 +103,9 @@ async function run() {
|
|
|
100
103
|
port: DEFAULT_PORT,
|
|
101
104
|
headers: compiledHeaders
|
|
102
105
|
},
|
|
103
|
-
plugins: [
|
|
106
|
+
plugins: [loadNimbusVitePlugin({
|
|
107
|
+
cwd: paths.appRoot
|
|
108
|
+
}), pluginGraphql(), pluginReact({
|
|
104
109
|
jsxImportSource: '@emotion/react'
|
|
105
110
|
}), vitePluginSvgr(), vitePluginCustomApplication(applicationConfig)]
|
|
106
111
|
});
|
|
@@ -11,6 +11,7 @@ var applicationConfig = require('@commercetools-frontend/application-config');
|
|
|
11
11
|
var assets = require('@commercetools-frontend/assets');
|
|
12
12
|
var mcHtmlTemplate = require('@commercetools-frontend/mc-html-template');
|
|
13
13
|
var paths = require('./paths-b76fc753.cjs.dev.js');
|
|
14
|
+
var tryLoadNimbusPlugins = require('./try-load-nimbus-plugins-d502a5fe.cjs.dev.js');
|
|
14
15
|
var _Object$assign = require('@babel/runtime-corejs3/core-js-stable/object/assign');
|
|
15
16
|
var mcDevAuthentication = require('@commercetools-frontend/mc-dev-authentication');
|
|
16
17
|
var vitePluginSvgr = require('./vite-plugin-svgr-7d06f400.cjs.dev.js');
|
|
@@ -18,6 +19,8 @@ require('@babel/runtime-corejs3/core-js-stable/instance/find');
|
|
|
18
19
|
require('fs');
|
|
19
20
|
require('./does-file-exist-eb86baca.cjs.dev.js');
|
|
20
21
|
require('node:fs');
|
|
22
|
+
require('@babel/runtime-corejs3/helpers/classCallCheck');
|
|
23
|
+
require('@babel/runtime-corejs3/helpers/createClass');
|
|
21
24
|
require('crypto');
|
|
22
25
|
require('@rollup/pluginutils');
|
|
23
26
|
require('@babel/runtime-corejs3/core-js/instance/match-all');
|
|
@@ -112,7 +115,9 @@ async function run() {
|
|
|
112
115
|
port: DEFAULT_PORT,
|
|
113
116
|
headers: compiledHeaders
|
|
114
117
|
},
|
|
115
|
-
plugins: [
|
|
118
|
+
plugins: [tryLoadNimbusPlugins.loadNimbusVitePlugin({
|
|
119
|
+
cwd: paths.paths.appRoot
|
|
120
|
+
}), pluginGraphql__default["default"](), pluginReact__default["default"]({
|
|
116
121
|
jsxImportSource: '@emotion/react'
|
|
117
122
|
}), vitePluginSvgr.vitePluginSvgr(), vitePluginCustomApplication(applicationConfig$1)]
|
|
118
123
|
});
|
|
@@ -11,6 +11,7 @@ var applicationConfig = require('@commercetools-frontend/application-config');
|
|
|
11
11
|
var assets = require('@commercetools-frontend/assets');
|
|
12
12
|
var mcHtmlTemplate = require('@commercetools-frontend/mc-html-template');
|
|
13
13
|
var paths = require('./paths-7768b440.cjs.prod.js');
|
|
14
|
+
var tryLoadNimbusPlugins = require('./try-load-nimbus-plugins-a713d7d3.cjs.prod.js');
|
|
14
15
|
var _Object$assign = require('@babel/runtime-corejs3/core-js-stable/object/assign');
|
|
15
16
|
var mcDevAuthentication = require('@commercetools-frontend/mc-dev-authentication');
|
|
16
17
|
var vitePluginSvgr = require('./vite-plugin-svgr-4034a834.cjs.prod.js');
|
|
@@ -18,6 +19,8 @@ require('@babel/runtime-corejs3/core-js-stable/instance/find');
|
|
|
18
19
|
require('fs');
|
|
19
20
|
require('./does-file-exist-be53305d.cjs.prod.js');
|
|
20
21
|
require('node:fs');
|
|
22
|
+
require('@babel/runtime-corejs3/helpers/classCallCheck');
|
|
23
|
+
require('@babel/runtime-corejs3/helpers/createClass');
|
|
21
24
|
require('crypto');
|
|
22
25
|
require('@rollup/pluginutils');
|
|
23
26
|
require('@babel/runtime-corejs3/core-js/instance/match-all');
|
|
@@ -112,7 +115,9 @@ async function run() {
|
|
|
112
115
|
port: DEFAULT_PORT,
|
|
113
116
|
headers: compiledHeaders
|
|
114
117
|
},
|
|
115
|
-
plugins: [
|
|
118
|
+
plugins: [tryLoadNimbusPlugins.loadNimbusVitePlugin({
|
|
119
|
+
cwd: paths.paths.appRoot
|
|
120
|
+
}), pluginGraphql__default["default"](), pluginReact__default["default"]({
|
|
116
121
|
jsxImportSource: '@emotion/react'
|
|
117
122
|
}), vitePluginSvgr.vitePluginSvgr(), vitePluginCustomApplication(applicationConfig$1)]
|
|
118
123
|
});
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
import _classCallCheck from '@babel/runtime-corejs3/helpers/esm/classCallCheck';
|
|
2
|
+
import _createClass from '@babel/runtime-corejs3/helpers/esm/createClass';
|
|
3
|
+
|
|
4
|
+
// Source of truth: `@commercetools/nimbus` `src/plugins/nimbus-runtime-re.ts`.
|
|
5
|
+
// Matches `@commercetools/nimbus` and any subpath EXCEPT `/plugins` and
|
|
6
|
+
// `/plugins/*`. Duplicated here (rather than imported) on purpose: these
|
|
7
|
+
// fallbacks only run when `@commercetools/nimbus` is NOT installed, so none of
|
|
8
|
+
// its modules — including the regex — can be `require`d at that point.
|
|
9
|
+
const NIMBUS_RUNTIME_RE = /^@commercetools\/nimbus(?:$|\/(?!plugins(?:\/|$)))/;
|
|
10
|
+
|
|
11
|
+
// Empty CJS stub shipped by mc-scripts (see `packages/mc-scripts/nimbus-stub.js`).
|
|
12
|
+
const NIMBUS_STUB_SUBPATH = '@commercetools-frontend/mc-scripts/nimbus-stub';
|
|
13
|
+
function isModuleNotFound(error) {
|
|
14
|
+
return error instanceof Error && 'code' in error && error.code === 'MODULE_NOT_FOUND';
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Resolve the stub to an absolute path from the application root. mc-scripts is
|
|
19
|
+
* a (dev)dependency of the app being built, so it is resolvable there under any
|
|
20
|
+
* package-manager layout. Resolving to an absolute path — rather than handing
|
|
21
|
+
* webpack the bare specifier — is what makes this work under pnpm's strict
|
|
22
|
+
* `node_modules`: a bare specifier would be re-resolved from application-shell's
|
|
23
|
+
* context, which cannot see mc-scripts (it is not application-shell's
|
|
24
|
+
* dependency).
|
|
25
|
+
*/
|
|
26
|
+
function resolveNimbusStub() {
|
|
27
|
+
let cwd = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : process.cwd();
|
|
28
|
+
return require.resolve(NIMBUS_STUB_SUBPATH, {
|
|
29
|
+
paths: [cwd]
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* webpack fallback used when `@commercetools/nimbus` — and therefore its own
|
|
35
|
+
* `@commercetools/nimbus/plugins/webpack` — is not installed. Redirects every
|
|
36
|
+
* Nimbus runtime import to the empty stub so the build resolves. Mirrors
|
|
37
|
+
* nimbus's `UNSAFE_NimbusOptionalDependencyPlugin`, but ships from mc-scripts so
|
|
38
|
+
* it works precisely in the case Nimbus is absent.
|
|
39
|
+
*/
|
|
40
|
+
let NimbusStubWebpackPlugin = /*#__PURE__*/function () {
|
|
41
|
+
function NimbusStubWebpackPlugin(cwd) {
|
|
42
|
+
_classCallCheck(this, NimbusStubWebpackPlugin);
|
|
43
|
+
this.stubPath = void 0;
|
|
44
|
+
this.stubPath = resolveNimbusStub(cwd);
|
|
45
|
+
}
|
|
46
|
+
return _createClass(NimbusStubWebpackPlugin, [{
|
|
47
|
+
key: "apply",
|
|
48
|
+
value: function apply(compiler) {
|
|
49
|
+
if (!compiler.webpack) {
|
|
50
|
+
throw new Error('NimbusStubWebpackPlugin requires webpack 5+. ' + 'compiler.webpack is undefined — are you using webpack 4 or older?');
|
|
51
|
+
}
|
|
52
|
+
const NormalModuleReplacementPlugin = compiler.webpack.NormalModuleReplacementPlugin;
|
|
53
|
+
new NormalModuleReplacementPlugin(NIMBUS_RUNTIME_RE, this.stubPath).apply(compiler);
|
|
54
|
+
}
|
|
55
|
+
}]);
|
|
56
|
+
}();
|
|
57
|
+
/**
|
|
58
|
+
* Vite fallback, mirroring nimbus's `UNSAFE_nimbusOptionalDependency` stub path:
|
|
59
|
+
* resolve every Nimbus runtime import to a virtual empty CJS module so the build
|
|
60
|
+
* resolves when `@commercetools/nimbus` is not installed.
|
|
61
|
+
*/
|
|
62
|
+
function createNimbusStubVitePlugin() {
|
|
63
|
+
// The `.cjs` extension makes named imports interop to `undefined` rather than
|
|
64
|
+
// failing with a missing-export error (same trick nimbus uses).
|
|
65
|
+
const STUB_ID = '\0mc-scripts-nimbus-stub.cjs';
|
|
66
|
+
return {
|
|
67
|
+
name: 'mc-scripts-nimbus-optional-dependency-fallback',
|
|
68
|
+
// Run before Vite's default resolver, which would otherwise follow
|
|
69
|
+
// workspace symlinks and resolve Nimbus even when the app has not installed it.
|
|
70
|
+
enforce: 'pre',
|
|
71
|
+
resolveId(source) {
|
|
72
|
+
if (NIMBUS_RUNTIME_RE.test(source)) return STUB_ID;
|
|
73
|
+
return undefined;
|
|
74
|
+
},
|
|
75
|
+
load(id) {
|
|
76
|
+
if (id === STUB_ID) return 'module.exports = {};';
|
|
77
|
+
return undefined;
|
|
78
|
+
}
|
|
79
|
+
};
|
|
80
|
+
}
|
|
81
|
+
function loadNimbusWebpackPlugin(options) {
|
|
82
|
+
try {
|
|
83
|
+
const _require = require('@commercetools/nimbus/plugins/webpack'),
|
|
84
|
+
UNSAFE_NimbusOptionalDependencyPlugin = _require.UNSAFE_NimbusOptionalDependencyPlugin;
|
|
85
|
+
return new UNSAFE_NimbusOptionalDependencyPlugin(options);
|
|
86
|
+
} catch (error) {
|
|
87
|
+
// Nimbus is not installed: its own plugin can't be loaded (it lives inside
|
|
88
|
+
// Nimbus), so mc-scripts stubs the imports itself. Any other error (e.g. a
|
|
89
|
+
// present-but-broken Nimbus) still surfaces.
|
|
90
|
+
if (isModuleNotFound(error)) return new NimbusStubWebpackPlugin(options?.cwd);
|
|
91
|
+
throw error;
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
function loadNimbusVitePlugin(options) {
|
|
95
|
+
try {
|
|
96
|
+
const _require2 = require('@commercetools/nimbus/plugins/vite'),
|
|
97
|
+
UNSAFE_nimbusOptionalDependency = _require2.UNSAFE_nimbusOptionalDependency;
|
|
98
|
+
return UNSAFE_nimbusOptionalDependency(options);
|
|
99
|
+
} catch (error) {
|
|
100
|
+
if (isModuleNotFound(error)) return createNimbusStubVitePlugin();
|
|
101
|
+
throw error;
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
export { loadNimbusVitePlugin as a, loadNimbusWebpackPlugin as l };
|