Debian Codegraph @

test/node-sass/node-sass.js

raw symbols SCIP
1 const fs = require('fs');
2 const path = require('path');
3 const sass = require('node-sass');
4 const utils = require('../utils');
5
6 const NODE_SASS_BASE_PATH = 'test/node-sass/build/';
7
8 fs.mkdir(NODE_SASS_BASE_PATH, { recursive: true }, (err) => {
9 if (err) throw err;
10 });
11
12 const exportNodeSassCSS = (filepath, options) => {
13 utils.exportCSS(sass, fs, NODE_SASS_BASE_PATH, filepath, options)
14 }
15
16 // Full import
17
18 exportNodeSassCSS('bulma', {
19 file: './bulma.sass',
20 });
21
22 exportNodeSassCSS('bulma-rtl', {
23 file: './bulma-rtl.sass',
24 });
25
26 // Single imports
27
28 const BULMA_IMPORT_PATH = `./sass/`;
29
30 utils.SOURCES.forEach((source) => {
31 const parsed = path.parse(source);
32
33 fs.mkdir(`${NODE_SASS_BASE_PATH}${parsed.dir}`, { recursive: true }, (err) => {
34 if (err) throw err;
35 });
36
37 exportNodeSassCSS(`${parsed.dir}/${parsed.name}`, {
38 data: `@import "${BULMA_IMPORT_PATH}${source}";`,
39 });
40 });