mirror of
https://gitcode.com/github-mirrors/react-native-update-cli.git
synced 2025-09-16 01:41:37 +08:00
compose sourcemap
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "react-native-update-cli",
|
"name": "react-native-update-cli",
|
||||||
"version": "1.32.3",
|
"version": "1.33.0",
|
||||||
"description": "Command tools for javaScript updater with `pushy` service for react native apps.",
|
"description": "Command tools for javaScript updater with `pushy` service for react native apps.",
|
||||||
"main": "index.js",
|
"main": "index.js",
|
||||||
"bin": {
|
"bin": {
|
||||||
|
@@ -226,6 +226,10 @@ async function compileHermesByteCode(
|
|||||||
'-O',
|
'-O',
|
||||||
];
|
];
|
||||||
if (sourcemapOutput) {
|
if (sourcemapOutput) {
|
||||||
|
fs.copyFileSync(
|
||||||
|
sourcemapOutput,
|
||||||
|
path.join(outputFolder, bundleName + '.txt.map'),
|
||||||
|
);
|
||||||
args.push('-output-source-map');
|
args.push('-output-source-map');
|
||||||
}
|
}
|
||||||
console.log(
|
console.log(
|
||||||
@@ -234,6 +238,28 @@ async function compileHermesByteCode(
|
|||||||
spawnSync(hermesCommand, args, {
|
spawnSync(hermesCommand, args, {
|
||||||
stdio: 'ignore',
|
stdio: 'ignore',
|
||||||
});
|
});
|
||||||
|
if (sourcemapOutput) {
|
||||||
|
const composerPath =
|
||||||
|
'node_modules/react-native/scripts/compose-source-maps.js';
|
||||||
|
if (!fs.existsSync(composerPath)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
console.log(`Composing source map`);
|
||||||
|
spawnSync(
|
||||||
|
'node',
|
||||||
|
[
|
||||||
|
composerPath,
|
||||||
|
path.join(outputFolder, bundleName + '.txt.map'),
|
||||||
|
path.join(outputFolder, bundleName + '.map'),
|
||||||
|
'-o',
|
||||||
|
sourcemapOutput,
|
||||||
|
],
|
||||||
|
{
|
||||||
|
stdio: 'ignore',
|
||||||
|
},
|
||||||
|
);
|
||||||
|
}
|
||||||
|
fs.removeSync(path.join(outputFolder, bundleName + '.txt.map'));
|
||||||
}
|
}
|
||||||
|
|
||||||
async function pack(dir, output) {
|
async function pack(dir, output) {
|
||||||
|
Reference in New Issue
Block a user