storybook-builder-rsbuild 2.1.6 → 3.0.0-beta.1
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/compiled/@storybook/core-webpack/index.d.ts +4 -3066
- package/compiled/@storybook/core-webpack/index.js +323 -281
- package/compiled/@storybook/core-webpack/package.json +1 -1
- package/dist/_node-chunks/chunk-MIMCYZFR.js +45 -0
- package/dist/index.d.ts +3 -72
- package/dist/index.js +423 -650
- package/dist/loaders/export-order-loader.js +31 -52
- package/dist/preview-preset.js +17 -39
- package/package.json +17 -30
- package/dist/chunk-TTFRSOOU.mjs +0 -34
- package/dist/index.mjs +0 -947
- package/dist/loaders/export-order-loader.d.ts +0 -5
- package/dist/loaders/export-order-loader.mjs +0 -49
- package/dist/preview-preset.d.ts +0 -3
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
import '../chunk-TTFRSOOU.mjs';
|
|
2
|
-
import assert from 'assert';
|
|
3
|
-
import { init, parse as parse$1 } from 'cjs-module-lexer';
|
|
4
|
-
import { parse } from 'es-module-lexer';
|
|
5
|
-
import MagicString from 'magic-string';
|
|
6
|
-
|
|
7
|
-
async function loader(source, map, meta) {
|
|
8
|
-
const callback = this.async();
|
|
9
|
-
try {
|
|
10
|
-
const magicString = new MagicString(source);
|
|
11
|
-
try {
|
|
12
|
-
const parseResult = await parse(source);
|
|
13
|
-
const namedExportsOrder = (parseResult[1] || []).map((e) => source.substring(e.s, e.e)).filter((e) => e !== "default");
|
|
14
|
-
assert(
|
|
15
|
-
namedExportsOrder.length > 0,
|
|
16
|
-
"No named exports found. Very likely that this is not a ES module."
|
|
17
|
-
);
|
|
18
|
-
magicString.append(
|
|
19
|
-
`;export const __namedExportsOrder = ${JSON.stringify(namedExportsOrder)};`
|
|
20
|
-
);
|
|
21
|
-
} catch {
|
|
22
|
-
await init();
|
|
23
|
-
const namedExportsOrder = (parse$1(source).exports || []).filter(
|
|
24
|
-
(e) => e !== "default" && e !== "__esModule"
|
|
25
|
-
);
|
|
26
|
-
assert(
|
|
27
|
-
namedExportsOrder.length > 0,
|
|
28
|
-
"No named exports found. Very likely that this is not a CJS module."
|
|
29
|
-
);
|
|
30
|
-
magicString.append(
|
|
31
|
-
`;module.exports.__namedExportsOrder = ${JSON.stringify(namedExportsOrder)};`
|
|
32
|
-
);
|
|
33
|
-
}
|
|
34
|
-
return callback(
|
|
35
|
-
null,
|
|
36
|
-
magicString.toString(),
|
|
37
|
-
map ?? magicString.generateMap({
|
|
38
|
-
hires: true,
|
|
39
|
-
includeContent: true,
|
|
40
|
-
source: this.resourcePath
|
|
41
|
-
}),
|
|
42
|
-
meta
|
|
43
|
-
);
|
|
44
|
-
} catch (err) {
|
|
45
|
-
return callback(null, source, map, meta);
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
export { loader as default };
|
package/dist/preview-preset.d.ts
DELETED