Skip to main content

@remotion/enable-scss

该包提供了一个 Webpack 覆盖,用于在 Remotion 中启用 SCSS/SASS

安装

安装 @remotion/enable-scss 以及 TailwindCSS 依赖项。

npm i --save-exact @remotion/enable-scss@4.0.206 sass@1.77.2 sass-loader@14.2.1 css-loader@5.2.7
npm i --save-exact @remotion/enable-scss@4.0.206 sass@1.77.2 sass-loader@14.2.1 css-loader@5.2.7
This assumes you are currently using v4.0.206 of Remotion.
Also update remotion and all `@remotion/*` packages to the same version.
Remove all ^ character in front of the version numbers of it as it can lead to a version conflict.

warning

请注意安装确切的这些版本。
更新的版本可能无法正常工作。

使用

通过使用 enableScss()覆盖 Webpack 配置

remotion.config.ts
ts
import { Config } from "@remotion/cli/config";
import { enableScss } from "@remotion/enable-scss";
 
Config.overrideWebpackConfig((currentConfiguration) => {
return enableScss(currentConfiguration);
});
remotion.config.ts
ts
import { Config } from "@remotion/cli/config";
import { enableScss } from "@remotion/enable-scss";
 
Config.overrideWebpackConfig((currentConfiguration) => {
return enableScss(currentConfiguration);
});

API