@codemoreira/esad 1.4.6-8 → 1.4.6-9
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/package.json +1 -1
- package/src/plugin/index.js +16 -54
package/package.json
CHANGED
package/src/plugin/index.js
CHANGED
|
@@ -39,63 +39,28 @@ function withESAD(env, options) {
|
|
|
39
39
|
clean: true,
|
|
40
40
|
},
|
|
41
41
|
resolve: {
|
|
42
|
-
...Repack.getResolveOptions(),
|
|
42
|
+
...Repack.getResolveOptions(platform),
|
|
43
43
|
alias: {
|
|
44
|
-
|
|
44
|
+
'~': dirname,
|
|
45
45
|
'@': dirname,
|
|
46
|
-
|
|
47
|
-
'react-native': path.resolve(dirname, 'node_modules/react-native'),
|
|
46
|
+
...Repack.getResolveOptions(platform).alias,
|
|
48
47
|
},
|
|
49
|
-
|
|
50
|
-
'.expo.ts', '.expo.tsx', '.expo.js', '.expo.jsx',
|
|
51
|
-
'.native.ts', '.native.tsx', '.native.js', '.native.jsx',
|
|
52
|
-
...Repack.getResolveOptions().extensions,
|
|
53
|
-
],
|
|
48
|
+
conditionNames: ['react-native', 'require', 'import', 'default'],
|
|
54
49
|
},
|
|
55
50
|
module: {
|
|
56
51
|
rules: [
|
|
57
52
|
{
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
loader: require.resolve('babel-loader'),
|
|
68
|
-
options: {
|
|
69
|
-
presets: [
|
|
70
|
-
[
|
|
71
|
-
require.resolve('babel-preset-expo'),
|
|
72
|
-
{
|
|
73
|
-
jsxRuntime: 'automatic',
|
|
74
|
-
},
|
|
75
|
-
],
|
|
76
|
-
],
|
|
77
|
-
plugins: [
|
|
78
|
-
require.resolve('@babel/plugin-transform-flow-strip-types'),
|
|
79
|
-
[require.resolve('@babel/plugin-transform-private-methods'), { loose: true }],
|
|
80
|
-
[require.resolve('@babel/plugin-transform-private-property-in-object'), { loose: true }],
|
|
81
|
-
[require.resolve('@babel/plugin-transform-class-properties'), { loose: true }]
|
|
82
|
-
],
|
|
83
|
-
babelrc: false,
|
|
84
|
-
configFile: false,
|
|
85
|
-
caller: {
|
|
86
|
-
name: 'esad-rspack',
|
|
87
|
-
platform,
|
|
88
|
-
}
|
|
89
|
-
},
|
|
90
|
-
},
|
|
91
|
-
type: 'javascript/auto',
|
|
92
|
-
resolve: {
|
|
93
|
-
fullySpecified: false,
|
|
94
|
-
}
|
|
95
|
-
},
|
|
96
|
-
...Repack.getJsTransformRules(),
|
|
97
|
-
]
|
|
53
|
+
test: /\.[jt]sx?$/,
|
|
54
|
+
include: [
|
|
55
|
+
path.resolve(dirname, 'app'),
|
|
56
|
+
path.resolve(dirname, 'index.js'),
|
|
57
|
+
/[\\/]node_modules[\\/](expo-router|react-native|@react-native|expo-modules-core|@module-federation|@react-navigation)[\\/]/
|
|
58
|
+
],
|
|
59
|
+
resolve: {
|
|
60
|
+
fullySpecified: false,
|
|
61
|
+
}
|
|
98
62
|
},
|
|
63
|
+
...Repack.getJsTransformRules(),
|
|
99
64
|
...Repack.getAssetTransformRules(),
|
|
100
65
|
],
|
|
101
66
|
},
|
|
@@ -110,7 +75,7 @@ function withESAD(env, options) {
|
|
|
110
75
|
'process.env.EXPO_OS': JSON.stringify(platform),
|
|
111
76
|
'process.env.EXPO_PROJECT_ROOT': JSON.stringify(dirname),
|
|
112
77
|
'process.env.EXPO_ROUTER_ABS_APP_ROOT': JSON.stringify(path.resolve(dirname, 'app')),
|
|
113
|
-
'process.env.EXPO_ROUTER_APP_ROOT': JSON.stringify('
|
|
78
|
+
'process.env.EXPO_ROUTER_APP_ROOT': JSON.stringify('~/app'),
|
|
114
79
|
'process.env.EXPO_ROUTER_IMPORT_MODE': JSON.stringify('sync'),
|
|
115
80
|
}),
|
|
116
81
|
new ExpoModulesPlugin(),
|
|
@@ -130,13 +95,11 @@ function withESAD(env, options) {
|
|
|
130
95
|
'react-native-safe-area-context': { singleton: true, eager: true, requiredVersion: pkg.dependencies['react-native-safe-area-context'] },
|
|
131
96
|
'expo-router': { singleton: true, eager: true, requiredVersion: pkg.dependencies['expo-router'] },
|
|
132
97
|
'react-native-screens': { singleton: true, eager: true, requiredVersion: pkg.dependencies['react-native-screens'] },
|
|
133
|
-
'expo-constants': { singleton: true, eager: true, requiredVersion: pkg.dependencies['expo-constants'] },
|
|
134
|
-
'expo-linking': { singleton: true, eager: true, requiredVersion: pkg.dependencies['expo-linking'] },
|
|
135
98
|
'@module-federation/runtime': { singleton: true, eager: true },
|
|
136
99
|
'@module-federation/sdk': { singleton: true, eager: true },
|
|
137
100
|
'@codemoreira/esad/client': {
|
|
138
101
|
singleton: true,
|
|
139
|
-
eager: options.type === 'host',
|
|
102
|
+
eager: options.type === 'host',
|
|
140
103
|
import: clientPath
|
|
141
104
|
},
|
|
142
105
|
...(options.shared || {})
|
|
@@ -145,7 +108,6 @@ function withESAD(env, options) {
|
|
|
145
108
|
],
|
|
146
109
|
};
|
|
147
110
|
|
|
148
|
-
// Add Host-specific DevServer magic for Expo
|
|
149
111
|
if (options.type === 'host') {
|
|
150
112
|
config.devServer = {
|
|
151
113
|
proxy: [
|