fix(build): repair errors caused by manifest & structural changes

This commit is contained in:
David Ralph 2024-03-15 11:33:24 +00:00
parent 908ad1cc3b
commit e587b3d6ea
1 changed files with 16 additions and 2 deletions

View File

@ -23,7 +23,7 @@ const prepareBuilds = () => ({
path.resolve(__dirname, './build/chrome/manifest.json'), path.resolve(__dirname, './build/chrome/manifest.json'),
); );
fs.copyFileSync( fs.copyFileSync(
path.resolve(__dirname, './manifest/background-chrome.js'), path.resolve(__dirname, './manifest/background.js'),
path.resolve(__dirname, './build/chrome/background.js'), path.resolve(__dirname, './build/chrome/background.js'),
); );
fs.cpSync( fs.cpSync(
@ -36,6 +36,13 @@ const prepareBuilds = () => ({
fs.cpSync(path.resolve(__dirname, './dist'), path.resolve(__dirname, './build/chrome/'), { fs.cpSync(path.resolve(__dirname, './dist'), path.resolve(__dirname, './build/chrome/'), {
recursive: true, recursive: true,
}); });
fs.cpSync(
path.resolve(__dirname, './src/assets/icons'),
path.resolve(__dirname, './build/chrome/icons'),
{
recursive: true,
},
);
// firefox // firefox
fs.mkdirSync(path.resolve(__dirname, './build/firefox'), { recursive: true }); fs.mkdirSync(path.resolve(__dirname, './build/firefox'), { recursive: true });
@ -44,12 +51,19 @@ const prepareBuilds = () => ({
path.resolve(__dirname, './build/firefox/manifest.json'), path.resolve(__dirname, './build/firefox/manifest.json'),
); );
fs.copyFileSync( fs.copyFileSync(
path.resolve(__dirname, './manifest/background-firefox.js'), path.resolve(__dirname, './manifest/background.js'),
path.resolve(__dirname, './build/firefox/background.js'), path.resolve(__dirname, './build/firefox/background.js'),
); );
fs.cpSync(path.resolve(__dirname, './dist'), path.resolve(__dirname, './build/firefox/'), { fs.cpSync(path.resolve(__dirname, './dist'), path.resolve(__dirname, './build/firefox/'), {
recursive: true, recursive: true,
}); });
fs.cpSync(
path.resolve(__dirname, './src/assets/icons'),
path.resolve(__dirname, './build/firefox/icons'),
{
recursive: true,
},
);
// create zip // create zip
const zip = new ADMZip(); const zip = new ADMZip();