PluginProbe
codoc / 0.9.61
codoc v0.9.61
0.9.61 0.9.8.8 0.9.8.9 0.9.9 0.9.9.1 trunk 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.8.1 0.8.2 0.8.3 0.8.4 0.8.6 0.8.7 0.8.8 0.8.9 0.9 0.9.1 0.9.10 All 115 releases
codoc / src / node-sass-compat / index.js

index.js in codoc 0.9.61, at src/node-sass-compat/index.js

22 lines 686 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 // tools/node-sass-compat/index.js
2 const sass = require('sass');
3
4 function translate(options = {}) {
5 const { outputStyle, ...rest } = options;
6 // node-sass の値 → dart-sass の値へマッピング
7 const style =
8 outputStyle === 'nested' || outputStyle === 'compact'
9 ? 'expanded'
10 : outputStyle === 'compressed'
11 ? 'compressed'
12 : rest.style;
13
14 return { ...rest, style };
15 }
16
17 exports.render = (opts, cb) => sass.render(translate(opts), cb);
18 exports.renderSync = (opts) => sass.renderSync(translate(opts));
19 // 雑に info を返す(node-sass 互換で参�
20 �されることがある)
21 exports.info = `node-sass-compat (dart-sass ${sass.info || ''})`;
22