@parcel/transformer-stylus 2.8.3 → 2.8.4-nightly.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.
@@ -113,18 +113,12 @@ var _default = new (_plugin().Transformer)({
113
113
  async loadConfig({
114
114
  config
115
115
  }) {
116
- let configFile = await config.getConfig(['.stylusrc', '.stylusrc.js', '.stylusrc.cjs'], {
116
+ let configFile = await config.getConfig(['.stylusrc', '.stylusrc.js', '.stylusrc.cjs', '.stylusrc.mjs'], {
117
117
  packageKey: 'stylus'
118
118
  });
119
119
 
120
120
  if (configFile) {
121
- let isJavascript = _path().default.extname(configFile.filePath).endsWith('js');
122
-
123
- if (isJavascript) {
124
- config.invalidateOnStartup();
125
- } // Resolve relative paths from config file
126
-
127
-
121
+ // Resolve relative paths from config file
128
122
  if (configFile.contents.paths) {
129
123
  configFile.contents.paths = configFile.contents.paths.map(p => _path().default.resolve(_path().default.dirname(configFile.filePath), p));
130
124
  }
@@ -184,9 +178,13 @@ function attemptResolve(importedPath, filepath, asset, resolve, deps) {
184
178
  });
185
179
  deps.set(importedPath, (0, _utils().glob)(absoluteGlob, asset.fs, {
186
180
  onlyFiles: true
187
- }).then(entries => Promise.all(entries.map(entry => resolve(filepath, './' + _path().default.relative(_path().default.dirname(filepath), entry))))));
181
+ }).then(entries => Promise.all(entries.map(entry => resolve(filepath, './' + _path().default.relative(_path().default.dirname(filepath), entry), {
182
+ packageConditions: ['stylus', 'style']
183
+ })))));
188
184
  } else {
189
- deps.set(importedPath, resolve(filepath, importedPath));
185
+ deps.set(importedPath, resolve(filepath, importedPath, {
186
+ packageConditions: ['stylus', 'style']
187
+ }));
190
188
  }
191
189
  }
192
190
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@parcel/transformer-stylus",
3
- "version": "2.8.3",
3
+ "version": "2.8.4-nightly.0+7b79c6d",
4
4
  "license": "MIT",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -17,12 +17,12 @@
17
17
  "source": "src/StylusTransformer.js",
18
18
  "engines": {
19
19
  "node": ">= 12.0.0",
20
- "parcel": "^2.8.3"
20
+ "parcel": "2.8.4-nightly.0+7b79c6d"
21
21
  },
22
22
  "dependencies": {
23
- "@parcel/plugin": "2.8.3",
24
- "@parcel/utils": "2.8.3",
23
+ "@parcel/plugin": "2.8.4-nightly.0+7b79c6d",
24
+ "@parcel/utils": "2.8.4-nightly.0+7b79c6d",
25
25
  "stylus": "^0.55.0"
26
26
  },
27
- "gitHead": "349a6caf40ec8abb6a49fcae0765f8f8deb2073d"
27
+ "gitHead": "7b79c6d69ffabef89810a8db61e9abdeb70d6990"
28
28
  }
@@ -16,18 +16,13 @@ const URL_RE = /^(?:url\s*\(\s*)?['"]?(?:[#/]|(?:https?:)?\/\/)/i;
16
16
  export default (new Transformer({
17
17
  async loadConfig({config}) {
18
18
  let configFile = await config.getConfig(
19
- ['.stylusrc', '.stylusrc.js', '.stylusrc.cjs'],
19
+ ['.stylusrc', '.stylusrc.js', '.stylusrc.cjs', '.stylusrc.mjs'],
20
20
  {
21
21
  packageKey: 'stylus',
22
22
  },
23
23
  );
24
24
 
25
25
  if (configFile) {
26
- let isJavascript = path.extname(configFile.filePath).endsWith('js');
27
- if (isJavascript) {
28
- config.invalidateOnStartup();
29
- }
30
-
31
26
  // Resolve relative paths from config file
32
27
  if (configFile.contents.paths) {
33
28
  configFile.contents.paths = configFile.contents.paths.map(p =>
@@ -101,13 +96,21 @@ function attemptResolve(importedPath, filepath, asset, resolve, deps) {
101
96
  resolve(
102
97
  filepath,
103
98
  './' + path.relative(path.dirname(filepath), entry),
99
+ {
100
+ packageConditions: ['stylus', 'style'],
101
+ },
104
102
  ),
105
103
  ),
106
104
  ),
107
105
  ),
108
106
  );
109
107
  } else {
110
- deps.set(importedPath, resolve(filepath, importedPath));
108
+ deps.set(
109
+ importedPath,
110
+ resolve(filepath, importedPath, {
111
+ packageConditions: ['stylus', 'style'],
112
+ }),
113
+ );
111
114
  }
112
115
  }
113
116