@umijs/bundler-utils 4.0.1 → 4.0.2
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/compiled/babel/index.js +152 -152
- package/compiled/es-module-lexer/LICENSE +10 -10
- package/compiled/es-module-lexer/types/lexer.d.ts +86 -86
- package/package.json +3 -3
package/compiled/babel/index.js
CHANGED
|
@@ -116607,158 +116607,158 @@ module.exports = function (fromModel) {
|
|
|
116607
116607
|
/***/ (function(module) {
|
|
116608
116608
|
|
|
116609
116609
|
"use strict";
|
|
116610
|
-
|
|
116611
|
-
|
|
116612
|
-
module.exports = {
|
|
116613
|
-
"aliceblue": [240, 248, 255],
|
|
116614
|
-
"antiquewhite": [250, 235, 215],
|
|
116615
|
-
"aqua": [0, 255, 255],
|
|
116616
|
-
"aquamarine": [127, 255, 212],
|
|
116617
|
-
"azure": [240, 255, 255],
|
|
116618
|
-
"beige": [245, 245, 220],
|
|
116619
|
-
"bisque": [255, 228, 196],
|
|
116620
|
-
"black": [0, 0, 0],
|
|
116621
|
-
"blanchedalmond": [255, 235, 205],
|
|
116622
|
-
"blue": [0, 0, 255],
|
|
116623
|
-
"blueviolet": [138, 43, 226],
|
|
116624
|
-
"brown": [165, 42, 42],
|
|
116625
|
-
"burlywood": [222, 184, 135],
|
|
116626
|
-
"cadetblue": [95, 158, 160],
|
|
116627
|
-
"chartreuse": [127, 255, 0],
|
|
116628
|
-
"chocolate": [210, 105, 30],
|
|
116629
|
-
"coral": [255, 127, 80],
|
|
116630
|
-
"cornflowerblue": [100, 149, 237],
|
|
116631
|
-
"cornsilk": [255, 248, 220],
|
|
116632
|
-
"crimson": [220, 20, 60],
|
|
116633
|
-
"cyan": [0, 255, 255],
|
|
116634
|
-
"darkblue": [0, 0, 139],
|
|
116635
|
-
"darkcyan": [0, 139, 139],
|
|
116636
|
-
"darkgoldenrod": [184, 134, 11],
|
|
116637
|
-
"darkgray": [169, 169, 169],
|
|
116638
|
-
"darkgreen": [0, 100, 0],
|
|
116639
|
-
"darkgrey": [169, 169, 169],
|
|
116640
|
-
"darkkhaki": [189, 183, 107],
|
|
116641
|
-
"darkmagenta": [139, 0, 139],
|
|
116642
|
-
"darkolivegreen": [85, 107, 47],
|
|
116643
|
-
"darkorange": [255, 140, 0],
|
|
116644
|
-
"darkorchid": [153, 50, 204],
|
|
116645
|
-
"darkred": [139, 0, 0],
|
|
116646
|
-
"darksalmon": [233, 150, 122],
|
|
116647
|
-
"darkseagreen": [143, 188, 143],
|
|
116648
|
-
"darkslateblue": [72, 61, 139],
|
|
116649
|
-
"darkslategray": [47, 79, 79],
|
|
116650
|
-
"darkslategrey": [47, 79, 79],
|
|
116651
|
-
"darkturquoise": [0, 206, 209],
|
|
116652
|
-
"darkviolet": [148, 0, 211],
|
|
116653
|
-
"deeppink": [255, 20, 147],
|
|
116654
|
-
"deepskyblue": [0, 191, 255],
|
|
116655
|
-
"dimgray": [105, 105, 105],
|
|
116656
|
-
"dimgrey": [105, 105, 105],
|
|
116657
|
-
"dodgerblue": [30, 144, 255],
|
|
116658
|
-
"firebrick": [178, 34, 34],
|
|
116659
|
-
"floralwhite": [255, 250, 240],
|
|
116660
|
-
"forestgreen": [34, 139, 34],
|
|
116661
|
-
"fuchsia": [255, 0, 255],
|
|
116662
|
-
"gainsboro": [220, 220, 220],
|
|
116663
|
-
"ghostwhite": [248, 248, 255],
|
|
116664
|
-
"gold": [255, 215, 0],
|
|
116665
|
-
"goldenrod": [218, 165, 32],
|
|
116666
|
-
"gray": [128, 128, 128],
|
|
116667
|
-
"green": [0, 128, 0],
|
|
116668
|
-
"greenyellow": [173, 255, 47],
|
|
116669
|
-
"grey": [128, 128, 128],
|
|
116670
|
-
"honeydew": [240, 255, 240],
|
|
116671
|
-
"hotpink": [255, 105, 180],
|
|
116672
|
-
"indianred": [205, 92, 92],
|
|
116673
|
-
"indigo": [75, 0, 130],
|
|
116674
|
-
"ivory": [255, 255, 240],
|
|
116675
|
-
"khaki": [240, 230, 140],
|
|
116676
|
-
"lavender": [230, 230, 250],
|
|
116677
|
-
"lavenderblush": [255, 240, 245],
|
|
116678
|
-
"lawngreen": [124, 252, 0],
|
|
116679
|
-
"lemonchiffon": [255, 250, 205],
|
|
116680
|
-
"lightblue": [173, 216, 230],
|
|
116681
|
-
"lightcoral": [240, 128, 128],
|
|
116682
|
-
"lightcyan": [224, 255, 255],
|
|
116683
|
-
"lightgoldenrodyellow": [250, 250, 210],
|
|
116684
|
-
"lightgray": [211, 211, 211],
|
|
116685
|
-
"lightgreen": [144, 238, 144],
|
|
116686
|
-
"lightgrey": [211, 211, 211],
|
|
116687
|
-
"lightpink": [255, 182, 193],
|
|
116688
|
-
"lightsalmon": [255, 160, 122],
|
|
116689
|
-
"lightseagreen": [32, 178, 170],
|
|
116690
|
-
"lightskyblue": [135, 206, 250],
|
|
116691
|
-
"lightslategray": [119, 136, 153],
|
|
116692
|
-
"lightslategrey": [119, 136, 153],
|
|
116693
|
-
"lightsteelblue": [176, 196, 222],
|
|
116694
|
-
"lightyellow": [255, 255, 224],
|
|
116695
|
-
"lime": [0, 255, 0],
|
|
116696
|
-
"limegreen": [50, 205, 50],
|
|
116697
|
-
"linen": [250, 240, 230],
|
|
116698
|
-
"magenta": [255, 0, 255],
|
|
116699
|
-
"maroon": [128, 0, 0],
|
|
116700
|
-
"mediumaquamarine": [102, 205, 170],
|
|
116701
|
-
"mediumblue": [0, 0, 205],
|
|
116702
|
-
"mediumorchid": [186, 85, 211],
|
|
116703
|
-
"mediumpurple": [147, 112, 219],
|
|
116704
|
-
"mediumseagreen": [60, 179, 113],
|
|
116705
|
-
"mediumslateblue": [123, 104, 238],
|
|
116706
|
-
"mediumspringgreen": [0, 250, 154],
|
|
116707
|
-
"mediumturquoise": [72, 209, 204],
|
|
116708
|
-
"mediumvioletred": [199, 21, 133],
|
|
116709
|
-
"midnightblue": [25, 25, 112],
|
|
116710
|
-
"mintcream": [245, 255, 250],
|
|
116711
|
-
"mistyrose": [255, 228, 225],
|
|
116712
|
-
"moccasin": [255, 228, 181],
|
|
116713
|
-
"navajowhite": [255, 222, 173],
|
|
116714
|
-
"navy": [0, 0, 128],
|
|
116715
|
-
"oldlace": [253, 245, 230],
|
|
116716
|
-
"olive": [128, 128, 0],
|
|
116717
|
-
"olivedrab": [107, 142, 35],
|
|
116718
|
-
"orange": [255, 165, 0],
|
|
116719
|
-
"orangered": [255, 69, 0],
|
|
116720
|
-
"orchid": [218, 112, 214],
|
|
116721
|
-
"palegoldenrod": [238, 232, 170],
|
|
116722
|
-
"palegreen": [152, 251, 152],
|
|
116723
|
-
"paleturquoise": [175, 238, 238],
|
|
116724
|
-
"palevioletred": [219, 112, 147],
|
|
116725
|
-
"papayawhip": [255, 239, 213],
|
|
116726
|
-
"peachpuff": [255, 218, 185],
|
|
116727
|
-
"peru": [205, 133, 63],
|
|
116728
|
-
"pink": [255, 192, 203],
|
|
116729
|
-
"plum": [221, 160, 221],
|
|
116730
|
-
"powderblue": [176, 224, 230],
|
|
116731
|
-
"purple": [128, 0, 128],
|
|
116732
|
-
"rebeccapurple": [102, 51, 153],
|
|
116733
|
-
"red": [255, 0, 0],
|
|
116734
|
-
"rosybrown": [188, 143, 143],
|
|
116735
|
-
"royalblue": [65, 105, 225],
|
|
116736
|
-
"saddlebrown": [139, 69, 19],
|
|
116737
|
-
"salmon": [250, 128, 114],
|
|
116738
|
-
"sandybrown": [244, 164, 96],
|
|
116739
|
-
"seagreen": [46, 139, 87],
|
|
116740
|
-
"seashell": [255, 245, 238],
|
|
116741
|
-
"sienna": [160, 82, 45],
|
|
116742
|
-
"silver": [192, 192, 192],
|
|
116743
|
-
"skyblue": [135, 206, 235],
|
|
116744
|
-
"slateblue": [106, 90, 205],
|
|
116745
|
-
"slategray": [112, 128, 144],
|
|
116746
|
-
"slategrey": [112, 128, 144],
|
|
116747
|
-
"snow": [255, 250, 250],
|
|
116748
|
-
"springgreen": [0, 255, 127],
|
|
116749
|
-
"steelblue": [70, 130, 180],
|
|
116750
|
-
"tan": [210, 180, 140],
|
|
116751
|
-
"teal": [0, 128, 128],
|
|
116752
|
-
"thistle": [216, 191, 216],
|
|
116753
|
-
"tomato": [255, 99, 71],
|
|
116754
|
-
"turquoise": [64, 224, 208],
|
|
116755
|
-
"violet": [238, 130, 238],
|
|
116756
|
-
"wheat": [245, 222, 179],
|
|
116757
|
-
"white": [255, 255, 255],
|
|
116758
|
-
"whitesmoke": [245, 245, 245],
|
|
116759
|
-
"yellow": [255, 255, 0],
|
|
116760
|
-
"yellowgreen": [154, 205, 50]
|
|
116761
|
-
};
|
|
116610
|
+
|
|
116611
|
+
|
|
116612
|
+
module.exports = {
|
|
116613
|
+
"aliceblue": [240, 248, 255],
|
|
116614
|
+
"antiquewhite": [250, 235, 215],
|
|
116615
|
+
"aqua": [0, 255, 255],
|
|
116616
|
+
"aquamarine": [127, 255, 212],
|
|
116617
|
+
"azure": [240, 255, 255],
|
|
116618
|
+
"beige": [245, 245, 220],
|
|
116619
|
+
"bisque": [255, 228, 196],
|
|
116620
|
+
"black": [0, 0, 0],
|
|
116621
|
+
"blanchedalmond": [255, 235, 205],
|
|
116622
|
+
"blue": [0, 0, 255],
|
|
116623
|
+
"blueviolet": [138, 43, 226],
|
|
116624
|
+
"brown": [165, 42, 42],
|
|
116625
|
+
"burlywood": [222, 184, 135],
|
|
116626
|
+
"cadetblue": [95, 158, 160],
|
|
116627
|
+
"chartreuse": [127, 255, 0],
|
|
116628
|
+
"chocolate": [210, 105, 30],
|
|
116629
|
+
"coral": [255, 127, 80],
|
|
116630
|
+
"cornflowerblue": [100, 149, 237],
|
|
116631
|
+
"cornsilk": [255, 248, 220],
|
|
116632
|
+
"crimson": [220, 20, 60],
|
|
116633
|
+
"cyan": [0, 255, 255],
|
|
116634
|
+
"darkblue": [0, 0, 139],
|
|
116635
|
+
"darkcyan": [0, 139, 139],
|
|
116636
|
+
"darkgoldenrod": [184, 134, 11],
|
|
116637
|
+
"darkgray": [169, 169, 169],
|
|
116638
|
+
"darkgreen": [0, 100, 0],
|
|
116639
|
+
"darkgrey": [169, 169, 169],
|
|
116640
|
+
"darkkhaki": [189, 183, 107],
|
|
116641
|
+
"darkmagenta": [139, 0, 139],
|
|
116642
|
+
"darkolivegreen": [85, 107, 47],
|
|
116643
|
+
"darkorange": [255, 140, 0],
|
|
116644
|
+
"darkorchid": [153, 50, 204],
|
|
116645
|
+
"darkred": [139, 0, 0],
|
|
116646
|
+
"darksalmon": [233, 150, 122],
|
|
116647
|
+
"darkseagreen": [143, 188, 143],
|
|
116648
|
+
"darkslateblue": [72, 61, 139],
|
|
116649
|
+
"darkslategray": [47, 79, 79],
|
|
116650
|
+
"darkslategrey": [47, 79, 79],
|
|
116651
|
+
"darkturquoise": [0, 206, 209],
|
|
116652
|
+
"darkviolet": [148, 0, 211],
|
|
116653
|
+
"deeppink": [255, 20, 147],
|
|
116654
|
+
"deepskyblue": [0, 191, 255],
|
|
116655
|
+
"dimgray": [105, 105, 105],
|
|
116656
|
+
"dimgrey": [105, 105, 105],
|
|
116657
|
+
"dodgerblue": [30, 144, 255],
|
|
116658
|
+
"firebrick": [178, 34, 34],
|
|
116659
|
+
"floralwhite": [255, 250, 240],
|
|
116660
|
+
"forestgreen": [34, 139, 34],
|
|
116661
|
+
"fuchsia": [255, 0, 255],
|
|
116662
|
+
"gainsboro": [220, 220, 220],
|
|
116663
|
+
"ghostwhite": [248, 248, 255],
|
|
116664
|
+
"gold": [255, 215, 0],
|
|
116665
|
+
"goldenrod": [218, 165, 32],
|
|
116666
|
+
"gray": [128, 128, 128],
|
|
116667
|
+
"green": [0, 128, 0],
|
|
116668
|
+
"greenyellow": [173, 255, 47],
|
|
116669
|
+
"grey": [128, 128, 128],
|
|
116670
|
+
"honeydew": [240, 255, 240],
|
|
116671
|
+
"hotpink": [255, 105, 180],
|
|
116672
|
+
"indianred": [205, 92, 92],
|
|
116673
|
+
"indigo": [75, 0, 130],
|
|
116674
|
+
"ivory": [255, 255, 240],
|
|
116675
|
+
"khaki": [240, 230, 140],
|
|
116676
|
+
"lavender": [230, 230, 250],
|
|
116677
|
+
"lavenderblush": [255, 240, 245],
|
|
116678
|
+
"lawngreen": [124, 252, 0],
|
|
116679
|
+
"lemonchiffon": [255, 250, 205],
|
|
116680
|
+
"lightblue": [173, 216, 230],
|
|
116681
|
+
"lightcoral": [240, 128, 128],
|
|
116682
|
+
"lightcyan": [224, 255, 255],
|
|
116683
|
+
"lightgoldenrodyellow": [250, 250, 210],
|
|
116684
|
+
"lightgray": [211, 211, 211],
|
|
116685
|
+
"lightgreen": [144, 238, 144],
|
|
116686
|
+
"lightgrey": [211, 211, 211],
|
|
116687
|
+
"lightpink": [255, 182, 193],
|
|
116688
|
+
"lightsalmon": [255, 160, 122],
|
|
116689
|
+
"lightseagreen": [32, 178, 170],
|
|
116690
|
+
"lightskyblue": [135, 206, 250],
|
|
116691
|
+
"lightslategray": [119, 136, 153],
|
|
116692
|
+
"lightslategrey": [119, 136, 153],
|
|
116693
|
+
"lightsteelblue": [176, 196, 222],
|
|
116694
|
+
"lightyellow": [255, 255, 224],
|
|
116695
|
+
"lime": [0, 255, 0],
|
|
116696
|
+
"limegreen": [50, 205, 50],
|
|
116697
|
+
"linen": [250, 240, 230],
|
|
116698
|
+
"magenta": [255, 0, 255],
|
|
116699
|
+
"maroon": [128, 0, 0],
|
|
116700
|
+
"mediumaquamarine": [102, 205, 170],
|
|
116701
|
+
"mediumblue": [0, 0, 205],
|
|
116702
|
+
"mediumorchid": [186, 85, 211],
|
|
116703
|
+
"mediumpurple": [147, 112, 219],
|
|
116704
|
+
"mediumseagreen": [60, 179, 113],
|
|
116705
|
+
"mediumslateblue": [123, 104, 238],
|
|
116706
|
+
"mediumspringgreen": [0, 250, 154],
|
|
116707
|
+
"mediumturquoise": [72, 209, 204],
|
|
116708
|
+
"mediumvioletred": [199, 21, 133],
|
|
116709
|
+
"midnightblue": [25, 25, 112],
|
|
116710
|
+
"mintcream": [245, 255, 250],
|
|
116711
|
+
"mistyrose": [255, 228, 225],
|
|
116712
|
+
"moccasin": [255, 228, 181],
|
|
116713
|
+
"navajowhite": [255, 222, 173],
|
|
116714
|
+
"navy": [0, 0, 128],
|
|
116715
|
+
"oldlace": [253, 245, 230],
|
|
116716
|
+
"olive": [128, 128, 0],
|
|
116717
|
+
"olivedrab": [107, 142, 35],
|
|
116718
|
+
"orange": [255, 165, 0],
|
|
116719
|
+
"orangered": [255, 69, 0],
|
|
116720
|
+
"orchid": [218, 112, 214],
|
|
116721
|
+
"palegoldenrod": [238, 232, 170],
|
|
116722
|
+
"palegreen": [152, 251, 152],
|
|
116723
|
+
"paleturquoise": [175, 238, 238],
|
|
116724
|
+
"palevioletred": [219, 112, 147],
|
|
116725
|
+
"papayawhip": [255, 239, 213],
|
|
116726
|
+
"peachpuff": [255, 218, 185],
|
|
116727
|
+
"peru": [205, 133, 63],
|
|
116728
|
+
"pink": [255, 192, 203],
|
|
116729
|
+
"plum": [221, 160, 221],
|
|
116730
|
+
"powderblue": [176, 224, 230],
|
|
116731
|
+
"purple": [128, 0, 128],
|
|
116732
|
+
"rebeccapurple": [102, 51, 153],
|
|
116733
|
+
"red": [255, 0, 0],
|
|
116734
|
+
"rosybrown": [188, 143, 143],
|
|
116735
|
+
"royalblue": [65, 105, 225],
|
|
116736
|
+
"saddlebrown": [139, 69, 19],
|
|
116737
|
+
"salmon": [250, 128, 114],
|
|
116738
|
+
"sandybrown": [244, 164, 96],
|
|
116739
|
+
"seagreen": [46, 139, 87],
|
|
116740
|
+
"seashell": [255, 245, 238],
|
|
116741
|
+
"sienna": [160, 82, 45],
|
|
116742
|
+
"silver": [192, 192, 192],
|
|
116743
|
+
"skyblue": [135, 206, 235],
|
|
116744
|
+
"slateblue": [106, 90, 205],
|
|
116745
|
+
"slategray": [112, 128, 144],
|
|
116746
|
+
"slategrey": [112, 128, 144],
|
|
116747
|
+
"snow": [255, 250, 250],
|
|
116748
|
+
"springgreen": [0, 255, 127],
|
|
116749
|
+
"steelblue": [70, 130, 180],
|
|
116750
|
+
"tan": [210, 180, 140],
|
|
116751
|
+
"teal": [0, 128, 128],
|
|
116752
|
+
"thistle": [216, 191, 216],
|
|
116753
|
+
"tomato": [255, 99, 71],
|
|
116754
|
+
"turquoise": [64, 224, 208],
|
|
116755
|
+
"violet": [238, 130, 238],
|
|
116756
|
+
"wheat": [245, 222, 179],
|
|
116757
|
+
"white": [255, 255, 255],
|
|
116758
|
+
"whitesmoke": [245, 245, 245],
|
|
116759
|
+
"yellow": [255, 255, 0],
|
|
116760
|
+
"yellowgreen": [154, 205, 50]
|
|
116761
|
+
};
|
|
116762
116762
|
|
|
116763
116763
|
|
|
116764
116764
|
/***/ }),
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
-----------
|
|
3
|
-
|
|
4
|
-
Copyright (C) 2018-2022 Guy Bedford
|
|
5
|
-
|
|
6
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
7
|
-
|
|
8
|
-
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
|
9
|
-
|
|
10
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
1
|
+
MIT License
|
|
2
|
+
-----------
|
|
3
|
+
|
|
4
|
+
Copyright (C) 2018-2022 Guy Bedford
|
|
5
|
+
|
|
6
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
7
|
+
|
|
8
|
+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
|
9
|
+
|
|
10
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
@@ -1,86 +1,86 @@
|
|
|
1
|
-
export interface ImportSpecifier {
|
|
2
|
-
/**
|
|
3
|
-
* Module name
|
|
4
|
-
*
|
|
5
|
-
* To handle escape sequences in specifier strings, the .n field of imported specifiers will be provided where possible.
|
|
6
|
-
*
|
|
7
|
-
* For dynamic import expressions, this field will be empty if not a valid JS string.
|
|
8
|
-
*
|
|
9
|
-
* @example
|
|
10
|
-
* const [imports1, exports1] = parse(String.raw`import './\u0061\u0062.js'`);
|
|
11
|
-
* imports1[0].n;
|
|
12
|
-
* // Returns "./ab.js"
|
|
13
|
-
*
|
|
14
|
-
* const [imports2, exports2] = parse(`import('./ab')`);
|
|
15
|
-
* imports2[0].n;
|
|
16
|
-
* // Returns "./ab.js"
|
|
17
|
-
*
|
|
18
|
-
* const [imports3, exports3] = parse(`import("./" + "ab.js")`);
|
|
19
|
-
* imports3[0].n;
|
|
20
|
-
* // Returns undefined
|
|
21
|
-
*/
|
|
22
|
-
readonly n: string | undefined;
|
|
23
|
-
/**
|
|
24
|
-
* Start of module specifier
|
|
25
|
-
*
|
|
26
|
-
* @example
|
|
27
|
-
* const source = `import { a } from('asdf')`;
|
|
28
|
-
* const [imports, exports] = parse(source);
|
|
29
|
-
* source.substring(imports[0].s, imports[0].e);
|
|
30
|
-
* // Returns "asdf"
|
|
31
|
-
*/
|
|
32
|
-
readonly s: number;
|
|
33
|
-
/**
|
|
34
|
-
* End of module specifier
|
|
35
|
-
*/
|
|
36
|
-
readonly e: number;
|
|
37
|
-
|
|
38
|
-
/**
|
|
39
|
-
* Start of import statement
|
|
40
|
-
*
|
|
41
|
-
* @example
|
|
42
|
-
* const source = `import { a } from('asdf')`;
|
|
43
|
-
* const [imports, exports] = parse(source);
|
|
44
|
-
* source.substring(imports[0].ss, imports[0].se);
|
|
45
|
-
* // Returns "import { a } from('asdf');"
|
|
46
|
-
*/
|
|
47
|
-
readonly ss: number;
|
|
48
|
-
/**
|
|
49
|
-
* End of import statement
|
|
50
|
-
*/
|
|
51
|
-
readonly se: number;
|
|
52
|
-
|
|
53
|
-
/**
|
|
54
|
-
* If this import statement is a dynamic import, this is the start value.
|
|
55
|
-
* Otherwise this is `-1`.
|
|
56
|
-
*/
|
|
57
|
-
readonly d: number;
|
|
58
|
-
|
|
59
|
-
/**
|
|
60
|
-
* If this import has an import assertion, this is the start value.
|
|
61
|
-
* Otherwise this is `-1`.
|
|
62
|
-
*/
|
|
63
|
-
readonly a: number;
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
/**
|
|
67
|
-
* Wait for init to resolve before calling `parse`.
|
|
68
|
-
*/
|
|
69
|
-
export const init: Promise<void>;
|
|
70
|
-
|
|
71
|
-
/**
|
|
72
|
-
* Outputs the list of exports and locations of import specifiers,
|
|
73
|
-
* including dynamic import and import meta handling.
|
|
74
|
-
*
|
|
75
|
-
* @param source Source code to parser
|
|
76
|
-
* @param name Optional sourcename
|
|
77
|
-
* @returns Tuple contaning imports list and exports list.
|
|
78
|
-
*/
|
|
79
|
-
export function parse(
|
|
80
|
-
source: string,
|
|
81
|
-
name?: string
|
|
82
|
-
): readonly [
|
|
83
|
-
imports: ReadonlyArray<ImportSpecifier>,
|
|
84
|
-
exports: ReadonlyArray<string>,
|
|
85
|
-
facade: boolean
|
|
86
|
-
];
|
|
1
|
+
export interface ImportSpecifier {
|
|
2
|
+
/**
|
|
3
|
+
* Module name
|
|
4
|
+
*
|
|
5
|
+
* To handle escape sequences in specifier strings, the .n field of imported specifiers will be provided where possible.
|
|
6
|
+
*
|
|
7
|
+
* For dynamic import expressions, this field will be empty if not a valid JS string.
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* const [imports1, exports1] = parse(String.raw`import './\u0061\u0062.js'`);
|
|
11
|
+
* imports1[0].n;
|
|
12
|
+
* // Returns "./ab.js"
|
|
13
|
+
*
|
|
14
|
+
* const [imports2, exports2] = parse(`import('./ab')`);
|
|
15
|
+
* imports2[0].n;
|
|
16
|
+
* // Returns "./ab.js"
|
|
17
|
+
*
|
|
18
|
+
* const [imports3, exports3] = parse(`import("./" + "ab.js")`);
|
|
19
|
+
* imports3[0].n;
|
|
20
|
+
* // Returns undefined
|
|
21
|
+
*/
|
|
22
|
+
readonly n: string | undefined;
|
|
23
|
+
/**
|
|
24
|
+
* Start of module specifier
|
|
25
|
+
*
|
|
26
|
+
* @example
|
|
27
|
+
* const source = `import { a } from('asdf')`;
|
|
28
|
+
* const [imports, exports] = parse(source);
|
|
29
|
+
* source.substring(imports[0].s, imports[0].e);
|
|
30
|
+
* // Returns "asdf"
|
|
31
|
+
*/
|
|
32
|
+
readonly s: number;
|
|
33
|
+
/**
|
|
34
|
+
* End of module specifier
|
|
35
|
+
*/
|
|
36
|
+
readonly e: number;
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* Start of import statement
|
|
40
|
+
*
|
|
41
|
+
* @example
|
|
42
|
+
* const source = `import { a } from('asdf')`;
|
|
43
|
+
* const [imports, exports] = parse(source);
|
|
44
|
+
* source.substring(imports[0].ss, imports[0].se);
|
|
45
|
+
* // Returns "import { a } from('asdf');"
|
|
46
|
+
*/
|
|
47
|
+
readonly ss: number;
|
|
48
|
+
/**
|
|
49
|
+
* End of import statement
|
|
50
|
+
*/
|
|
51
|
+
readonly se: number;
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* If this import statement is a dynamic import, this is the start value.
|
|
55
|
+
* Otherwise this is `-1`.
|
|
56
|
+
*/
|
|
57
|
+
readonly d: number;
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* If this import has an import assertion, this is the start value.
|
|
61
|
+
* Otherwise this is `-1`.
|
|
62
|
+
*/
|
|
63
|
+
readonly a: number;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
/**
|
|
67
|
+
* Wait for init to resolve before calling `parse`.
|
|
68
|
+
*/
|
|
69
|
+
export const init: Promise<void>;
|
|
70
|
+
|
|
71
|
+
/**
|
|
72
|
+
* Outputs the list of exports and locations of import specifiers,
|
|
73
|
+
* including dynamic import and import meta handling.
|
|
74
|
+
*
|
|
75
|
+
* @param source Source code to parser
|
|
76
|
+
* @param name Optional sourcename
|
|
77
|
+
* @returns Tuple contaning imports list and exports list.
|
|
78
|
+
*/
|
|
79
|
+
export function parse(
|
|
80
|
+
source: string,
|
|
81
|
+
name?: string
|
|
82
|
+
): readonly [
|
|
83
|
+
imports: ReadonlyArray<ImportSpecifier>,
|
|
84
|
+
exports: ReadonlyArray<string>,
|
|
85
|
+
facade: boolean
|
|
86
|
+
];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@umijs/bundler-utils",
|
|
3
|
-
"version": "4.0.
|
|
3
|
+
"version": "4.0.2",
|
|
4
4
|
"homepage": "https://github.com/umijs/umi-next/tree/master/packages/bundler-utils#readme",
|
|
5
5
|
"bugs": "https://github.com/umijs/umi-next/issues",
|
|
6
6
|
"repository": {
|
|
@@ -17,10 +17,10 @@
|
|
|
17
17
|
"scripts": {
|
|
18
18
|
"build": "pnpm tsc",
|
|
19
19
|
"build:deps": "umi-scripts bundleDeps",
|
|
20
|
-
"dev": "pnpm build --
|
|
20
|
+
"dev": "pnpm build --watch"
|
|
21
21
|
},
|
|
22
22
|
"dependencies": {
|
|
23
|
-
"@umijs/utils": "4.0.
|
|
23
|
+
"@umijs/utils": "4.0.2",
|
|
24
24
|
"esbuild": "0.14.36",
|
|
25
25
|
"regenerate-unicode-properties": "10.0.1",
|
|
26
26
|
"spdy": "^4.0.2"
|