@gravity-ui/app-builder 0.11.1 → 0.11.3
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.
|
@@ -50,8 +50,15 @@ async function configureServiceWebpackConfig(mode, storybookConfig) {
|
|
|
50
50
|
options = serviceConfig.client;
|
|
51
51
|
}
|
|
52
52
|
const webpackConfig = await configureWebpackConfigForStorybook(mode, options, storybookConfig.module?.rules);
|
|
53
|
+
let devtool = storybookConfig.devtool;
|
|
54
|
+
// storybook uses `cheap-module-source-map` and it's incompatible with `CssMinimizerWebpackPlugin`
|
|
55
|
+
// also don't change devtool if it's disabled
|
|
56
|
+
if (mode === "production" /* WebpackMode.Prod */ && devtool) {
|
|
57
|
+
devtool = 'source-map';
|
|
58
|
+
}
|
|
53
59
|
return {
|
|
54
60
|
...storybookConfig,
|
|
61
|
+
devtool,
|
|
55
62
|
plugins: [...(storybookConfig.plugins ?? []), ...webpackConfig.plugins],
|
|
56
63
|
resolve: {
|
|
57
64
|
...storybookConfig.resolve,
|
|
@@ -73,13 +73,15 @@ const pitch = function (request) {
|
|
|
73
73
|
configureSourceMap(workerCompiler);
|
|
74
74
|
const cb = this.async();
|
|
75
75
|
workerCompiler.compile((err, compilation) => {
|
|
76
|
-
if (
|
|
77
|
-
|
|
76
|
+
if (compilation) {
|
|
77
|
+
workerCompiler.parentCompilation?.children.push(compilation);
|
|
78
78
|
}
|
|
79
|
-
workerCompiler.parentCompilation?.children.push(compilation);
|
|
80
79
|
if (err) {
|
|
81
80
|
return cb(err);
|
|
82
81
|
}
|
|
82
|
+
if (!compilation) {
|
|
83
|
+
return cb(new Error('Child compilation failed'));
|
|
84
|
+
}
|
|
83
85
|
if (compilation.errors && compilation.errors.length) {
|
|
84
86
|
const errorDetails = compilation.errors
|
|
85
87
|
.map((error) => {
|
|
@@ -95,7 +97,7 @@ const pitch = function (request) {
|
|
|
95
97
|
const cacheIdent = request;
|
|
96
98
|
const objectToHash = compilation.assets[filename];
|
|
97
99
|
if (!objectToHash) {
|
|
98
|
-
|
|
100
|
+
return cb(new Error(`Asset ${filename} not found in compilation`));
|
|
99
101
|
}
|
|
100
102
|
const cacheETag = cache.getLazyHashedEtag(objectToHash);
|
|
101
103
|
return cache.get(cacheIdent, cacheETag, (getCacheError, cacheContent) => {
|