Skip to content

Commit

Permalink
fix: build
Browse files Browse the repository at this point in the history
Signed-off-by: Innei <i@innei.in>
  • Loading branch information
Innei committed Jul 6, 2023
1 parent 6823b98 commit 7cf8433
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 2 deletions.
2 changes: 2 additions & 0 deletions next.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ const isProd = process.env.NODE_ENV === 'production'
/** @type {import('next').NextConfig} */
// eslint-disable-next-line import/no-mutable-exports
let nextConfig = {
output: 'standalone',
assetPrefix: isProd ? env.ASSETPREFIX || undefined : undefined,
compiler: {
// reactRemoveProperties: { properties: ['^data-id$', '^data-(\\w+)-id$'] },
},
Expand Down
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@
"build:ci": "cross-env NODE_ENV=production CI=true next build",
"lint": "eslint --ext .ts,.tsx --ignore-path .gitignore . --fix",
"prod:pm2": "cross-env NODE_ENV=production pm2 restart ecosystem.config.js",
"prod:pm2-alone": "cross-env NODE_ENV=production pm2 restart ecosystem.standalone.config.js",
"prod:stop": "pm2 stop ecosystem.config.js",
"prod:reload": "pm2 reload ecosystem.config.js"
},
Expand Down
2 changes: 1 addition & 1 deletion src/lib/request.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export const apiClient = createClient(axiosAdaptor)(API_URL, {

export const $axios = axiosAdaptor.default as AxiosInstance

$axios.defaults.timeout = 10000
$axios.defaults.timeout = 3000

if (typeof window === 'undefined')
$axios.defaults.headers.common[
Expand Down
23 changes: 23 additions & 0 deletions standalone-build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#!env bash
set -e
CWD=$(pwd)
npm run build
cd .next
pwd
rm -rf cache
cp ../next.config.mjs ./standalone/next.config.mjs
cp -r ../public ./standalone/public

cd ./standalone
echo ';process.title = "Shiro (NextJS)"' >>server.js
mv ../static/ ./.next/static

# move workbox
# cp ../sw.js ./public/sw.js
# cp ../workbox-*.js ./public

cp $CWD/ecosystem.config.js ./ecosystem.config.js

cd ..

zip --symlinks -r $CWD/release.zip ./*

1 comment on commit 7cf8433

@vercel
Copy link

@vercel vercel bot commented on 7cf8433 Jul 6, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

shiro – ./

shiro-git-main-innei.vercel.app
shiro-innei.vercel.app
springtide.vercel.app
innei.in

Please sign in to comment.