balm-core 4.27.0 → 4.27.1
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.
- package/lib/plugins/sass.js +8 -4
- package/package.json +2 -2
- package/tslib/plugins/sass.js +8 -3
package/lib/plugins/sass.js
CHANGED
|
@@ -3,15 +3,18 @@ import { pathToFileURL } from 'node:url';
|
|
|
3
3
|
// Reference `gulp-sass@5.1.0`
|
|
4
4
|
import { Transform } from 'node:stream';
|
|
5
5
|
import semver from 'semver';
|
|
6
|
-
import sass from 'sass';
|
|
6
|
+
import * as sass from 'sass';
|
|
7
7
|
import replaceExtension from 'replace-ext';
|
|
8
8
|
import stripAnsi from 'strip-ansi';
|
|
9
9
|
import applySourceMap from 'vinyl-sourcemaps-apply';
|
|
10
10
|
import ansiColors from 'ansi-colors';
|
|
11
11
|
process.env.BALM_CWD = process.env.INIT_CWD || process.cwd();
|
|
12
12
|
const localSassModule = node.path.join(process.env.BALM_CWD, 'node_modules', 'sass');
|
|
13
|
-
|
|
14
|
-
|
|
13
|
+
let isLegacy = false;
|
|
14
|
+
try {
|
|
15
|
+
const sassPkg = requireModule(node.path.join(localSassModule, 'package.json'));
|
|
16
|
+
isLegacy = semver.lt(sassPkg.version, '1.40.0');
|
|
17
|
+
} catch (_) {}
|
|
15
18
|
const nodeLocalSassModule = node.path.join(localSassModule, 'sass.node.js');
|
|
16
19
|
const defaultLocalSassModule = node.path.join(localSassModule, 'sass.default.js'); // For `npm i -D sass <= 1.62.1`
|
|
17
20
|
const dartLocalSassModule = node.path.join(localSassModule, 'sass.dart.js'); // For `npm i -D sass <= 1.39.2`
|
|
@@ -186,4 +189,5 @@ const gulpSass = options => transformObj((file, encoding, callback) => {
|
|
|
186
189
|
isLegacy ? legacyHandleError(error, file, callback) : handleError(error, file, callback);
|
|
187
190
|
}
|
|
188
191
|
});
|
|
189
|
-
export default gulpSass;
|
|
192
|
+
export default gulpSass;
|
|
193
|
+
export { isLegacy };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "balm-core",
|
|
3
|
-
"version": "4.27.
|
|
3
|
+
"version": "4.27.1",
|
|
4
4
|
"description": "BalmJS compiler core",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"balm",
|
|
@@ -130,5 +130,5 @@
|
|
|
130
130
|
"engines": {
|
|
131
131
|
"node": ">=18.12.0"
|
|
132
132
|
},
|
|
133
|
-
"gitHead": "
|
|
133
|
+
"gitHead": "3b39b1c09422d96576573ea6423a732741f27653"
|
|
134
134
|
}
|
package/tslib/plugins/sass.js
CHANGED
|
@@ -2,15 +2,19 @@ import fs from 'node:fs';
|
|
|
2
2
|
import { pathToFileURL } from 'node:url';
|
|
3
3
|
import { Transform } from 'node:stream';
|
|
4
4
|
import semver from 'semver';
|
|
5
|
-
import sass from 'sass';
|
|
5
|
+
import * as sass from 'sass';
|
|
6
6
|
import replaceExtension from 'replace-ext';
|
|
7
7
|
import stripAnsi from 'strip-ansi';
|
|
8
8
|
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 = node.path.join(process.env.BALM_CWD, 'node_modules', 'sass');
|
|
12
|
-
|
|
13
|
-
|
|
12
|
+
let isLegacy = false;
|
|
13
|
+
try {
|
|
14
|
+
const sassPkg = requireModule(node.path.join(localSassModule, 'package.json'));
|
|
15
|
+
isLegacy = semver.lt(sassPkg.version, '1.40.0');
|
|
16
|
+
}
|
|
17
|
+
catch (_) { }
|
|
14
18
|
const nodeLocalSassModule = node.path.join(localSassModule, 'sass.node.js');
|
|
15
19
|
const defaultLocalSassModule = node.path.join(localSassModule, 'sass.default.js');
|
|
16
20
|
const dartLocalSassModule = node.path.join(localSassModule, 'sass.dart.js');
|
|
@@ -164,3 +168,4 @@ const gulpSass = (options) => transformObj((file, encoding, callback) => {
|
|
|
164
168
|
}
|
|
165
169
|
});
|
|
166
170
|
export default gulpSass;
|
|
171
|
+
export { isLegacy };
|