mirror of
https://github.com/openharmony/developtools_ace-js2bundle.git
synced 2026-07-20 21:59:23 -04:00
!368 fix card without abc
Merge pull request !368 from 卡哥/OpenHarmony-3.1-Release
This commit is contained in:
@@ -75,7 +75,11 @@ class GenAbcPlugin {
|
||||
newContent = `\n\n\n\n\n\n\n\n\n\n\n\n\n\n` + newContent;
|
||||
}
|
||||
const keyPath = key.replace(/\.js$/, firstFileEXT)
|
||||
writeFileSync(newContent, path.resolve(output, keyPath), key);
|
||||
writeFileSync(newContent, path.resolve(output, keyPath), true);
|
||||
} else if (output && path.extname(key) === '.json' &&
|
||||
process.env.DEVICE_LEVEL === 'card') {
|
||||
writeFileSync(assets[key].source(),
|
||||
path.resolve(output, key.replace(/\.json$/, '.json')), false);
|
||||
}
|
||||
})
|
||||
});
|
||||
@@ -104,13 +108,13 @@ function checkWorksFile(assetPath, workerFile) {
|
||||
return true;
|
||||
}
|
||||
|
||||
function writeFileSync(inputString, output, jsBundleFile) {
|
||||
function writeFileSync(inputString, output, isToBin) {
|
||||
const parent = path.join(output, '..');
|
||||
if (!(fs.existsSync(parent) && fs.statSync(parent).isDirectory())) {
|
||||
mkDir(parent);
|
||||
}
|
||||
fs.writeFileSync(output, inputString);
|
||||
if (fs.existsSync(output)) {
|
||||
if (fs.existsSync(output) && isToBin) {
|
||||
let fileSize = fs.statSync(output).size;
|
||||
intermediateJsBundle.push({path: output, size: fileSize});
|
||||
}
|
||||
|
||||
@@ -216,7 +216,7 @@ function notPreview(env, workerFile) {
|
||||
}
|
||||
config.plugins.push(new GenAbcPlugin(process.env.buildPath, arkDir, nodeJs, workerFile,
|
||||
env.buildMode === 'debug'))
|
||||
if (env.buildMode === 'release' && process.env.DEVICE_LEVEL !== 'card') {
|
||||
if (env.buildMode === 'release') {
|
||||
config.output.path = path.join(process.env.cachePath, "releaseAssets",
|
||||
path.basename(process.env.buildPath));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user