--expose-importsflag. This should generate
cosmos.imports.js. Check that file to see if your fixtures are being picked up by Cosmos.
- Check your directory structure. If you are using a Cosmos config file, Cosmos will use the directory of the config file as the root of your project. If your Cosmos config file is nested in a directory that isn't an ancestor of your fixture files Cosmos won't find your fixtures. To solve this add a
rootDirentry to your Cosmos config pointing to your root directory.
Most React Cosmos Webpack issues are related to missing build dependencies. Please see Webpack config.
- Check for build errors in your terminal.
- Make sure you have
html-webpack-plugininstalled, as well as any other build dependency.
- Try renaming
filenamein HtmlWebpackPlugin options to
index.html, or alternatively remove the HtmlWebpackPlugin plugin from your Webpack config and Cosmos will automatically it with the proper options. For more details see this issue (opens in a new tab).