balm-core 3.33.0 → 3.33.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.
@@ -131,13 +131,16 @@ var gulpSass = function gulpSass(options) {
131
131
  var _Object$entries$_i = (0, _slicedToArray2["default"])(_Object$entries[_i], 2),
132
132
  key = _Object$entries$_i[0],
133
133
  value = _Object$entries$_i[1];
134
- opts.importer.push(function (url, prev) {
135
- if (new RegExp("^".concat(key)).test(url)) {
136
- var importerPaths = url.split('/');
137
- importerPaths[0] = value;
138
- BalmJS.logger.debug("".concat(PLUGIN_NAME, " alias"), "".concat(key, " -> ").concat(importerPaths.join('/')));
134
+ opts.importer.push(function (url) {
135
+ if (url.startsWith(key)) {
136
+ var _file = url.replace(new RegExp("^".concat(key)), value);
137
+ BalmJS.logger.debug("".concat(PLUGIN_NAME, " alias"), "".concat(url, " -> ").concat(_file));
139
138
  return {
140
- file: importerPaths.join('/')
139
+ file: _file
140
+ };
141
+ } else {
142
+ return {
143
+ file: url
141
144
  };
142
145
  }
143
146
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "balm-core",
3
- "version": "3.33.0",
3
+ "version": "3.33.1",
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": "dd9c9c8d8d0e012c4c65d3fcaddb7455354b92c0"
122
+ "gitHead": "ecb3fa58e2a3a6811e3d07eb84c0f9e93b578aa4"
123
123
  }
@@ -80,14 +80,14 @@ const gulpSass = (options) => transformObj((file, encoding, callback) => {
80
80
  if (!opts.importer && Object.keys(BalmJS.config.scripts.alias).length) {
81
81
  opts.importer = [];
82
82
  for (const [key, value] of Object.entries(BalmJS.config.scripts.alias)) {
83
- opts.importer.push(function (url, prev) {
84
- if (new RegExp(`^${key}`).test(url)) {
85
- const importerPaths = url.split('/');
86
- importerPaths[0] = value;
87
- BalmJS.logger.debug(`${PLUGIN_NAME} alias`, `${key} -> ${importerPaths.join('/')}`);
88
- return {
89
- file: importerPaths.join('/')
90
- };
83
+ opts.importer.push(function (url) {
84
+ if (url.startsWith(key)) {
85
+ const file = url.replace(new RegExp(`^${key}`), value);
86
+ BalmJS.logger.debug(`${PLUGIN_NAME} alias`, `${url} -> ${file}`);
87
+ return { file };
88
+ }
89
+ else {
90
+ return { file: url };
91
91
  }
92
92
  });
93
93
  }