balm-core 3.33.2 → 3.33.4
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 +5 -5
- package/package.json +2 -2
- package/tslib/plugins/sass.js +5 -5
package/lib/plugins/sass.js
CHANGED
|
@@ -126,17 +126,17 @@ var gulpSass = function gulpSass(options) {
|
|
|
126
126
|
// Create alias
|
|
127
127
|
if (!opts.importer) {
|
|
128
128
|
var aliasKeys = Object.keys(BalmJS.config.scripts.alias).filter(function (key) {
|
|
129
|
-
return
|
|
129
|
+
return /^@[a-z0-9-]{1,213}/.test(key);
|
|
130
130
|
});
|
|
131
131
|
if (aliasKeys.length) {
|
|
132
|
-
var aliasKeyRegex = new RegExp("^".concat(aliasKeys.join('|')));
|
|
132
|
+
var aliasKeyRegex = new RegExp("^(".concat(aliasKeys.join('|'), ")/"));
|
|
133
133
|
opts.importer = [function (url) {
|
|
134
134
|
var file = url;
|
|
135
135
|
var result = url.match(aliasKeyRegex);
|
|
136
|
-
var key = result ? result[
|
|
136
|
+
var key = result ? result[1] : null;
|
|
137
137
|
if (key) {
|
|
138
|
-
file = url.replace(
|
|
139
|
-
BalmJS.logger.debug("".concat(PLUGIN_NAME, " alias"), "".concat(
|
|
138
|
+
file = url.replace(key, BalmJS.config.scripts.alias[key]);
|
|
139
|
+
BalmJS.logger.debug("".concat(PLUGIN_NAME, " alias"), "".concat(key, " -> ").concat(url, " => ").concat(file));
|
|
140
140
|
}
|
|
141
141
|
return {
|
|
142
142
|
file: file
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "balm-core",
|
|
3
|
-
"version": "3.33.
|
|
3
|
+
"version": "3.33.4",
|
|
4
4
|
"description": "BalmJS compiler core",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"balm",
|
|
@@ -119,5 +119,5 @@
|
|
|
119
119
|
"engines": {
|
|
120
120
|
"node": ">=10.13.0"
|
|
121
121
|
},
|
|
122
|
-
"gitHead": "
|
|
122
|
+
"gitHead": "73e6c5363b8ca6954e36691cf026054cf4798e10"
|
|
123
123
|
}
|
package/tslib/plugins/sass.js
CHANGED
|
@@ -78,17 +78,17 @@ const gulpSass = (options) => transformObj((file, encoding, callback) => {
|
|
|
78
78
|
opts.sourceMapContents = true;
|
|
79
79
|
}
|
|
80
80
|
if (!opts.importer) {
|
|
81
|
-
const aliasKeys = Object.keys(BalmJS.config.scripts.alias).filter((key) =>
|
|
81
|
+
const aliasKeys = Object.keys(BalmJS.config.scripts.alias).filter((key) => /^@[a-z0-9-]{1,213}/.test(key));
|
|
82
82
|
if (aliasKeys.length) {
|
|
83
|
-
const aliasKeyRegex = new RegExp(
|
|
83
|
+
const aliasKeyRegex = new RegExp(`^(${aliasKeys.join('|')})/`);
|
|
84
84
|
opts.importer = [
|
|
85
85
|
function (url) {
|
|
86
86
|
let file = url;
|
|
87
87
|
const result = url.match(aliasKeyRegex);
|
|
88
|
-
const key = result ? result[
|
|
88
|
+
const key = result ? result[1] : null;
|
|
89
89
|
if (key) {
|
|
90
|
-
file = url.replace(
|
|
91
|
-
BalmJS.logger.debug(`${PLUGIN_NAME} alias`, `${
|
|
90
|
+
file = url.replace(key, BalmJS.config.scripts.alias[key]);
|
|
91
|
+
BalmJS.logger.debug(`${PLUGIN_NAME} alias`, `${key} -> ${url} => ${file}`);
|
|
92
92
|
}
|
|
93
93
|
return { file };
|
|
94
94
|
}
|