@@ -22,7 +22,6 @@ export default async args => {
22
22
const posixPath = join ( cwd , "src" , "**/*.ts" ) . split ( sep ) . join ( posix . sep ) ; // Always use forward slashes
23
23
const files = await fg ( [ posixPath ] ) ; // fast-glob only works with forward slashes
24
24
const outDir = join ( cwd , "dist" ) ;
25
- const isWeb = args . configEnv === "web" ;
26
25
27
26
const nodeResolvePlugin = nodeResolve ( { preferBuiltins : false , mainFields : [ "module" , "browser" , "main" ] } ) ;
28
27
const typescriptPlugin = typescript ( {
@@ -31,7 +30,10 @@ export default async args => {
31
30
inlineSources : false ,
32
31
target : "es2019" ,
33
32
types : [ "mendix-client" , "react-native" ] ,
34
- allowSyntheticDefaultImports : true
33
+ allowSyntheticDefaultImports : true ,
34
+ compilerOptions : {
35
+ newLine : "CRLF"
36
+ }
35
37
} ) ;
36
38
37
39
const copyAsync = promisify ( copy ) ;
@@ -50,7 +52,7 @@ export default async args => {
50
52
plugins : [
51
53
i === 0 ? clear ( { targets : [ outDir ] } ) : null ,
52
54
collectDependencies ( {
53
- copyJsModules : ! isWeb ,
55
+ copyJsModules : true ,
54
56
onlyNative : false ,
55
57
outputDir : outDir ,
56
58
widgetName : fileOutput ,
@@ -76,24 +78,22 @@ export default async args => {
76
78
? command ( [
77
79
async ( ) => copyLicenseFile ( cwd , outDir ) ,
78
80
async ( ) => {
79
- if ( ! isWeb ) {
80
- if ( args . configProject === "nativemobileresources" ) {
81
- // `fbjs/lib/invariant` is being used silently by @react-native-community/cameraroll; it is not listed as a dependency nor peerDependency.
82
- // https://github.dev/react-native-cameraroll/react-native-cameraroll/blob/7c269a837d095a2cb5f4ce13b54ab3060455b17f/js/CameraRoll.js#L14
83
- const path = join ( outDir , "node_modules" , "fbjs" , "lib" ) ;
84
- mkdirSync ( path , { recursive : true } ) ;
85
- await copyAsync (
86
- join ( dirname ( require . resolve ( "fbjs" ) ) , "lib" , "invariant.js" ) ,
87
- join ( path , "invariant.js" )
88
- ) ;
89
- } else if ( args . configProject === "nanoflowcommons" ) {
90
- // `invariant` is being used silently by @react-native-community/geolocation; it is not listed as a dependency nor peerDependency.
91
- // https://github.dev/react-native-geolocation/react-native-geolocation/blob/1786929f2be581da91082ff857c2393da5e597b3/js/implementation.native.js#L13
92
- await copyAsync (
93
- dirname ( require . resolve ( "invariant" ) ) ,
94
- join ( outDir , "node_modules" , "invariant" )
95
- ) ;
96
- }
81
+ if ( args . configProject === "nativemobileresources" ) {
82
+ // `fbjs/lib/invariant` is being used silently by @react-native-community/cameraroll; it is not listed as a dependency nor peerDependency.
83
+ // https://github.dev/react-native-cameraroll/react-native-cameraroll/blob/7c269a837d095a2cb5f4ce13b54ab3060455b17f/js/CameraRoll.js#L14
84
+ const path = join ( outDir , "node_modules" , "fbjs" , "lib" ) ;
85
+ mkdirSync ( path , { recursive : true } ) ;
86
+ await copyAsync (
87
+ join ( dirname ( require . resolve ( "fbjs" ) ) , "lib" , "invariant.js" ) ,
88
+ join ( path , "invariant.js" )
89
+ ) ;
90
+ } else if ( args . configProject === "nanoflowcommons" ) {
91
+ // `invariant` is being used silently by @react-native-community/geolocation; it is not listed as a dependency nor peerDependency.
92
+ // https://github.dev/react-native-geolocation/react-native-geolocation/blob/1786929f2be581da91082ff857c2393da5e597b3/js/implementation.native.js#L13
93
+ await copyAsync (
94
+ dirname ( require . resolve ( "invariant" ) ) ,
95
+ join ( outDir , "node_modules" , "invariant" )
96
+ ) ;
97
97
}
98
98
99
99
// this is helpful to copy the files and folders to a test project path for dev/testing purposes.
0 commit comments