@codemoreira/esad 2.0.1-20 → 2.0.1-22
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 -1
package/package.json
CHANGED
package/src/plugin/index.js
CHANGED
|
@@ -2,7 +2,7 @@ const path = require('node:path');
|
|
|
2
2
|
const fs = require('node:fs');
|
|
3
3
|
const Repack = require('@callstack/repack');
|
|
4
4
|
const { ExpoModulesPlugin } = require('@callstack/repack-plugin-expo-modules');
|
|
5
|
-
const {
|
|
5
|
+
const { DefinePlugin, BannerPlugin } = require('@rspack/core');
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
8
|
* ESAD Re.Pack Plugin Wrapper
|
|
@@ -127,8 +127,23 @@ function withESAD(env, options) {
|
|
|
127
127
|
'process.env.NODE_ENV': JSON.stringify(isDev ? 'development' : 'production'),
|
|
128
128
|
'process.env.EXPO_OS': JSON.stringify(platform),
|
|
129
129
|
'process.env.REPACK_PLATFORM': JSON.stringify(platform),
|
|
130
|
+
'process.env': JSON.stringify({
|
|
131
|
+
NODE_ENV: isDev ? 'development' : 'production',
|
|
132
|
+
EXPO_OS: platform,
|
|
133
|
+
REPACK_PLATFORM: platform,
|
|
134
|
+
}),
|
|
130
135
|
'__DEV__': JSON.stringify(isDev),
|
|
131
136
|
}),
|
|
137
|
+
new BannerPlugin({
|
|
138
|
+
raw: true,
|
|
139
|
+
entryOnly: true,
|
|
140
|
+
banner: `
|
|
141
|
+
global.process = global.process || { env: {} };
|
|
142
|
+
global.process.env.EXPO_OS = '${platform}';
|
|
143
|
+
global.process.env.NODE_ENV = '${isDev ? 'development' : 'production'}';
|
|
144
|
+
global.process.env.REPACK_PLATFORM = '${platform}';
|
|
145
|
+
`,
|
|
146
|
+
}),
|
|
132
147
|
new ExpoModulesPlugin(),
|
|
133
148
|
new Repack.RepackPlugin(),
|
|
134
149
|
new Repack.plugins.ModuleFederationPluginV2({
|