-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#23 update extension packaging to use brew web-ext
- Loading branch information
Showing
4 changed files
with
30 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,42 +1,22 @@ | ||
#!/bin/bash | ||
|
||
# Build the Next.js application | ||
npx next build | ||
echo " | ||
Build complete | ||
" | ||
echo "Export complete" | ||
|
||
# Export the application as static HTML files | ||
npx next export | ||
echo " | ||
Export complete | ||
" | ||
# Copy the manifest.json file to /extension folder | ||
cp extensionReqs/manifest.json out/manifest.json | ||
|
||
# Move the _next directory to next | ||
# build the extension | ||
cd out | ||
web-ext build | ||
|
||
mv out/_next out/next | ||
# Move the web-ext-artifacts and its content to the ../extension folder (creating it if it doesn't exist) | ||
cd .. | ||
mkdir -p extension | ||
mv out/web-ext-artifacts/* extension | ||
|
||
# Replace occurrences of /_next with ./next in HTML files | ||
find out -type f -name "*.html" -exec sed -i '' -e 's#/_next#./next#g' {} + | ||
|
||
# Move extension.html to /extension folder | ||
mkdir extension | ||
mv out/extension.html extension/extension.html | ||
mv out/logo.png extension/logo.png | ||
|
||
# Synchronize out/next with /extension/next | ||
rsync -va --delete-after out/next/ extension/next/ | ||
|
||
# copy the manifest.json file to /extension folder | ||
cp extensionReqs/manifest.json extension/manifest.json | ||
|
||
# Remove the out directory | ||
# Delete the out folder and its content | ||
cd .. | ||
rm -rf out | ||
|
||
# when the user includes an export flag, export the extension folder as a zip | ||
if [ "$1" == "export" ]; then | ||
echo " | ||
exporting extension folder as zip | ||
" | ||
zip -r extension.zip extension | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
/** @type {import('next').NextConfig} */ | ||
const nextConfig = { | ||
output: "export", | ||
reactStrictMode: true, | ||
} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters