@parcel/transformer-less 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.
- package/lib/LessTransformer.js +3 -1
- package/lib/loadConfig.js +2 -10
- package/package.json +4 -4
- package/src/LessTransformer.js +3 -1
- package/src/loadConfig.js +2 -9
package/lib/LessTransformer.js
CHANGED
|
@@ -205,7 +205,9 @@ function resolvePathPlugin({
|
|
|
205
205
|
}
|
|
206
206
|
|
|
207
207
|
if (!contents) {
|
|
208
|
-
filePath = await resolve(asset.filePath, filename
|
|
208
|
+
filePath = await resolve(asset.filePath, filename, {
|
|
209
|
+
packageConditions: ['less', 'style']
|
|
210
|
+
});
|
|
209
211
|
contents = await asset.fs.readFile(filePath, 'utf8');
|
|
210
212
|
}
|
|
211
213
|
|
package/lib/loadConfig.js
CHANGED
|
@@ -20,7 +20,7 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
|
|
|
20
20
|
async function load({
|
|
21
21
|
config
|
|
22
22
|
}) {
|
|
23
|
-
let configFile = await config.getConfig(['.lessrc', '.lessrc.js', '.lessrc.cjs'], {
|
|
23
|
+
let configFile = await config.getConfig(['.lessrc', '.lessrc.js', '.lessrc.cjs', '.lessrc.mjs'], {
|
|
24
24
|
packageKey: 'less'
|
|
25
25
|
});
|
|
26
26
|
let configContents = {};
|
|
@@ -35,16 +35,8 @@ async function load({
|
|
|
35
35
|
|
|
36
36
|
|
|
37
37
|
configContents.rewriteUrls = 'all';
|
|
38
|
-
configContents.plugins = configContents.plugins || [];
|
|
39
|
-
|
|
40
|
-
let isDynamic = configFile && _path().default.extname(configFile.filePath) === '.js';
|
|
41
|
-
|
|
42
|
-
if (isDynamic) {
|
|
43
|
-
config.invalidateOnStartup();
|
|
44
|
-
}
|
|
45
|
-
|
|
38
|
+
configContents.plugins = configContents.plugins || [];
|
|
46
39
|
return {
|
|
47
|
-
isStatic: !isDynamic,
|
|
48
40
|
config: configContents
|
|
49
41
|
};
|
|
50
42
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@parcel/transformer-less",
|
|
3
|
-
"version": "2.8.
|
|
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/LessTransformer.js",
|
|
18
18
|
"engines": {
|
|
19
19
|
"node": ">= 12.0.0",
|
|
20
|
-
"parcel": "
|
|
20
|
+
"parcel": "2.8.4-nightly.0+7b79c6d"
|
|
21
21
|
},
|
|
22
22
|
"dependencies": {
|
|
23
|
-
"@parcel/plugin": "2.8.
|
|
23
|
+
"@parcel/plugin": "2.8.4-nightly.0+7b79c6d",
|
|
24
24
|
"@parcel/source-map": "^2.1.1",
|
|
25
25
|
"less": "^4.1.1"
|
|
26
26
|
},
|
|
27
|
-
"gitHead": "
|
|
27
|
+
"gitHead": "7b79c6d69ffabef89810a8db61e9abdeb70d6990"
|
|
28
28
|
}
|
package/src/LessTransformer.js
CHANGED
|
@@ -152,7 +152,9 @@ function resolvePathPlugin({asset, resolve}) {
|
|
|
152
152
|
}
|
|
153
153
|
|
|
154
154
|
if (!contents) {
|
|
155
|
-
filePath = await resolve(asset.filePath, filename
|
|
155
|
+
filePath = await resolve(asset.filePath, filename, {
|
|
156
|
+
packageConditions: ['less', 'style'],
|
|
157
|
+
});
|
|
156
158
|
contents = await asset.fs.readFile(filePath, 'utf8');
|
|
157
159
|
}
|
|
158
160
|
|
package/src/loadConfig.js
CHANGED
|
@@ -3,7 +3,6 @@ import type {Config} from '@parcel/types';
|
|
|
3
3
|
import path from 'path';
|
|
4
4
|
|
|
5
5
|
type ConfigResult = {|
|
|
6
|
-
isStatic: boolean,
|
|
7
6
|
config: any,
|
|
8
7
|
|};
|
|
9
8
|
|
|
@@ -13,7 +12,7 @@ export async function load({
|
|
|
13
12
|
config: Config,
|
|
14
13
|
|}): Promise<ConfigResult> {
|
|
15
14
|
let configFile = await config.getConfig(
|
|
16
|
-
['.lessrc', '.lessrc.js', '.lessrc.cjs'],
|
|
15
|
+
['.lessrc', '.lessrc.js', '.lessrc.cjs', '.lessrc.mjs'],
|
|
17
16
|
{
|
|
18
17
|
packageKey: 'less',
|
|
19
18
|
},
|
|
@@ -35,11 +34,5 @@ export async function load({
|
|
|
35
34
|
configContents.rewriteUrls = 'all';
|
|
36
35
|
configContents.plugins = configContents.plugins || [];
|
|
37
36
|
|
|
38
|
-
|
|
39
|
-
let isDynamic = configFile && path.extname(configFile.filePath) === '.js';
|
|
40
|
-
if (isDynamic) {
|
|
41
|
-
config.invalidateOnStartup();
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
return {isStatic: !isDynamic, config: configContents};
|
|
37
|
+
return {config: configContents};
|
|
45
38
|
}
|