@gethinode/netlify-plugin-dartsass

中文文档
0.3.0发布于 2024/03/03MITCommonJS零依赖近 30 天下载 3685

Install Dart Sass to enable the latest features of the Sass language for your Hugo site

原始使用文档
文档目录3 节
  1. Usage
  2. How it works
  3. Credits

Netlify Build Plugin: Install Dart Sass

This plugin installs Dart Sass to enable the latest features of the Sass language for your Hugo deployments. It is a convenience plugin that ensures the correct binary is available within all build contexts of Netlify.

Usage

For file-based installation, add the following lines to your netlify.toml file:

[build.environment]
  # see index.js for default value
  DART_SASS_VERSION = "1.71.1" 

[[plugins]]
  package = "netlify-plugin-dartsass"

Note: The [[plugins]] line is required for each plugin, even if you have other plugins in your netlify.toml file already.

To complete file-based installation, from your project's base directory, use npm, yarn, or any other Node.js package manager to add the plugin to devDependencies in package.json.

npm install -D @gethinode/netlify-plugin-dartsass

How it works

This plugin prepends an installation script prior to your regular Netlify build command. This ensures the Dart Sass binary compatible with Hugo is installed in Netlify's runner. You could simply add these installation steps to your build file manually, however, you would have to do so for each build context. By enabling this plugin, the binary is available to all build contexts, which include production deploys, deploy previews, and branch deploys.

The following installation script is prepended to your current build command, where ${version} is obtained from your build environment (DART_SASS_VERSION):

curl -LJO https://github.com/sass/dart-sass/releases/download/${version}/dart-sass-${version}-linux-x64.tar.gz && \
tar -xf dart-sass-${version}-linux-x64.tar.gz && \
rm dart-sass-${version}-linux-x64.tar.gz && \
export PATH=/opt/build/repo/dart-sass:$PATH`

Credits

This plugin is inspired by the following instructions and repositories:

版本与发布记录

@gethinode/netlify-plugin-dartsass 共发布 4 个版本,首次发布于 2023/09/06;过去 12 个月发布了 0 个版本。

版本发布日期距今
0.3.0latest2024/03/032 年前
0.2.12024/03/032 年前
0.2.02023/09/063 年前
0.1.02023/09/063 年前

关于 @gethinode/netlify-plugin-dartsass 的常见问题

@gethinode/netlify-plugin-dartsass 是什么?

Install Dart Sass to enable the latest features of the Sass language for your Hugo site

如何安装 @gethinode/netlify-plugin-dartsass?

在项目目录运行 npm install @gethinode/netlify-plugin-dartsass,或使用 pnpm add / yarn add / bun add。

@gethinode/netlify-plugin-dartsass 支持 TypeScript 吗?

该包的 package.json 没有声明类型入口。需要类型提示时,可以在 npm 上查找社区维护的 @types/gethinode__netlify-plugin-dartsass 是否存在。

@gethinode/netlify-plugin-dartsass 支持 ESM 还是 CommonJS?

以 CommonJS 形式发布,可以直接 require();在 ES Module 项目中也可以用 import 引入(Node.js 会把 module.exports 作为默认导出)。

@gethinode/netlify-plugin-dartsass 可以商用吗?

@gethinode/netlify-plugin-dartsass 使用 MIT 许可。宽松许可:允许商业使用、修改和再分发,通常只需在分发时保留原版权与许可声明。以上为概括,不构成法律意见,请以许可原文为准。

@gethinode/netlify-plugin-dartsass 的下载量有多少?

根据 npm 官方下载统计,@gethinode/netlify-plugin-dartsass 在 2026/10/17 – 2026/11/15 这 30 天内被下载 3,685 次,日均约 123 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@gethinode/netlify-plugin-dartsass 还在维护吗?

最新版本 0.3.0 发布于 2024/03/03(2 年前);至今共发布 4 个版本,其中过去 12 个月发布了 0 个;首次发布于 2023/09/06。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。