Skip to content

1. 腾讯云函数 #6

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion next.config.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
const withPlugins = require('next-compose-plugins');

const withBundleAnalyzer = require("@next/bundle-analyzer")({
enabled: process.env.ANALYZE === "true",
});

module.exports = withBundleAnalyzer({
const isProd = process.env.NODE_ENV === 'production'

module.exports = withPlugins([[withBundleAnalyzer, {
swcMinify: true,
webpack(config, { dev, isServer }) {
// Replace React with Preact only in client production build
Expand All @@ -28,4 +32,10 @@ module.exports = withBundleAnalyzer({
},
];
},
}]], {
env: {
STATIC_URL: isProd ? process.env.STATIC_URL : ''
},
assetPrefix: isProd ? process.env.STATIC_URL : '',
trailingSlash: true
});
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
"@splitbee/web": "^0.2.4",
"axios": "^0.21.1",
"next": "^12.0.7",
"next-compose-plugins": "^2.2.1",
"preact": "^10.5.14",
"react": "^17.0.2",
"react-copy-to-clipboard": "^5.0.3",
Expand Down
3 changes: 3 additions & 0 deletions scf_bootstrap
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/var/lang/node16/bin/node
const { nextStart } = require('next/dist/cli/next-start');
nextStart([ '--port', '9000', '--hostname', '0.0.0.0' ])