balm-core 4.21.0 → 4.22.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -94,8 +94,8 @@ function cssLoader() {
94
94
  // Prefer `dart-sass`
95
95
  implementation: requireModule.resolve('sass'),
96
96
  sassOptions: Object.assign({
97
- includePaths: BalmJS.file.stylePaths,
98
- outputStyle: 'expanded',
97
+ loadPaths: BalmJS.file.stylePaths,
98
+ sourceMap: true,
99
99
  quietDeps: BalmJS.config.logs.level < BalmJS.LogLevel.Warn
100
100
  }, BalmJS.config.styles.sassOptions)
101
101
  }),
@@ -23,35 +23,39 @@ function inlineSources(sourcemap) {
23
23
  return sourcemap;
24
24
  }, () => sourcemap);
25
25
  }
26
- function renderLess(str, opts) {
26
+ function renderLess(input, options) {
27
27
  return new Promise((resolve, reject) => {
28
- less.render(str, opts, (err, res) => {
29
- if (err) {
30
- reject(err);
28
+ less.render(input, options, (error, output) => {
29
+ if (error) {
30
+ reject(error);
31
31
  } else {
32
- const obj = {
33
- result: res.css,
34
- imports: res.imports
32
+ const {
33
+ css,
34
+ imports
35
+ } = output;
36
+ const result = {
37
+ css,
38
+ imports
35
39
  };
36
- if (opts.sourceMap && res.map) {
37
- obj.sourcemap = JSON.parse(res.map);
38
- inlineSources(obj.sourcemap).then(map => {
39
- obj.sourcemap = map;
40
- resolve(obj);
40
+ if (options.sourceMap && output.map) {
41
+ result.sourcemap = JSON.parse(output.map);
42
+ inlineSources(result.sourcemap).then(map => {
43
+ result.sourcemap = map;
44
+ resolve(result);
41
45
  });
42
46
  } else {
43
- resolve(obj);
47
+ resolve(result);
44
48
  }
45
49
  }
46
50
  });
47
51
  });
48
52
  }
49
- function gulpLess(options) {
53
+ function gulpLess(customOptions) {
50
54
  // Mixes in default options.
51
- const opts = Object.assign({}, {
55
+ const options = Object.assign({}, {
52
56
  compress: false,
53
57
  paths: []
54
- }, options);
58
+ }, customOptions);
55
59
  return through2.obj((file, enc, cb) => {
56
60
  if (file.isNull()) {
57
61
  return cb(null, file);
@@ -59,22 +63,22 @@ function gulpLess(options) {
59
63
  if (file.isStream()) {
60
64
  return cb(new PluginError(PLUGIN_NAME, 'Streaming not supported'));
61
65
  }
62
- const str = file.contents.toString();
66
+ const input = file.contents.toString();
63
67
 
64
68
  // Injects the path of the current file
65
- opts.filename = file.path;
69
+ options.filename = file.path;
66
70
 
67
71
  // Bootstrap source maps
68
- if (file.sourceMap || opts.sourcemap) {
69
- opts.sourceMap = true;
72
+ if (file.sourceMap || options.sourcemap) {
73
+ options.sourceMap = true;
70
74
  }
71
- renderLess(str, opts).then(res => {
72
- file.contents = Buffer.from(res.result);
75
+ renderLess(input, options).then(output => {
76
+ file.contents = Buffer.from(output.css);
73
77
  file.path = replaceExtension(file.path, '.css');
74
- if (res.sourcemap) {
75
- res.sourcemap.file = file.relative;
76
- res.sourcemap.sources = res.sourcemap.sources.map(source => node.path.relative(file.base, source));
77
- applySourceMap(file, res.sourcemap);
78
+ if (output.sourcemap) {
79
+ output.sourcemap.file = file.relative;
80
+ output.sourcemap.sources = output.sourcemap.sources.map(source => node.path.relative(file.base, source));
81
+ applySourceMap(file, output.sourcemap);
78
82
  }
79
83
  return file;
80
84
  }).then(file => {
@@ -109,7 +109,7 @@ export default gulpPostcss(loadConfig => {
109
109
  // Prevent stream’s unhandled exception from
110
110
  // being suppressed by Promise
111
111
  setImmediate(function () {
112
- cb(new PluginError('gulp-postcss', error, errorOptions));
112
+ cb(new PluginError(PLUGIN_NAME, error, errorOptions));
113
113
  });
114
114
  }
115
115
  };
@@ -9,9 +9,10 @@ import applySourceMap from 'vinyl-sourcemaps-apply';
9
9
  import ansiColors from 'ansi-colors';
10
10
  process.env.BALM_CWD = process.env.INIT_CWD || process.cwd();
11
11
  const localSassModule = path.join(process.env.BALM_ROOT || process.env.BALM_CWD, 'node_modules', 'sass');
12
- const newLocalSassModule = path.join(localSassModule, 'sass.default.js');
13
- const oldLocalSassModule = path.join(localSassModule, 'sass.dart.js'); // Just for `npm i -D sass@1.39.2`
14
- const sassModule = fs.existsSync(newLocalSassModule) ? requireModule(newLocalSassModule) : fs.existsSync(oldLocalSassModule) ? requireModule(oldLocalSassModule) : sass;
12
+ const nodeLocalSassModule = path.join(localSassModule, 'sass.node.js');
13
+ const defaultLocalSassModule = path.join(localSassModule, 'sass.default.js'); // For `npm i -D sass <= 1.62.1`
14
+ const dartLocalSassModule = path.join(localSassModule, 'sass.dart.js'); // For `npm i -D sass <= 1.39.2`
15
+ const sassModule = fs.existsSync(nodeLocalSassModule) ? requireModule(nodeLocalSassModule) : fs.existsSync(defaultLocalSassModule) ? requireModule(defaultLocalSassModule) : fs.existsSync(dartLocalSassModule) ? requireModule(dartLocalSassModule) : sass;
15
16
  const PLUGIN_NAME = 'sass';
16
17
  const transformObj = transform => new Transform({
17
18
  transform,
@@ -21,32 +22,16 @@ const transformObj = transform => new Transform({
21
22
  /**
22
23
  * Handles returning the file to the stream
23
24
  */
24
- const filePush = (file, sassObject, callback) => {
25
+ const filePush = (file, result, callback) => {
25
26
  // Build Source Maps!
26
- if (sassObject.map) {
27
- // Transform map into JSON
28
- const sassMap = JSON.parse(sassObject.map.toString());
29
- // Grab the stdout and transform it into stdin
30
- const sassMapFile = sassMap.file.replace(/^stdout$/, 'stdin');
31
- // Grab the base filename that's being worked on
32
- const sassFileSrc = file.relative;
33
- // Grab the path portion of the file that's being worked on
34
- const sassFileSrcPath = node.path.dirname(sassFileSrc);
35
- if (sassFileSrcPath) {
36
- const sourceFileIndex = sassMap.sources.indexOf(sassMapFile);
37
- // Prepend the path to all files in the sources array except the file that's being worked on
38
- sassMap.sources = sassMap.sources.map((source, index) => index === sourceFileIndex ? source : node.path.join(sassFileSrcPath, source));
39
- }
40
-
41
- // Remove 'stdin' from sources and replace with filenames!
42
- sassMap.sources = sassMap.sources.filter(src => src !== 'stdin' && src);
43
-
27
+ if (result.sourceMap) {
28
+ const sassMap = result.sourceMap;
44
29
  // Replace the map file with the original filename (but new extension)
45
- sassMap.file = replaceExtension(sassFileSrc, '.css');
30
+ sassMap.file = replaceExtension(file.relative, '.css');
46
31
  // Apply the map
47
32
  applySourceMap(file, sassMap);
48
33
  }
49
- file.contents = sassObject.css;
34
+ file.contents = Buffer.from(result.css);
50
35
  file.path = replaceExtension(file.path, '.css');
51
36
  if (file.stat) {
52
37
  file.stat.atime = file.stat.mtime = file.stat.ctime = new Date();
@@ -58,13 +43,9 @@ const filePush = (file, sassObject, callback) => {
58
43
  * Handles error message
59
44
  */
60
45
  const handleError = (error, file, callback) => {
61
- const filePath = (error.file === 'stdin' ? file.path : error.file) || file.path;
62
- const relativePath = node.path.relative(process.cwd(), filePath);
63
- const message = `${ansiColors.underline(relativePath)}\n${error.formatted}`;
64
- error.messageFormatted = message;
65
- error.messageOriginal = error.message;
46
+ const relativePath = node.path.relative(process.cwd(), file.path);
47
+ const message = `${ansiColors.underline(relativePath)}\n${error.message}`;
66
48
  error.message = stripAnsi(message);
67
- error.relativePath = relativePath;
68
49
  return callback(new PluginError(PLUGIN_NAME, error));
69
50
  };
70
51
 
@@ -73,58 +54,23 @@ const handleError = (error, file, callback) => {
73
54
  //////////////////////////////
74
55
  const gulpSass = options => transformObj((file, encoding, callback) => {
75
56
  if (file.isNull()) {
76
- callback(null, file);
77
- return;
57
+ return callback(null, file);
78
58
  }
79
59
  if (file.isStream()) {
80
- callback(new PluginError(PLUGIN_NAME, 'Streaming not supported'));
81
- return;
60
+ return callback(new PluginError(PLUGIN_NAME, 'Streaming not supported'));
82
61
  }
83
62
  if (node.path.basename(file.path).startsWith('_')) {
84
- callback();
85
- return;
63
+ return callback();
86
64
  }
87
65
  if (!file.contents.length) {
88
66
  file.path = replaceExtension(file.path, '.css');
89
- callback(null, file);
90
- return;
91
- }
92
- const opts = options || {};
93
- opts.data = file.contents.toString();
94
-
95
- // We set the file path here so that libsass can correctly resolve import paths
96
- opts.file = file.path;
97
-
98
- // Ensure `indentedSyntax` is true if a `.sass` file
99
- if (node.path.extname(file.path) === '.sass') {
100
- opts.indentedSyntax = true;
67
+ return callback(null, file);
101
68
  }
102
-
103
- // Ensure file's parent directory in the include path
104
- if (opts.includePaths) {
105
- if (typeof opts.includePaths === 'string') {
106
- opts.includePaths = [opts.includePaths];
107
- }
108
- } else {
109
- opts.includePaths = [];
110
- }
111
- opts.includePaths.unshift(node.path.dirname(file.path));
112
-
113
- // Generate Source Maps if the source-map plugin is present
114
- if (file.sourceMap) {
115
- opts.sourceMap = file.path;
116
- opts.omitSourceMapUrl = true;
117
- opts.sourceMapContents = true;
118
- }
119
-
120
- //////////////////////////////
121
- // Sync Sass render
122
- //////////////////////////////
69
+ const path = file.path;
123
70
  try {
124
- gulpSass.compiler && filePush(file, gulpSass.compiler.renderSync(opts), callback);
71
+ filePush(file, sassModule.compile(path, options), callback);
125
72
  } catch (error) {
126
73
  handleError(error, file, callback);
127
74
  }
128
75
  });
129
- gulpSass.compiler = sassModule;
130
76
  export default gulpSass;
@@ -4,8 +4,8 @@ class SassTask extends BalmJS.BalmStyleTask {
4
4
  }
5
5
  get options() {
6
6
  return Object.assign({
7
- includePaths: BalmJS.file.stylePaths,
8
- outputStyle: 'expanded',
7
+ loadPaths: BalmJS.file.stylePaths,
8
+ sourceMap: true,
9
9
  quietDeps: BalmJS.config.logs.level < BalmJS.LogLevel.Warn
10
10
  }, BalmJS.config.styles.sassOptions, this.customOptions);
11
11
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "balm-core",
3
- "version": "4.21.0",
3
+ "version": "4.22.0",
4
4
  "description": "BalmJS compiler core",
5
5
  "keywords": [
6
6
  "balm",
@@ -44,17 +44,17 @@
44
44
  "@rollup/plugin-terser": "^0.4.3",
45
45
  "ansi-colors": "^4.1.3",
46
46
  "async": "^3.2.4",
47
- "autoprefixer": "^10.4.14",
48
- "babel-loader": "^9.1.2",
47
+ "autoprefixer": "^10.4.15",
48
+ "babel-loader": "^9.1.3",
49
49
  "browser-sync": "^2.29.3",
50
50
  "connect-history-api-fallback": "^2.0.0",
51
51
  "css-loader": "^6.8.1",
52
- "css-minimizer-webpack-plugin": "^5.0.0",
52
+ "css-minimizer-webpack-plugin": "^5.0.1",
53
53
  "cssnano": "^6.0.1",
54
54
  "del": "^7.0.0",
55
- "dotenv": "^16.1.4",
55
+ "dotenv": "^16.3.1",
56
56
  "dotenv-expand": "^10.0.0",
57
- "esbuild": "^0.17.0",
57
+ "esbuild": "^0.19.0",
58
58
  "fancy-log": "^2.0.0",
59
59
  "gulp-eslint": "^6.0.0",
60
60
  "gulp-if": "^3.0.0",
@@ -67,41 +67,41 @@
67
67
  "gulp.spritesmith": "^6.13.0",
68
68
  "html-loader": "^4.2.0",
69
69
  "html-minifier": "^4.0.0",
70
- "html-webpack-plugin": "^5.5.1",
70
+ "html-webpack-plugin": "^5.5.3",
71
71
  "http-proxy-middleware": "^2.0.6",
72
72
  "imagemin": "^8.0.1",
73
73
  "istextorbinary": "^6.0.0",
74
- "less": "^4.1.3",
74
+ "less": "^4.2.0",
75
75
  "mini-css-extract-plugin": "^2.7.6",
76
76
  "modernizr": "^3.12.0",
77
77
  "parents": "^1.0.1",
78
78
  "plugin-error": "^2.0.1",
79
- "postcss": "^8.4.24",
79
+ "postcss": "^8.4.27",
80
80
  "postcss-flexbugs-fixes": "^5.0.2",
81
81
  "postcss-import": "^15.1.0",
82
82
  "postcss-load-config": "^4.0.1",
83
- "postcss-loader": "7.3.2",
84
- "postcss-preset-env": "^8.4.2",
85
- "pretty-bytes": "^6.1.0",
86
- "readable-stream": "^4.4.0",
83
+ "postcss-loader": "7.3.3",
84
+ "postcss-preset-env": "^9.1.1",
85
+ "pretty-bytes": "^6.1.1",
86
+ "readable-stream": "^4.4.2",
87
87
  "replace-ext": "^2.0.0",
88
88
  "rollup": "^3.24.0",
89
- "sass": "1.62.1",
90
- "sass-loader": "^13.3.1",
91
- "ssh2": "^1.13.0",
89
+ "sass": "^1.65.1",
90
+ "sass-loader": "^13.3.2",
91
+ "ssh2": "^1.14.0",
92
92
  "strip-ansi": "^7.1.0",
93
93
  "style-loader": "^3.3.3",
94
- "tailwindcss": "^3.3.2",
95
- "terser": "^5.17.7",
94
+ "tailwindcss": "^3.3.3",
95
+ "terser": "^5.19.2",
96
96
  "terser-webpack-plugin": "^5.3.9",
97
97
  "through2": "^4.0.2",
98
98
  "through2-concurrent": "^2.0.0",
99
- "tslib": "^2.5.3",
99
+ "tslib": "^2.6.1",
100
100
  "vinyl-sourcemaps-apply": "^0.2.1",
101
- "webpack": "^5.86.0",
101
+ "webpack": "^5.88.0",
102
102
  "webpack-bundle-analyzer": "^4.9.0",
103
103
  "webpack-dev-middleware": "^6.1.1",
104
- "webpack-hot-middleware": "^2.25.3",
104
+ "webpack-hot-middleware": "^2.25.4",
105
105
  "webpack-merge": "^5.9.0",
106
106
  "workbox-build": "^7.0.0"
107
107
  },
@@ -121,5 +121,5 @@
121
121
  "engines": {
122
122
  "node": ">=16"
123
123
  },
124
- "gitHead": "e3e150f85429c7def79c2d466b058d26ed0b02e7"
124
+ "gitHead": "f37af7316c3f4e9dba78deea6d4b6df824fafe33"
125
125
  }
@@ -83,8 +83,8 @@ function cssLoader() {
83
83
  }, 'sass-loader', {
84
84
  implementation: requireModule.resolve('sass'),
85
85
  sassOptions: Object.assign({
86
- includePaths: BalmJS.file.stylePaths,
87
- outputStyle: 'expanded',
86
+ loadPaths: BalmJS.file.stylePaths,
87
+ sourceMap: true,
88
88
  quietDeps: BalmJS.config.logs.level < BalmJS.LogLevel.Warn
89
89
  }, BalmJS.config.styles.sassOptions)
90
90
  }),
@@ -22,36 +22,37 @@ function inlineSources(sourcemap) {
22
22
  return sourcemap;
23
23
  }, () => sourcemap);
24
24
  }
25
- function renderLess(str, opts) {
25
+ function renderLess(input, options) {
26
26
  return new Promise((resolve, reject) => {
27
- less.render(str, opts, (err, res) => {
28
- if (err) {
29
- reject(err);
27
+ less.render(input, options, (error, output) => {
28
+ if (error) {
29
+ reject(error);
30
30
  }
31
31
  else {
32
- const obj = {
33
- result: res.css,
34
- imports: res.imports
32
+ const { css, imports } = output;
33
+ const result = {
34
+ css,
35
+ imports
35
36
  };
36
- if (opts.sourceMap && res.map) {
37
- obj.sourcemap = JSON.parse(res.map);
38
- inlineSources(obj.sourcemap).then((map) => {
39
- obj.sourcemap = map;
40
- resolve(obj);
37
+ if (options.sourceMap && output.map) {
38
+ result.sourcemap = JSON.parse(output.map);
39
+ inlineSources(result.sourcemap).then((map) => {
40
+ result.sourcemap = map;
41
+ resolve(result);
41
42
  });
42
43
  }
43
44
  else {
44
- resolve(obj);
45
+ resolve(result);
45
46
  }
46
47
  }
47
48
  });
48
49
  });
49
50
  }
50
- function gulpLess(options) {
51
- const opts = Object.assign({}, {
51
+ function gulpLess(customOptions) {
52
+ const options = Object.assign({}, {
52
53
  compress: false,
53
54
  paths: []
54
- }, options);
55
+ }, customOptions);
55
56
  return through2.obj((file, enc, cb) => {
56
57
  if (file.isNull()) {
57
58
  return cb(null, file);
@@ -59,19 +60,19 @@ function gulpLess(options) {
59
60
  if (file.isStream()) {
60
61
  return cb(new PluginError(PLUGIN_NAME, 'Streaming not supported'));
61
62
  }
62
- const str = file.contents.toString();
63
- opts.filename = file.path;
64
- if (file.sourceMap || opts.sourcemap) {
65
- opts.sourceMap = true;
63
+ const input = file.contents.toString();
64
+ options.filename = file.path;
65
+ if (file.sourceMap || options.sourcemap) {
66
+ options.sourceMap = true;
66
67
  }
67
- renderLess(str, opts)
68
- .then((res) => {
69
- file.contents = Buffer.from(res.result);
68
+ renderLess(input, options)
69
+ .then((output) => {
70
+ file.contents = Buffer.from(output.css);
70
71
  file.path = replaceExtension(file.path, '.css');
71
- if (res.sourcemap) {
72
- res.sourcemap.file = file.relative;
73
- res.sourcemap.sources = res.sourcemap.sources.map((source) => node.path.relative(file.base, source));
74
- applySourceMap(file, res.sourcemap);
72
+ if (output.sourcemap) {
73
+ output.sourcemap.file = file.relative;
74
+ output.sourcemap.sources = output.sourcemap.sources.map((source) => node.path.relative(file.base, source));
75
+ applySourceMap(file, output.sourcemap);
75
76
  }
76
77
  return file;
77
78
  })
@@ -103,7 +103,7 @@ export default gulpPostcss((loadConfig) => {
103
103
  error = `${error.message}\n\n${error.showSourceCode()}\n`;
104
104
  }
105
105
  setImmediate(function () {
106
- cb(new PluginError('gulp-postcss', error, errorOptions));
106
+ cb(new PluginError(PLUGIN_NAME, error, errorOptions));
107
107
  });
108
108
  }
109
109
  };
@@ -8,32 +8,25 @@ import applySourceMap from 'vinyl-sourcemaps-apply';
8
8
  import ansiColors from 'ansi-colors';
9
9
  process.env.BALM_CWD = process.env.INIT_CWD || process.cwd();
10
10
  const localSassModule = path.join(process.env.BALM_ROOT || process.env.BALM_CWD, 'node_modules', 'sass');
11
- const newLocalSassModule = path.join(localSassModule, 'sass.default.js');
12
- const oldLocalSassModule = path.join(localSassModule, 'sass.dart.js');
13
- const sassModule = fs.existsSync(newLocalSassModule)
14
- ? requireModule(newLocalSassModule)
15
- : fs.existsSync(oldLocalSassModule)
16
- ? requireModule(oldLocalSassModule)
17
- : sass;
11
+ const nodeLocalSassModule = path.join(localSassModule, 'sass.node.js');
12
+ const defaultLocalSassModule = path.join(localSassModule, 'sass.default.js');
13
+ const dartLocalSassModule = path.join(localSassModule, 'sass.dart.js');
14
+ const sassModule = fs.existsSync(nodeLocalSassModule)
15
+ ? requireModule(nodeLocalSassModule)
16
+ : fs.existsSync(defaultLocalSassModule)
17
+ ? requireModule(defaultLocalSassModule)
18
+ : fs.existsSync(dartLocalSassModule)
19
+ ? requireModule(dartLocalSassModule)
20
+ : sass;
18
21
  const PLUGIN_NAME = 'sass';
19
22
  const transformObj = (transform) => new Transform({ transform, objectMode: true });
20
- const filePush = (file, sassObject, callback) => {
21
- if (sassObject.map) {
22
- const sassMap = JSON.parse(sassObject.map.toString());
23
- const sassMapFile = sassMap.file.replace(/^stdout$/, 'stdin');
24
- const sassFileSrc = file.relative;
25
- const sassFileSrcPath = node.path.dirname(sassFileSrc);
26
- if (sassFileSrcPath) {
27
- const sourceFileIndex = sassMap.sources.indexOf(sassMapFile);
28
- sassMap.sources = sassMap.sources.map((source, index) => index === sourceFileIndex
29
- ? source
30
- : node.path.join(sassFileSrcPath, source));
31
- }
32
- sassMap.sources = sassMap.sources.filter((src) => src !== 'stdin' && src);
33
- sassMap.file = replaceExtension(sassFileSrc, '.css');
23
+ const filePush = (file, result, callback) => {
24
+ if (result.sourceMap) {
25
+ const sassMap = result.sourceMap;
26
+ sassMap.file = replaceExtension(file.relative, '.css');
34
27
  applySourceMap(file, sassMap);
35
28
  }
36
- file.contents = sassObject.css;
29
+ file.contents = Buffer.from(result.css);
37
30
  file.path = replaceExtension(file.path, '.css');
38
31
  if (file.stat) {
39
32
  file.stat.atime = file.stat.mtime = file.stat.ctime = new Date();
@@ -41,61 +34,31 @@ const filePush = (file, sassObject, callback) => {
41
34
  callback(null, file);
42
35
  };
43
36
  const handleError = (error, file, callback) => {
44
- const filePath = ((error.file === 'stdin' ? file.path : error.file) ||
45
- file.path);
46
- const relativePath = node.path.relative(process.cwd(), filePath);
47
- const message = `${ansiColors.underline(relativePath)}\n${error.formatted}`;
48
- error.messageFormatted = message;
49
- error.messageOriginal = error.message;
37
+ const relativePath = node.path.relative(process.cwd(), file.path);
38
+ const message = `${ansiColors.underline(relativePath)}\n${error.message}`;
50
39
  error.message = stripAnsi(message);
51
- error.relativePath = relativePath;
52
40
  return callback(new PluginError(PLUGIN_NAME, error));
53
41
  };
54
42
  const gulpSass = (options) => transformObj((file, encoding, callback) => {
55
43
  if (file.isNull()) {
56
- callback(null, file);
57
- return;
44
+ return callback(null, file);
58
45
  }
59
46
  if (file.isStream()) {
60
- callback(new PluginError(PLUGIN_NAME, 'Streaming not supported'));
61
- return;
47
+ return callback(new PluginError(PLUGIN_NAME, 'Streaming not supported'));
62
48
  }
63
49
  if (node.path.basename(file.path).startsWith('_')) {
64
- callback();
65
- return;
50
+ return callback();
66
51
  }
67
52
  if (!file.contents.length) {
68
53
  file.path = replaceExtension(file.path, '.css');
69
- callback(null, file);
70
- return;
71
- }
72
- const opts = (options || {});
73
- opts.data = file.contents.toString();
74
- opts.file = file.path;
75
- if (node.path.extname(file.path) === '.sass') {
76
- opts.indentedSyntax = true;
77
- }
78
- if (opts.includePaths) {
79
- if (typeof opts.includePaths === 'string') {
80
- opts.includePaths = [opts.includePaths];
81
- }
82
- }
83
- else {
84
- opts.includePaths = [];
85
- }
86
- opts.includePaths.unshift(node.path.dirname(file.path));
87
- if (file.sourceMap) {
88
- opts.sourceMap = file.path;
89
- opts.omitSourceMapUrl = true;
90
- opts.sourceMapContents = true;
54
+ return callback(null, file);
91
55
  }
56
+ const path = file.path;
92
57
  try {
93
- gulpSass.compiler &&
94
- filePush(file, gulpSass.compiler.renderSync(opts), callback);
58
+ filePush(file, sassModule.compile(path, options), callback);
95
59
  }
96
60
  catch (error) {
97
61
  handleError(error, file, callback);
98
62
  }
99
63
  });
100
- gulpSass.compiler = sassModule;
101
64
  export default gulpSass;
@@ -4,8 +4,8 @@ class SassTask extends BalmJS.BalmStyleTask {
4
4
  }
5
5
  get options() {
6
6
  return Object.assign({
7
- includePaths: BalmJS.file.stylePaths,
8
- outputStyle: 'expanded',
7
+ loadPaths: BalmJS.file.stylePaths,
8
+ sourceMap: true,
9
9
  quietDeps: BalmJS.config.logs.level < BalmJS.LogLevel.Warn
10
10
  }, BalmJS.config.styles.sassOptions, this.customOptions);
11
11
  }