chore: update Next.js configuration and release workflow
- Modified Next.js configuration to conditionally apply raw-loader for markdown files only on the client side. - Increased static page generation timeout to 300 seconds for larger builds. - Enhanced GitHub Actions release workflow by adding a step to build the Next.js frontend, ensuring the 'out' directory exists post-build. - Simplified the beforeBuildCommand in Tauri configuration to only include the build step.
This commit is contained in:
1 parent
5fdb9861ef
commit
655d9c1b45
3 files changed
+30
-6
No files matched your search
@@ -83,6 +83,19 @@ jobs:
|
|||||||
- name: Generate changelog
|
- name: Generate changelog
|
||||||
run: pnpm generate-changelog
|
run: pnpm generate-changelog
|
||||||
|
|
||||||
|
- name: Build frontend (Next.js)
|
||||||
|
shell: bash
|
||||||
|
env:
|
||||||
|
NODE_OPTIONS: ${{ matrix.platform == 'macos-latest' && matrix.target == 'aarch64-apple-darwin' && '--max-old-space-size=4096' || '--max-old-space-size=2048' }}
|
||||||
|
run: |
|
||||||
|
echo "Building Next.js frontend with NODE_OPTIONS=${NODE_OPTIONS}"
|
||||||
|
pnpm build
|
||||||
|
if [ ! -d "out" ]; then
|
||||||
|
echo "Error: Frontend build failed - 'out' directory not found"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
echo "Frontend build successful - 'out' directory exists"
|
||||||
|
|
||||||
- name: Build Tauri app
|
- name: Build Tauri app
|
||||||
run: |
|
run: |
|
||||||
cd src-tauri
|
cd src-tauri
|
||||||
@@ -92,6 +105,7 @@ jobs:
|
|||||||
shell: bash
|
shell: bash
|
||||||
env:
|
env:
|
||||||
TAURI_PRIVATE_KEY: ${{ secrets.TAURI_UPDATER_PRIVATE_KEY }}
|
TAURI_PRIVATE_KEY: ${{ secrets.TAURI_UPDATER_PRIVATE_KEY }}
|
||||||
|
NODE_OPTIONS: ${{ matrix.platform == 'macos-latest' && matrix.target == 'aarch64-apple-darwin' && '--max-old-space-size=4096' || '--max-old-space-size=2048' }}
|
||||||
run: |
|
run: |
|
||||||
cd src-tauri
|
cd src-tauri
|
||||||
if [ -n "$TAURI_PRIVATE_KEY" ]; then
|
if [ -n "$TAURI_PRIVATE_KEY" ]; then
|
||||||
|
|||||||
+15
-5
@@ -5,16 +5,26 @@ const nextConfig: NextConfig = {
|
|||||||
images: {
|
images: {
|
||||||
unoptimized: true,
|
unoptimized: true,
|
||||||
},
|
},
|
||||||
webpack: (config) => {
|
webpack: (config, { isServer }) => {
|
||||||
config.module.rules.push({
|
// Adiciona suporte para raw-loader apenas no cliente
|
||||||
test: /\.md$/,
|
if (!isServer) {
|
||||||
use: 'raw-loader',
|
config.module.rules.push({
|
||||||
});
|
test: /\.md$/,
|
||||||
|
use: {
|
||||||
|
loader: 'raw-loader',
|
||||||
|
options: {
|
||||||
|
esModule: false,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
});
|
||||||
|
}
|
||||||
return config;
|
return config;
|
||||||
},
|
},
|
||||||
// Configuração Turbopack: objeto vazio silencia o erro
|
// Configuração Turbopack: objeto vazio silencia o erro
|
||||||
// Turbopack ainda não suporta raw-loader, então usaremos webpack para builds
|
// Turbopack ainda não suporta raw-loader, então usaremos webpack para builds
|
||||||
turbopack: {},
|
turbopack: {},
|
||||||
|
// Aumenta timeout para builds grandes
|
||||||
|
staticPageGenerationTimeout: 300,
|
||||||
};
|
};
|
||||||
|
|
||||||
export default nextConfig;
|
export default nextConfig;
|
||||||
@@ -7,7 +7,7 @@
|
|||||||
"frontendDist": "../out",
|
"frontendDist": "../out",
|
||||||
"devUrl": "http://localhost:3000",
|
"devUrl": "http://localhost:3000",
|
||||||
"beforeDevCommand": "pnpm dev",
|
"beforeDevCommand": "pnpm dev",
|
||||||
"beforeBuildCommand": "pnpm generate-changelog && pnpm build"
|
"beforeBuildCommand": "pnpm build"
|
||||||
},
|
},
|
||||||
"app": {
|
"app": {
|
||||||
"windows": [
|
"windows": [
|
||||||
|
|||||||
Reference in new issue
Block a user