---
id: 'default-config'
title: 'Default Config'
---

Storybook has a default Webpack setup which suits a large range of projects.
It is similar to [Create React App](https://github.com/facebookincubator/create-react-app)'s config when using react, and has been tweaked to closely resemble the webpack config generated by [Vue CLI](https://github.com/vuejs/vue-cli).

Let's learn about the default config comes with Storybook.

## Table of Contents

-   [Babel](#babel)
    -   [ES2016+ Support](#es2016-support)
    -   [.babelrc support](#babelrc-support)
-   [Webpack](#webpack)
    -   [CSS Support](#css-support)
    -   [Image and Static File Support](#image-and-static-file-support)
    -   [JSON Loader](#json-loader)
-   [NPM Modules](#npm-modules)

## Babel

We use Babel for JavaScript(ES6) transpiling.
Here are some key features of Storybook's Babel configurations.

### ES2016+ Support

We have added ES2016 support with Babel for transpiling your JS code.
In addition to that, we've added a few experimental features, like object spreading and async await.
Check out our [source](https://github.com/storybooks/storybook/blob/master/lib/core/src/server/config/babel.dev.js) to learn more about these plugins.

### .babelrc support

If your project has a `.babelrc` file, we'll use that instead of the default config file.
So, you could use any babel plugins or presets that you have used in your project with Storybook.

## Webpack

We use Webpack to serve and load JavaScript modules for the web.
We've added some Webpack loaders to bring some good defaults. (This setup is very close to what you get with the [Create React App](https://github.com/facebookincubator/create-react-app).)

### CSS Support

You can simply import CSS files wherever you want, whether it's in the storybook config file, a UI component, or inside a story definition file.

Basically, you can import CSS like this:

```js
// from NPM modules
import 'bootstrap/dist/css/bootstrap.css';

// from local path
import './styles.css';
```

> **Note:** this is plain CSS only. If you need a preprocessor like SASS, you need to [customize the webpack config](/configurations/custom-webpack-config/).
>
> **Warning:** storybooks for projects that use Angular CLI cannot import CSS by default. They must either [customize the webpack config](/configurations/custom-webpack-config/), or use the inline loader syntax:
> ```js
> import '!style-loader!css-loader!./styles.css';
> ```

### Image and Static File Support

You can also import images and media files directly via JavaScript.
This helps you to write stories with media files easily. This is how to do it:

```js
import React from 'react';
import { storiesOf } from '@storybook/react';

import imageFile from './static/image.png';

storiesOf('<img />', module)
  .add('with a image', () => (
    <img src={imageFile} alt="covfefe" />
  ));
```

When you are building a storybook, we'll also export the imported image.
So, this is a good approach to loading all of your static content.

> **Alternative:** storybook also has a way to mention static directories via the `-s` option of the `start-storybook` and `build-storybook` commands. [read more](/configurations/serving-static-files/)

### JSON Loader

You can import `.json` files, as you do with Node.js.
This will also allow you to use NPM projects, which imports `.json` files inside them.

## NPM Modules

You can use any of the NPM modules installed on your project.
You can simply import and use them.
