v5.3.0-rc.12: Running build-storybook does not include scss files
See original GitHub issueDescribe the bug
When attempting to run build-storybook
, it builds successfully, but it does not include any of the scss
style files, despite using the @storybook/preset-scss
. I have also tried custom webpack setup for scss compiling, but that was also unsuccessful. The site is built, it just has absolutely no style.
It is also a TypeScript environment and has no problem with the TypeScript and tsx files.
It also works perfectly fine when running start-storybook
, only build-storybook
fails to work with scss files.
To Reproduce Steps to reproduce the behavior:
- Run
build-storybook
- Observe the created static site
Expected behavior
Should include style files as css. This worked as intended before converting the files over to main
, preview
etc.
Screenshots If applicable, add screenshots to help explain your problem.
Code snippets
preview.js
import { withInfo } from '@storybook/addon-info';
import { withKnobs } from '@storybook/addon-knobs';
import { addDecorator, addParameters } from '@storybook/react';
import theme from './theme';
// THESE AREN'T WORKING!!!!!
import '../src/index.scss';
import './style.scss';
addDecorator(withInfo(/* Some settings */));
addDecorator(withKnobs);
addParameters({
options: { panelPosition: 'right', theme },
docs: { extractComponentDescription: (_c, { info }) => info ? info : null },
});
main.js
const path = require('path');
module.exports = {
stories: ['../src/components/**/*.stories.tsx'],
addons: [
'@storybook/addon-knobs/register',
'@storybook/addon-actions/register',
'@storybook/addon-viewport/register',
'@storybook/addon-docs',
],
presets: [
'@storybook/preset-scss',
{
name: '@storybook/preset-typescript',
options: {
tsLoaderOptions: { ignoreDiagnostics: [7005] },
include: [path.resolve(__dirname, '../')],
},
},
],
};
System: OS: macOS Mojave 10.14.4 CPU: (12) x64 Intel® Core™ i7-8850H CPU @ 2.60GHz Binaries: Node: 12.13.1 - /usr/local/bin/node Yarn: 1.19.2 - /usr/local/bin/yarn npm: 6.12.1 - /usr/local/bin/npm Browsers: Chrome: 79.0.3945.117 Safari: 12.1 npmPackages: @storybook/addon-actions: ^5.3.0-rc.12 => 5.3.0-rc.12 @storybook/addon-docs: ^5.3.0-rc.12 => 5.3.0-rc.12 @storybook/addon-info: ^5.3.0-rc.12 => 5.3.0-rc.12 @storybook/addon-knobs: ^5.3.0-rc.12 => 5.3.0-rc.12 @storybook/addon-viewport: ^5.3.0-rc.12 => 5.3.0-rc.12 @storybook/addons: ^5.3.0-rc.12 => 5.3.0-rc.12 @storybook/preset-scss: ^1.0.2 => 1.0.2 @storybook/preset-typescript: ^1.2.0 => 1.2.0 @storybook/react: ^5.3.0-rc.12 => 5.3.0-rc.12 @storybook/storybook-deployer: ^2.8.1 => 2.8.1
Issue Analytics
- State:
- Created 4 years ago
- Reactions:3
- Comments:8 (4 by maintainers)
Top GitHub Comments
@arabold @shilman the preset clears out any customisations that are set before it is loaded, but you should be able to make changes after. It’s not something we officially support, but it should work.
If you think this is not working correctly, please raise an issue on the preset (https://github.com/storybookjs/presets/issues/new) with a reproduction and I’ll take a look! 😃
@arabold glad it’s working again! AFAIK webpack customization is not possible in CRA