Does not detect any dependencies in typescript project
Paratron opened this issue · comments
Hey,
I just tried out the plugin and: it doesnt work :D
The dependencies table shows up in the docs but its always empty. I guess its due to the setup I made to make docs work with typescript.
const path = require("path");
module.exports = {
addons: [
"@storybook/addon-actions",
"@storybook/addon-links",
"@storybook/addon-viewport",
"@storybook/addon-knobs",
{
name: "@storybook/addon-docs",
options: {
configureJSX: true,
babelOptions: {}
}
}
],
presets: ["@storybook/preset-typescript", "storybook-addon-deps/preset"],
stories: ["../app/**/*.stories.(tsx|mdx)"],
webpackFinal: async config => {
config.module.rules.push({
test: /\.(ts|tsx)$/,
loader: require.resolve("babel-loader"),
include: path.resolve(__dirname, "../app"),
options: {
presets: [["react-app", {flow: false, typescript: true}]]
}
});
config.module.rules.push({
test: /\.scss$/,
include: path.resolve(__dirname, "../app"),
loaders: ["style-loader", "css-loader", "sass-loader"]
});
config.module.rules.push({
test: /\.tsx?$/,
include: path.resolve(__dirname, "../app"),
use: [require.resolve("ts-loader"), require.resolve("react-docgen-typescript-loader")]
});
config.resolve.alias["app"] = path.join(__dirname, "../app");
config.resolve.extensions.push(".ts", ".tsx");
return config;
}
};
`
Thanks very much for the report. Typescript is not the problem as i am using it myself mostly on ts projects.
So you see the prop tables for the component in docs? Do you have a repo i can try to find the issue?
Hi @Paratron - any updates?
Hey, not right now. We are using this for a company project and the sources are hosted on an internal gitlab instance.
I will try and set up a repo on github with an reproducable example in the next days when there is some spare time left :)