-
Notifications
You must be signed in to change notification settings - Fork 67
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: optimize the next.config configuration and remove unnecessary …
…environment variable files
- Loading branch information
1 parent
3a58c99
commit 6e98497
Showing
6 changed files
with
27 additions
and
85 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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,2 +1,5 @@ | ||
SELF_PATH=/client/ | ||
NEXT_PUBLIC_API_DOMAIN=http://localhost:8001 | ||
NODE_ENV="development" | ||
|
||
NEXT_PUBLIC_API_DOMAIN="http://127.0.0.1:8000" | ||
|
||
NEXT_STANDALONE="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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,51 +1,38 @@ | ||
// const withBundleAnalyzer = require('@next/bundle-analyzer')({ | ||
// enabled: process.env.ANALYZE === 'true', | ||
// }) | ||
// module.exports = withBundleAnalyzer({}) | ||
const { withSentryConfig } = require("@sentry/nextjs"); | ||
|
||
|
||
const nextConfig = { | ||
...process.env.NEXT_STANDALONE ? { output: "standalone" } :{}, | ||
webpack: (config, { dev}) => { | ||
...process.env.NEXT_STANDALONE ? { output: "standalone" } : {}, // Standalone configuration | ||
webpack: (config, { dev }) => { | ||
config.resolve.fallback = { http: false, https: false, net: false, tls: false }; | ||
|
||
if (dev) { | ||
config.watchOptions = { | ||
followSymlinks: true, | ||
} | ||
}; | ||
|
||
config.snapshot.managedPaths = []; | ||
} | ||
|
||
// Add markdown loader | ||
config.module.rules.push({ | ||
test: /\.md$/, | ||
use: 'raw-loader', | ||
}); | ||
|
||
return config; | ||
} | ||
}, | ||
}; | ||
|
||
// Make sure adding Sentry options is the last code to run before exporting | ||
module.exports = withSentryConfig(nextConfig, { | ||
|
||
const sentryOptions = { | ||
org: "petercat", | ||
project: "petercat", | ||
|
||
// An auth token is required for uploading source maps. | ||
authToken: process.env.SENTRY_AUTH_TOKEN, | ||
|
||
silent: false, // Can be used to suppress logs | ||
|
||
authToken: process.env.SENTRY_AUTH_TOKEN, | ||
silent: false, | ||
hideSourceMaps: true, | ||
|
||
sourcemaps: { | ||
disable: true, | ||
}, | ||
}); | ||
|
||
module.exports = { | ||
output: "standalone", | ||
webpack: (config) => { | ||
config.module.rules.push({ | ||
test: /\.md$/, | ||
use: 'raw-loader', | ||
}); | ||
|
||
return config; | ||
}, | ||
}; | ||
|
||
module.exports = withSentryConfig(nextConfig, sentryOptions); |
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
This file was deleted.
Oops, something went wrong.