File tree 6 files changed +8
-5
lines changed
TitaniumKit/TitaniumKit/Sources/API
6 files changed +8
-5
lines changed Original file line number Diff line number Diff line change @@ -2843,7 +2843,8 @@ AndroidBuilder.prototype.generateRequireIndex = async function generateRequireIn
2843
2843
await walkDir ( filePath ) ;
2844
2844
} else if ( stat . isFile ( ) ) {
2845
2845
const lowerCaseFileName = fileName . toLowerCase ( ) ;
2846
- if ( lowerCaseFileName . endsWith ( '.js' ) || lowerCaseFileName . endsWith ( '.json' ) ) {
2846
+ // TODO: Support mjs files!
2847
+ if ( lowerCaseFileName . endsWith ( '.js' ) || lowerCaseFileName . endsWith ( '.json' ) || lowerCaseFileName . endsWith ( '.cjs' ) ) {
2847
2848
let normalizedFilePath = filePath . replace ( / \\ / g, '/' ) ;
2848
2849
normalizedFilePath = normalizedFilePath . replace ( normalizedAssetsDir + '/' , '' ) ;
2849
2850
filePathDictionary [ normalizedFilePath ] = 1 ;
Original file line number Diff line number Diff line change @@ -29,7 +29,7 @@ async function generateIndexJSON(dirToTraverse) {
29
29
if ( fs . existsSync ( file ) ) {
30
30
if ( fs . statSync ( file ) . isDirectory ( ) ) {
31
31
walk ( file ) ;
32
- } else if ( / \. j s ( o n ) ? $ / . test ( filename ) ) {
32
+ } else if ( / \. ( c ? j s | j s o n ) $ / . test ( filename ) ) { // TODO: Support mjs files!
33
33
index [ file . replace ( / \\ / g, '/' ) . replace ( dirToTraverse + '/' , 'Resources/' ) ] = 1 ;
34
34
}
35
35
}
Original file line number Diff line number Diff line change @@ -234,6 +234,8 @@ class Categorizer {
234
234
_handleFile ( results , relPath , info ) {
235
235
switch ( info . ext ) {
236
236
case 'js' :
237
+ case 'cjs' :
238
+ // case 'mjs': // FIXME: Support mjs!
237
239
results . jsFiles . set ( relPath , info ) ;
238
240
break ;
239
241
Original file line number Diff line number Diff line change @@ -192,7 +192,7 @@ - (JSValue *)getFile
192
192
193
193
- (TiFile *)getFileProxy : (NSString *)path
194
194
{
195
- if ([path hasSuffix: @" .js" ] || [path hasSuffix: @" .json" ]) {
195
+ if ([path hasSuffix: @" .js" ] || [path hasSuffix: @" .json" ] || [path hasSuffix: @" .cjs " ] ) {// FIXME: Handle mjs?
196
196
NSString *resourcesDir = [self resourcesDirectory ];
197
197
if ([path hasPrefix: resourcesDir] || [path hasPrefix: [resourcesDir stringByStandardizingPath ]]) {
198
198
NSURL *url = [NSURL fileURLWithPath: path];
Original file line number Diff line number Diff line change @@ -41,7 +41,7 @@ - (NSString *)basename
41
41
basename = [@" app" retain ];
42
42
} else {
43
43
NSString *last = [[url path ] lastPathComponent ];
44
- basename = [[last stringByReplacingOccurrencesOfString: @" .js" withString: @" " ] retain ];
44
+ basename = [[last stringByReplacingOccurrencesOfString: @" .js" withString: @" " ] retain ];// FIXME: Handle cjs/mjs?
45
45
}
46
46
}
47
47
return basename;
Original file line number Diff line number Diff line change @@ -6546,7 +6546,7 @@ iOSBuilder.prototype.generateRequireIndex = async function generateRequireIndex(
6546
6546
if ( fs . existsSync ( file ) ) {
6547
6547
if ( fs . statSync ( file ) . isDirectory ( ) ) {
6548
6548
walk ( file ) ;
6549
- } else if ( / \. j s ( o n ) ? $ / . test ( filename ) ) {
6549
+ } else if ( / \. ( c ? j s | j s o n ) $ / . test ( filename ) ) { // TODO: Support mjs files!
6550
6550
const modifiedFilename = file . replace ( / \\ / g, '/' ) . replace ( binAssetsDir + '/' , 'Resources/' ) ;
6551
6551
index [ modifiedFilename ] = 1 ; // 1 for exists on disk
6552
6552
}
You can’t perform that action at this time.
0 commit comments