@codemoreira/esad 1.4.6-7 → 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 +22 -62
package/package.json
CHANGED
package/src/plugin/index.js
CHANGED
|
@@ -39,56 +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
|
-
},
|
|
86
|
-
},
|
|
87
|
-
type: 'javascript/auto',
|
|
88
|
-
},
|
|
89
|
-
...Repack.getJsTransformRules(),
|
|
90
|
-
]
|
|
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
|
+
}
|
|
91
62
|
},
|
|
63
|
+
...Repack.getJsTransformRules(),
|
|
92
64
|
...Repack.getAssetTransformRules(),
|
|
93
65
|
],
|
|
94
66
|
},
|
|
@@ -103,7 +75,7 @@ function withESAD(env, options) {
|
|
|
103
75
|
'process.env.EXPO_OS': JSON.stringify(platform),
|
|
104
76
|
'process.env.EXPO_PROJECT_ROOT': JSON.stringify(dirname),
|
|
105
77
|
'process.env.EXPO_ROUTER_ABS_APP_ROOT': JSON.stringify(path.resolve(dirname, 'app')),
|
|
106
|
-
'process.env.EXPO_ROUTER_APP_ROOT': JSON.stringify('
|
|
78
|
+
'process.env.EXPO_ROUTER_APP_ROOT': JSON.stringify('~/app'),
|
|
107
79
|
'process.env.EXPO_ROUTER_IMPORT_MODE': JSON.stringify('sync'),
|
|
108
80
|
}),
|
|
109
81
|
new ExpoModulesPlugin(),
|
|
@@ -123,13 +95,11 @@ function withESAD(env, options) {
|
|
|
123
95
|
'react-native-safe-area-context': { singleton: true, eager: true, requiredVersion: pkg.dependencies['react-native-safe-area-context'] },
|
|
124
96
|
'expo-router': { singleton: true, eager: true, requiredVersion: pkg.dependencies['expo-router'] },
|
|
125
97
|
'react-native-screens': { singleton: true, eager: true, requiredVersion: pkg.dependencies['react-native-screens'] },
|
|
126
|
-
'expo-constants': { singleton: true, eager: true, requiredVersion: pkg.dependencies['expo-constants'] },
|
|
127
|
-
'expo-linking': { singleton: true, eager: true, requiredVersion: pkg.dependencies['expo-linking'] },
|
|
128
98
|
'@module-federation/runtime': { singleton: true, eager: true },
|
|
129
99
|
'@module-federation/sdk': { singleton: true, eager: true },
|
|
130
100
|
'@codemoreira/esad/client': {
|
|
131
101
|
singleton: true,
|
|
132
|
-
eager: options.type === 'host',
|
|
102
|
+
eager: options.type === 'host',
|
|
133
103
|
import: clientPath
|
|
134
104
|
},
|
|
135
105
|
...(options.shared || {})
|
|
@@ -138,24 +108,14 @@ function withESAD(env, options) {
|
|
|
138
108
|
],
|
|
139
109
|
};
|
|
140
110
|
|
|
141
|
-
// Add Host-specific DevServer magic for Expo
|
|
142
111
|
if (options.type === 'host') {
|
|
143
112
|
config.devServer = {
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
const location = query ? `${target}?${query}` : target;
|
|
151
|
-
res.writeHead(302, { Location: location });
|
|
152
|
-
res.end();
|
|
153
|
-
return;
|
|
154
|
-
}
|
|
155
|
-
next();
|
|
156
|
-
});
|
|
157
|
-
return middlewares;
|
|
158
|
-
},
|
|
113
|
+
proxy: [
|
|
114
|
+
{
|
|
115
|
+
context: ['/.expo/.virtual-metro-entry'],
|
|
116
|
+
pathRewrite: { '^/.expo/.virtual-metro-entry': '/index.bundle' },
|
|
117
|
+
},
|
|
118
|
+
],
|
|
159
119
|
};
|
|
160
120
|
}
|
|
161
121
|
|