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
|
||||
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
|
||||
run: |
|
||||
cd src-tauri
|
||||
@@ -92,6 +105,7 @@ jobs:
|
||||
shell: bash
|
||||
env:
|
||||
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: |
|
||||
cd src-tauri
|
||||
if [ -n "$TAURI_PRIVATE_KEY" ]; then
|
||||
|
||||
+15
-5
@@ -5,16 +5,26 @@ const nextConfig: NextConfig = {
|
||||
images: {
|
||||
unoptimized: true,
|
||||
},
|
||||
webpack: (config) => {
|
||||
config.module.rules.push({
|
||||
test: /\.md$/,
|
||||
use: 'raw-loader',
|
||||
});
|
||||
webpack: (config, { isServer }) => {
|
||||
// Adiciona suporte para raw-loader apenas no cliente
|
||||
if (!isServer) {
|
||||
config.module.rules.push({
|
||||
test: /\.md$/,
|
||||
use: {
|
||||
loader: 'raw-loader',
|
||||
options: {
|
||||
esModule: false,
|
||||
},
|
||||
},
|
||||
});
|
||||
}
|
||||
return config;
|
||||
},
|
||||
// Configuração Turbopack: objeto vazio silencia o erro
|
||||
// Turbopack ainda não suporta raw-loader, então usaremos webpack para builds
|
||||
turbopack: {},
|
||||
// Aumenta timeout para builds grandes
|
||||
staticPageGenerationTimeout: 300,
|
||||
};
|
||||
|
||||
export default nextConfig;
|
||||
@@ -7,7 +7,7 @@
|
||||
"frontendDist": "../out",
|
||||
"devUrl": "http://localhost:3000",
|
||||
"beforeDevCommand": "pnpm dev",
|
||||
"beforeBuildCommand": "pnpm generate-changelog && pnpm build"
|
||||
"beforeBuildCommand": "pnpm build"
|
||||
},
|
||||
"app": {
|
||||
"windows": [
|
||||
|
||||
Reference in new issue
Block a user