@codemoreira/esad 1.4.6-13 → 1.4.6-15
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 +14 -26
package/package.json
CHANGED
package/src/plugin/index.js
CHANGED
|
@@ -19,7 +19,7 @@ const { ReanimatedPlugin } = require('@callstack/repack-plugin-reanimated');
|
|
|
19
19
|
* @param {Object} [options.remotes] Remote modules (for host)
|
|
20
20
|
*/
|
|
21
21
|
function withESAD(env, options) {
|
|
22
|
-
const { platform, dev } = env;
|
|
22
|
+
const { platform, dev, devServer } = env;
|
|
23
23
|
const isDev = dev !== false;
|
|
24
24
|
const dirname = options.dirname;
|
|
25
25
|
const pkgPath = path.resolve(dirname, 'package.json');
|
|
@@ -32,40 +32,28 @@ function withESAD(env, options) {
|
|
|
32
32
|
const config = {
|
|
33
33
|
mode: isDev ? 'development' : 'production',
|
|
34
34
|
context: dirname,
|
|
35
|
-
entry:
|
|
36
|
-
|
|
37
|
-
path: path.resolve(dirname, 'build', platform),
|
|
38
|
-
filename: 'index.bundle',
|
|
39
|
-
chunkFilename: '[name].chunk.bundle',
|
|
35
|
+
entry: {
|
|
36
|
+
index: './index.js',
|
|
40
37
|
},
|
|
41
|
-
|
|
42
|
-
devServer
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
middlewares.unshift((req, res, next) => {
|
|
48
|
-
if (req.url.startsWith('/.expo/.virtual-metro-entry')) {
|
|
49
|
-
const query = req.url.split('?')[1];
|
|
50
|
-
const target = '/index.bundle';
|
|
51
|
-
req.url = query ? `${target}?${query}` : target;
|
|
52
|
-
console.log(`[ESAD] Routing virtual entry to: ${req.url}`);
|
|
53
|
-
}
|
|
54
|
-
next();
|
|
55
|
-
});
|
|
56
|
-
return middlewares;
|
|
38
|
+
devServer: !!devServer && {
|
|
39
|
+
...devServer,
|
|
40
|
+
proxy: [
|
|
41
|
+
{
|
|
42
|
+
context: ['/.expo/.virtual-metro-entry'],
|
|
43
|
+
pathRewrite: { '^/.expo/.virtual-metro-entry': '/index' },
|
|
57
44
|
},
|
|
58
|
-
|
|
59
|
-
}
|
|
45
|
+
],
|
|
46
|
+
},
|
|
60
47
|
resolve: {
|
|
61
48
|
...Repack.getResolveOptions(platform),
|
|
62
49
|
fullySpecified: false,
|
|
63
50
|
alias: {
|
|
64
|
-
'
|
|
51
|
+
'app-root': path.resolve(dirname, 'app'),
|
|
65
52
|
'@': dirname,
|
|
66
53
|
'@module-federation/runtime/helpers': path.resolve(dirname, 'node_modules/@module-federation/runtime/dist/helpers.cjs'),
|
|
67
54
|
'@module-federation/error-codes/browser': path.resolve(dirname, 'node_modules/@module-federation/error-codes/dist/browser.cjs'),
|
|
68
55
|
...Repack.getResolveOptions(platform).alias,
|
|
56
|
+
'react-native-web': 'react-native',
|
|
69
57
|
},
|
|
70
58
|
conditionNames: ['react-native', 'require', 'import', 'default'],
|
|
71
59
|
},
|
|
@@ -94,7 +82,7 @@ function withESAD(env, options) {
|
|
|
94
82
|
'process.env.EXPO_OS': JSON.stringify(platform),
|
|
95
83
|
'process.env.EXPO_PROJECT_ROOT': JSON.stringify(dirname),
|
|
96
84
|
'process.env.EXPO_ROUTER_ABS_APP_ROOT': JSON.stringify(path.resolve(dirname, 'app')),
|
|
97
|
-
'process.env.EXPO_ROUTER_APP_ROOT': JSON.stringify('
|
|
85
|
+
'process.env.EXPO_ROUTER_APP_ROOT': JSON.stringify('app-root'),
|
|
98
86
|
'process.env.EXPO_ROUTER_IMPORT_MODE': JSON.stringify('sync'),
|
|
99
87
|
}),
|
|
100
88
|
new ExpoModulesPlugin(),
|