storysource addon: source of transpiled files
See original GitHub issueIs your feature request related to a problem? Please describe.
In my project I have to operate on transpiled (from TS to es6) *.stories.js
files. They include source maps. Example:
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const tslib_1 = require("tslib");
const React = tslib_1.__importStar(require("react"));
const react_1 = require("@storybook/react");
react_1.storiesOf("Foo", module).add("test", () => React.createElement("div", null, "Foo"));
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiRm9vLnN0b3JpZXMuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi9zcmMvU3RhdHVzTGFiZWwvX19kb2NzX18vRm9vLnN0b3JpZXMudHN4Il0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7OztBQUFBLHFEQUErQjtBQUMvQiw0Q0FBNkM7QUFFN0MsaUJBQVMsQ0FBQyxLQUFLLEVBQUUsTUFBTSxDQUFDLENBQUMsR0FBRyxDQUFDLE1BQU0sRUFBRSxHQUFHLEVBQUUsQ0FBQyx1Q0FBYyxDQUFDLENBQUMiLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgKiBhcyBSZWFjdCBmcm9tIFwicmVhY3RcIjtcbmltcG9ydCB7IHN0b3JpZXNPZiB9IGZyb20gXCJAc3Rvcnlib29rL3JlYWN0XCI7XG5cbnN0b3JpZXNPZihcIkZvb1wiLCBtb2R1bGUpLmFkZChcInRlc3RcIiwgKCkgPT4gPGRpdj5Gb288L2Rpdj4pO1xuIl19
Describe the solution you’d like It would be great if storysource addon would support that kind of files. Currently it seems not recognize it and shows
1 loading source…
message. After debugging I noticed that loader is returning at line 11: https://github.com/storybooks/storybook/blob/next/addons/storysource/src/loader/index.js#L11
Describe alternatives you’ve considered No alternatives considered.
Are you able to assist bring the feature to reality? I can try.
Additional context Tagging @igor-dv as author of this plugin. Maybe you have some ideas/tips/workarounds how to achieve that?
Issue Analytics
- State:
- Created 4 years ago
- Comments:6 (3 by maintainers)
Top GitHub Comments
Working on storysource V2, you will see the original source code of the story PLUS the local dependencies too.
Hey there, it’s me again! I am going close this issue to help our maintainers focus on the current development roadmap instead. If the issue mentioned is still a concern, please open a new ticket and mention this old one. Cheers and thanks for using Storybook!