@atlaspack/transformer-compiled-external 0.1.1-canary.4114 → 0.1.1-dev-swc44-3ef36b21e.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.
|
@@ -36,17 +36,7 @@ function findTargetSourcePositions(source, regex) {
|
|
|
36
36
|
return results;
|
|
37
37
|
}
|
|
38
38
|
exports.default = new plugin_1.Transformer({
|
|
39
|
-
|
|
40
|
-
return {
|
|
41
|
-
config: {
|
|
42
|
-
projectRoot: options.projectRoot,
|
|
43
|
-
},
|
|
44
|
-
conditions: {
|
|
45
|
-
codeMatch: [/\.compiled\.css$/.source],
|
|
46
|
-
},
|
|
47
|
-
};
|
|
48
|
-
},
|
|
49
|
-
async transform({ asset, config }) {
|
|
39
|
+
async transform({ asset, options }) {
|
|
50
40
|
let code = await asset.getCode();
|
|
51
41
|
if (code.indexOf('.compiled.css') < 0) {
|
|
52
42
|
// Early exit if no relevant files
|
|
@@ -59,7 +49,7 @@ exports.default = new plugin_1.Transformer({
|
|
|
59
49
|
continue;
|
|
60
50
|
if (asset.env.sourceMap) {
|
|
61
51
|
if (!map)
|
|
62
|
-
map = new source_map_1.default(
|
|
52
|
+
map = new source_map_1.default(options.projectRoot);
|
|
63
53
|
map.offsetColumns(match.line + 1, match.column + match.source.length, -match.source.length);
|
|
64
54
|
}
|
|
65
55
|
code = code.replace(match.source, '');
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaspack/transformer-compiled-external",
|
|
3
|
-
"version": "0.1.1-
|
|
3
|
+
"version": "0.1.1-dev-swc44-3ef36b21e.0",
|
|
4
4
|
"description": "Atlaspack transformer for handling external Compiled CSS imports (insourced from @compiled/parcel-transformer-external)",
|
|
5
5
|
"license": "(MIT OR Apache-2.0)",
|
|
6
6
|
"publishConfig": {
|
|
@@ -21,15 +21,15 @@
|
|
|
21
21
|
"src"
|
|
22
22
|
],
|
|
23
23
|
"dependencies": {
|
|
24
|
-
"@atlaspack/plugin": "2.14.
|
|
25
|
-
"@atlaspack/source-map": "3.2.1-
|
|
24
|
+
"@atlaspack/plugin": "2.14.46-dev-swc44-3ef36b21e.0",
|
|
25
|
+
"@atlaspack/source-map": "3.2.1-dev-swc44-3ef36b21e.0"
|
|
26
26
|
},
|
|
27
27
|
"devDependencies": {
|
|
28
|
-
"@atlaspack/types": "2.
|
|
28
|
+
"@atlaspack/types": "2.15.36-dev-swc44-3ef36b21e.0"
|
|
29
29
|
},
|
|
30
30
|
"type": "commonjs",
|
|
31
31
|
"scripts": {
|
|
32
32
|
"build:lib": "gulp build --gulpfile ../../../gulpfile.js --cwd ."
|
|
33
33
|
},
|
|
34
|
-
"gitHead": "
|
|
34
|
+
"gitHead": "3ef36b21e388934416729737de94a47adf5e6ca4"
|
|
35
35
|
}
|
|
@@ -48,17 +48,7 @@ function findTargetSourcePositions(
|
|
|
48
48
|
}
|
|
49
49
|
|
|
50
50
|
export default new Transformer({
|
|
51
|
-
|
|
52
|
-
return {
|
|
53
|
-
config: {
|
|
54
|
-
projectRoot: options.projectRoot,
|
|
55
|
-
},
|
|
56
|
-
conditions: {
|
|
57
|
-
codeMatch: [/\.compiled\.css$/.source],
|
|
58
|
-
},
|
|
59
|
-
};
|
|
60
|
-
},
|
|
61
|
-
async transform({asset, config}) {
|
|
51
|
+
async transform({asset, options}) {
|
|
62
52
|
let code = await asset.getCode();
|
|
63
53
|
|
|
64
54
|
if (code.indexOf('.compiled.css') < 0) {
|
|
@@ -76,7 +66,7 @@ export default new Transformer({
|
|
|
76
66
|
if (!specifierPath) continue;
|
|
77
67
|
|
|
78
68
|
if (asset.env.sourceMap) {
|
|
79
|
-
if (!map) map = new SourceMap(
|
|
69
|
+
if (!map) map = new SourceMap(options.projectRoot);
|
|
80
70
|
|
|
81
71
|
map.offsetColumns(
|
|
82
72
|
match.line + 1,
|