Skip to content

Commit

Permalink
Fix SASS / SCSS docs
Browse files Browse the repository at this point in the history
  • Loading branch information
JonnyBurger committed Jun 11, 2021
1 parent e4eab50 commit e92c917
Showing 1 changed file with 33 additions and 7 deletions.
40 changes: 33 additions & 7 deletions packages/docs/docs/overwriting-webpack-config.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ id: webpack
title: Custom Webpack config
---

import Tabs from "@theme/Tabs";

You can customize the Webpack configuration if you have at least Version 1.1 of Remotion.

Create a config file called `remotion.config.ts` in the root of your project. As a confirmation, you should get a console message `Applied configuration from [configuration-file]`.
Expand Down Expand Up @@ -85,9 +87,35 @@ Create a file which contains `declare module '*.mdx';` in your project to fix a

### Enable SASS/SCSS support

```tsx
import {Config} from 'remotion';
1. Install the following dependencies:

<Tabs
defaultValue="npm"
values={[
{ label: 'npm', value: 'npm', },
{ label: 'yarn', value: 'yarn', },
]
}>
<TabItem value="npm">

```bash
npm i sass sass-loader
```

</TabItem>

<TabItem value="yarn">

```bash
yarn add sass sass-loader
```

</TabItem>
</Tabs>

2. Add the following to your [`remotion.config.ts`](/docs/config) file:

```tsx
Config.Bundling.overrideWebpackConfig((currentConfiguration) => {
return {
...currentConfiguration,
Expand All @@ -97,12 +125,8 @@ Config.Bundling.overrideWebpackConfig((currentConfiguration) => {
...(currentConfiguration.module?.rules
? currentConfiguration.module.rules
: []),
// Add more loaders here
{
// look for .css or .scss files
test: /\.(css|scss)$/,
// in the `src` directory
include: [resolveApp('src')],
test: /\.s[ac]ss$/i,
use: [
{
loader: 'style-loader',
Expand All @@ -124,6 +148,8 @@ Config.Bundling.overrideWebpackConfig((currentConfiguration) => {
});
```

3. Restart the preview server.

### Use legacy babel loader

See [Using legacy Babel transpilation](legacy-babel).
Expand Down

2 comments on commit e92c917

@vercel
Copy link

@vercel vercel bot commented on e92c917 Jun 11, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

remotion – ./

remotion-jonnyburger.vercel.app
remotion.vercel.app
remotion-git-main-jonnyburger.vercel.app

@vercel
Copy link

@vercel vercel bot commented on e92c917 Jun 11, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.