-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.js
24 lines (19 loc) · 836 Bytes
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
const { env } = require('node:process');
module.exports = {
onPreBuild({ netlifyConfig, utils }) {
let version = env.DART_SASS_VERSION || "1.71.1";
let newCommand = `
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`
utils.status.show({
title: "Using Dart Sass",
summary: `Version ${version}`,
});
// Run a script prior to build command
netlifyConfig.build.command = netlifyConfig.build.command
? `${newCommand} && ${netlifyConfig.build.command}`
: newCommand;
},
};