@codemoreira/esad 1.3.8 ā 1.3.11
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/README.md +8 -1
- package/package.json +1 -1
- package/src/cli/commands/build.js +7 -2
- package/src/cli/commands/deploy.js +2 -2
- package/src/plugin/index.js +5 -0
package/README.md
CHANGED
|
@@ -30,7 +30,14 @@ npx esad host dev # Run the Host App
|
|
|
30
30
|
npx esad dev --id module-name --port 9000 # Run a Module
|
|
31
31
|
```
|
|
32
32
|
|
|
33
|
-
### 5.
|
|
33
|
+
### 5. Build for Production
|
|
34
|
+
Prepares the bundle and chunks for deployment, generating a standardized `./build` directory.
|
|
35
|
+
```bash
|
|
36
|
+
npx esad build --id module-name --platform android
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
### 6. Deployment
|
|
40
|
+
Packages the `./build` folder and uploads it to your configured Registry/CDN via multipart POST.
|
|
34
41
|
```bash
|
|
35
42
|
npx esad deploy --id module-name --version 1.0.0
|
|
36
43
|
```
|
package/package.json
CHANGED
|
@@ -36,15 +36,20 @@ module.exports = async (options) => {
|
|
|
36
36
|
console.log(`\nšļø Building production bundle for ${path.basename(cwd)} (${platform})...\n`);
|
|
37
37
|
|
|
38
38
|
try {
|
|
39
|
+
const bundleOutput = path.join(cwd, 'build', platform, 'index.bundle');
|
|
40
|
+
fs.ensureDirSync(path.dirname(bundleOutput));
|
|
41
|
+
|
|
39
42
|
// Run Re.Pack production build
|
|
40
43
|
await runProcess('npx', [
|
|
41
44
|
'react-native',
|
|
42
45
|
'webpack-bundle',
|
|
43
46
|
'--platform', platform,
|
|
44
|
-
'--dev', 'false'
|
|
47
|
+
'--dev', 'false',
|
|
48
|
+
'--bundle-output', bundleOutput,
|
|
49
|
+
'--assets-dest', path.dirname(bundleOutput)
|
|
45
50
|
], cwd);
|
|
46
51
|
|
|
47
|
-
console.log(chalk.green(`\nā
Build complete! Assets generated in
|
|
52
|
+
console.log(chalk.green(`\nā
Build complete! Assets generated in build/ directory.`));
|
|
48
53
|
console.log(`š You can now run: esad deploy ${options.id ? `--id ${options.id}` : ''}\n`);
|
|
49
54
|
} catch (err) {
|
|
50
55
|
console.error(chalk.red(`\nā Build failed: ${err.message}`));
|
|
@@ -60,9 +60,9 @@ module.exports = async (options) => {
|
|
|
60
60
|
const deployUrl = config.deployEndpoint.replace('{{moduleId}}', moduleId);
|
|
61
61
|
console.log(`š” Deployment Endpoint Resolved: ${deployUrl}`);
|
|
62
62
|
|
|
63
|
-
const distPath = path.join(cwd, '
|
|
63
|
+
const distPath = path.join(cwd, 'build');
|
|
64
64
|
if (!fs.existsSync(distPath)) {
|
|
65
|
-
console.error(`ā Error:
|
|
65
|
+
console.error(`ā Error: build/ directory not found in ${cwd}. Did you run the build command?`);
|
|
66
66
|
process.exit(1);
|
|
67
67
|
}
|
|
68
68
|
|
package/src/plugin/index.js
CHANGED
|
@@ -31,6 +31,11 @@ function withESAD(env, options) {
|
|
|
31
31
|
mode: isDev ? 'development' : 'production',
|
|
32
32
|
context: dirname,
|
|
33
33
|
entry: options.entry || './index.js',
|
|
34
|
+
output: {
|
|
35
|
+
path: path.resolve(dirname, 'build', platform),
|
|
36
|
+
filename: 'index.bundle',
|
|
37
|
+
clean: true,
|
|
38
|
+
},
|
|
34
39
|
resolve: {
|
|
35
40
|
...Repack.getResolveOptions(),
|
|
36
41
|
alias: {
|