balm-core 4.15.1 → 4.16.2
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/README.md +1 -1
- package/lib/plugins/sass.js +8 -1
- package/package.json +6 -6
- package/tslib/plugins/sass.js +8 -1
package/README.md
CHANGED
|
@@ -68,7 +68,7 @@ You need to set up your development environment before you can do anything.
|
|
|
68
68
|
|
|
69
69
|
Install [Node.js® and npm](https://nodejs.org/en/download/) if they are not already on your machine.
|
|
70
70
|
|
|
71
|
-
> **Verify that you are running at least node `
|
|
71
|
+
> **Verify that you are running at least node `16`** by running `node -v` in a terminal/console window. Older versions maybe produce errors, but newer versions are fine.
|
|
72
72
|
|
|
73
73
|
You develop apps in the context of an [Balm workspace](https://balm.js.org/docs/guide/structure.html).
|
|
74
74
|
|
package/lib/plugins/sass.js
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import path from 'node:path';
|
|
2
|
+
import fs from 'node:fs';
|
|
1
3
|
// Reference `gulp-sass@5.1.0`
|
|
2
4
|
import { Transform } from 'node:stream';
|
|
3
5
|
import sass from 'sass';
|
|
@@ -5,6 +7,11 @@ import replaceExtension from 'replace-ext';
|
|
|
5
7
|
import stripAnsi from 'strip-ansi';
|
|
6
8
|
import applySourceMap from 'vinyl-sourcemaps-apply';
|
|
7
9
|
import ansiColors from 'ansi-colors';
|
|
10
|
+
|
|
11
|
+
// Just for `npm i -D sass@1.39.2`
|
|
12
|
+
process.env.BALM_CWD = process.env.INIT_CWD || process.cwd();
|
|
13
|
+
const localSassModule = path.join(process.env.BALM_ROOT || process.env.BALM_CWD, 'node_modules', 'sass', 'sass.dart.js');
|
|
14
|
+
const sassModule = fs.existsSync(localSassModule) ? requireModule(localSassModule) : sass;
|
|
8
15
|
const PLUGIN_NAME = 'sass';
|
|
9
16
|
const transformObj = transform => new Transform({
|
|
10
17
|
transform,
|
|
@@ -119,5 +126,5 @@ const gulpSass = options => transformObj((file, encoding, callback) => {
|
|
|
119
126
|
handleError(error, file, callback);
|
|
120
127
|
}
|
|
121
128
|
});
|
|
122
|
-
gulpSass.compiler =
|
|
129
|
+
gulpSass.compiler = sassModule;
|
|
123
130
|
export default gulpSass;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "balm-core",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.16.2",
|
|
4
4
|
"description": "BalmJS compiler core",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"balm",
|
|
@@ -81,17 +81,17 @@
|
|
|
81
81
|
"postcss-load-config": "^4.0.1",
|
|
82
82
|
"postcss-loader": "7.0.2",
|
|
83
83
|
"postcss-preset-env": "^8.0.1",
|
|
84
|
-
"pretty-bytes": "^6.
|
|
84
|
+
"pretty-bytes": "^6.1.0",
|
|
85
85
|
"readable-stream": "^4.3.0",
|
|
86
86
|
"replace-ext": "^2.0.0",
|
|
87
|
-
"rollup": "^3.
|
|
87
|
+
"rollup": "^3.14.0",
|
|
88
88
|
"rollup-plugin-terser": "^7.0.2",
|
|
89
89
|
"sass": "^1.58.0",
|
|
90
90
|
"sass-loader": "^13.2.0",
|
|
91
91
|
"ssh2": "^1.11.0",
|
|
92
92
|
"strip-ansi": "^7.0.1",
|
|
93
93
|
"style-loader": "^3.3.1",
|
|
94
|
-
"terser": "^5.16.
|
|
94
|
+
"terser": "^5.16.3",
|
|
95
95
|
"terser-webpack-plugin": "^5.3.6",
|
|
96
96
|
"through2": "^4.0.2",
|
|
97
97
|
"through2-concurrent": "^2.0.0",
|
|
@@ -118,7 +118,7 @@
|
|
|
118
118
|
"imagemin-svgo": "^9.0.0"
|
|
119
119
|
},
|
|
120
120
|
"engines": {
|
|
121
|
-
"node": ">=
|
|
121
|
+
"node": ">=16"
|
|
122
122
|
},
|
|
123
|
-
"gitHead": "
|
|
123
|
+
"gitHead": "186d40270f2d99db3328cbef69780d3777599e1a"
|
|
124
124
|
}
|
package/tslib/plugins/sass.js
CHANGED
|
@@ -1,9 +1,16 @@
|
|
|
1
|
+
import path from 'node:path';
|
|
2
|
+
import fs from 'node:fs';
|
|
1
3
|
import { Transform } from 'node:stream';
|
|
2
4
|
import sass from 'sass';
|
|
3
5
|
import replaceExtension from 'replace-ext';
|
|
4
6
|
import stripAnsi from 'strip-ansi';
|
|
5
7
|
import applySourceMap from 'vinyl-sourcemaps-apply';
|
|
6
8
|
import ansiColors from 'ansi-colors';
|
|
9
|
+
process.env.BALM_CWD = process.env.INIT_CWD || process.cwd();
|
|
10
|
+
const localSassModule = path.join(process.env.BALM_ROOT || process.env.BALM_CWD, 'node_modules', 'sass', 'sass.dart.js');
|
|
11
|
+
const sassModule = fs.existsSync(localSassModule)
|
|
12
|
+
? requireModule(localSassModule)
|
|
13
|
+
: sass;
|
|
7
14
|
const PLUGIN_NAME = 'sass';
|
|
8
15
|
const transformObj = (transform) => new Transform({ transform, objectMode: true });
|
|
9
16
|
const filePush = (file, sassObject, callback) => {
|
|
@@ -86,5 +93,5 @@ const gulpSass = (options) => transformObj((file, encoding, callback) => {
|
|
|
86
93
|
handleError(error, file, callback);
|
|
87
94
|
}
|
|
88
95
|
});
|
|
89
|
-
gulpSass.compiler =
|
|
96
|
+
gulpSass.compiler = sassModule;
|
|
90
97
|
export default gulpSass;
|