Socket
Socket
Sign inDemoInstall

@storybook/core-server

Package Overview
Dependencies
376
Maintainers
9
Versions
936
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @storybook/core-server

Storybook framework-agnostic API


Version published
Weekly downloads
4.3M
decreased by-14.27%
Maintainers
9
Created
Weekly downloads
 

Package description

What is @storybook/core-server?

The @storybook/core-server npm package is part of the Storybook ecosystem, which is a tool for developing UI components in isolation for React, Vue, Angular, and more. It allows developers to serve and manage Storybook instances in a Node.js environment. With this package, you can start a Storybook server, build a static version of Storybook for deployment, and customize various aspects of the Storybook instance.

What are @storybook/core-server's main functionalities?

Starting a Storybook server

This code sample demonstrates how to start a Storybook server on port 6006 using the configuration from the '.storybook' directory.

const { buildDevStandalone } = require('@storybook/core-server');
buildDevStandalone({
  port: 6006,
  configDir: './.storybook'
}).catch(error => {
  console.error(error);
  process.exit(1);
});

Building a static Storybook

This code sample shows how to build a static version of Storybook that can be deployed to a web server. The output will be placed in the 'storybook-static' directory.

const { buildStatic } = require('@storybook/core-server');
buildStatic({
  staticDir: './public',
  configDir: './.storybook',
  outputDir: './storybook-static'
}).catch(error => {
  console.error(error);
  process.exit(1);
});

Customizing Storybook's Webpack configuration

This code sample is typically placed in a '.storybook/main.js' file and demonstrates how to customize Storybook's Webpack configuration using the 'webpackFinal' method.

module.exports = {
  stories: ['../src/**/*.stories.js'],
  addons: ['@storybook/addon-actions', '@storybook/addon-links'],
  webpackFinal: async (config, { configType }) => {
    // Modify or return the webpack config.
    return config;
  }
};

Other packages similar to @storybook/core-server

Changelog

Source

8.0.8

  • Automigration: Fix name of VTA addon - #26816, thanks @valentinpalkovic!

Readme

Source

Storybook Core-server

This package contains common node-side functionality used among the different frameworks (React, RN, Vue 3, Ember, Angular, etc).

It contains:

  • CLI arg parsing
  • Storybook UI "manager" webpack configuration
  • start-storybook dev server
  • build-storybook static builder
  • presets handling

The "preview" (aka iframe) side is implemented in pluggable builders:

  • @storybook/builder-webpack5

These builders abstract both the webpack dependencies as well as the various core configurations and loader/plugin dependencies provided out of the box with Storybook.

Keywords

FAQs

Last updated on 11 Apr 2024

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc