chore: remove pwa
This commit is contained in:
+91
-134
@@ -6,155 +6,112 @@ const withBundleAnalyzer = require("@next/bundle-analyzer")({
|
||||
const execSync = require("child_process").execSync
|
||||
const { withSentryConfig } = require("@sentry/nextjs")
|
||||
|
||||
const withPWA = require("@ducanh2912/next-pwa").default({
|
||||
disable: process.env.NODE_ENV === "development",
|
||||
dest: "public",
|
||||
publicExcludes: ["*"],
|
||||
buildExcludes: [/\.map$/, /^manifest.*\.js$/, /\/chunks\/app\/dashboard/],
|
||||
extendDefaultRuntimeCaching: true,
|
||||
workboxOptions: {
|
||||
runtimeCaching: [
|
||||
{
|
||||
urlPattern: ({ url }) => {
|
||||
return /\/ipfs\/([^/?#]+)$/.test(url.toString())
|
||||
},
|
||||
handler: "CacheFirst",
|
||||
options: {
|
||||
cacheName: "next-ipfs",
|
||||
expiration: {
|
||||
maxEntries: 200,
|
||||
maxAgeSeconds: 365 * 24 * 60 * 60, // 365 days
|
||||
},
|
||||
cacheableResponse: {
|
||||
statuses: [0, 200],
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
// cspell:ignore Fipfs
|
||||
urlPattern: /\/_next\/image\?url=.+%2Fipfs%2F([^/?#]+)$/i,
|
||||
handler: "CacheFirst",
|
||||
options: {
|
||||
cacheName: "next-ipfs",
|
||||
expiration: {
|
||||
maxEntries: 200,
|
||||
maxAgeSeconds: 365 * 24 * 60 * 60, // 365 days
|
||||
},
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
})
|
||||
|
||||
const lastCommitCommand = "git rev-parse HEAD"
|
||||
|
||||
module.exports = withSentryConfig(
|
||||
withBundleAnalyzer(
|
||||
// @ts-ignore
|
||||
withPWA({
|
||||
output: "standalone",
|
||||
env: {
|
||||
APP_DESCRIPTION: pkg.description,
|
||||
},
|
||||
experimental: {
|
||||
scrollRestoration: true,
|
||||
serverComponentsExternalPackages: ["rehype-react"],
|
||||
},
|
||||
productionBrowserSourceMaps: true,
|
||||
withBundleAnalyzer({
|
||||
output: "standalone",
|
||||
env: {
|
||||
APP_DESCRIPTION: pkg.description,
|
||||
},
|
||||
experimental: {
|
||||
scrollRestoration: true,
|
||||
serverComponentsExternalPackages: ["rehype-react"],
|
||||
},
|
||||
productionBrowserSourceMaps: true,
|
||||
|
||||
// https://github.com/vercel/next.js/issues/38436
|
||||
swcMinify: false,
|
||||
// https://github.com/vercel/next.js/issues/38436
|
||||
swcMinify: false,
|
||||
|
||||
webpack(config) {
|
||||
config.resolve.fallback = { fs: false } // polyfill node-id3
|
||||
webpack(config) {
|
||||
config.resolve.fallback = { fs: false } // polyfill node-id3
|
||||
|
||||
// https://github.com/WalletConnect/walletconnect-monorepo/blob/7716e164281c2f531145d682c3658f761fa0a823/providers/universal-provider/src/utils/deepLinks.ts#L39
|
||||
// @walletconnect/universal-provider imports react-native conditionally.
|
||||
// Since this is a NextJS app, simply mark it as external to avoid the webpack bundling warning.
|
||||
config.externals.push("react-native")
|
||||
// https://github.com/WalletConnect/walletconnect-monorepo/blob/7716e164281c2f531145d682c3658f761fa0a823/providers/universal-provider/src/utils/deepLinks.ts#L39
|
||||
// @walletconnect/universal-provider imports react-native conditionally.
|
||||
// Since this is a NextJS app, simply mark it as external to avoid the webpack bundling warning.
|
||||
config.externals.push("react-native")
|
||||
|
||||
// https://github.com/WalletConnect/walletconnect-monorepo/issues/1908#issuecomment-1487801131
|
||||
config.externals.push("pino-pretty", "lokijs", "encoding")
|
||||
// https://github.com/WalletConnect/walletconnect-monorepo/issues/1908#issuecomment-1487801131
|
||||
config.externals.push("pino-pretty", "lokijs", "encoding")
|
||||
|
||||
// https://github.com/WalletConnect/walletconnect-utils/blob/b7d7dc003c25dd33ef74c2fac483140f71a51d86/jsonrpc/http-connection/src/http.ts#L2
|
||||
// `@walletconnect/jsonrpc-http-connection` imports `cross-fetch` to support fetch in Node.js. It's unnecessary for Next.JS app.
|
||||
config.resolve.alias["cross-fetch"] = require.resolve(
|
||||
"next/dist/build/polyfills/fetch/index.js",
|
||||
)
|
||||
// https://github.com/WalletConnect/walletconnect-utils/blob/b7d7dc003c25dd33ef74c2fac483140f71a51d86/jsonrpc/http-connection/src/http.ts#L2
|
||||
// `@walletconnect/jsonrpc-http-connection` imports `cross-fetch` to support fetch in Node.js. It's unnecessary for Next.JS app.
|
||||
config.resolve.alias["cross-fetch"] = require.resolve(
|
||||
"next/dist/build/polyfills/fetch/index.js",
|
||||
)
|
||||
|
||||
// https://github.com/kkomelin/isomorphic-dompurify/issues/54
|
||||
// Fix isomorphic-dompurify in app router
|
||||
config.externals = [...config.externals, "jsdom", "sharp"]
|
||||
// https://github.com/kkomelin/isomorphic-dompurify/issues/54
|
||||
// Fix isomorphic-dompurify in app router
|
||||
config.externals = [...config.externals, "jsdom", "sharp"]
|
||||
|
||||
return config
|
||||
},
|
||||
return config
|
||||
},
|
||||
|
||||
images: {
|
||||
dangerouslyAllowSVG: true,
|
||||
contentSecurityPolicy:
|
||||
"default-src 'self'; script-src 'none'; sandbox; style-src 'unsafe-inline';",
|
||||
remotePatterns: [
|
||||
{ hostname: "**" },
|
||||
{ protocol: "https", hostname: "pbs.twimg.com" },
|
||||
{ protocol: "https", hostname: "abs.twimg.com" },
|
||||
],
|
||||
},
|
||||
images: {
|
||||
dangerouslyAllowSVG: true,
|
||||
contentSecurityPolicy:
|
||||
"default-src 'self'; script-src 'none'; sandbox; style-src 'unsafe-inline';",
|
||||
remotePatterns: [
|
||||
{ hostname: "**" },
|
||||
{ protocol: "https", hostname: "pbs.twimg.com" },
|
||||
{ protocol: "https", hostname: "abs.twimg.com" },
|
||||
],
|
||||
},
|
||||
|
||||
async generateBuildId() {
|
||||
return execSync(lastCommitCommand).toString().trim()
|
||||
},
|
||||
async generateBuildId() {
|
||||
return execSync(lastCommitCommand).toString().trim()
|
||||
},
|
||||
|
||||
serverRuntimeConfig: {
|
||||
ENV_REDIS_URL: process.env.REDIS_URL,
|
||||
ENV_REDIS_EXPIRE: process.env.REDIS_EXPIRE,
|
||||
ENV_REDIS_REFRESH: process.env.REDIS_REFRESH,
|
||||
ENV_NFTSCAN_API_KEY: process.env.NFTSCAN_API_KEY,
|
||||
ENV_OPENAI_API_KEY: process.env.OPENAI_API_KEY,
|
||||
ENV_ANONYMOUS_ACCOUNT_PRIVATEKEY:
|
||||
process.env.ANONYMOUS_ACCOUNT_PRIVATEKEY,
|
||||
},
|
||||
serverRuntimeConfig: {
|
||||
ENV_REDIS_URL: process.env.REDIS_URL,
|
||||
ENV_REDIS_EXPIRE: process.env.REDIS_EXPIRE,
|
||||
ENV_REDIS_REFRESH: process.env.REDIS_REFRESH,
|
||||
ENV_NFTSCAN_API_KEY: process.env.NFTSCAN_API_KEY,
|
||||
ENV_OPENAI_API_KEY: process.env.OPENAI_API_KEY,
|
||||
ENV_ANONYMOUS_ACCOUNT_PRIVATEKEY:
|
||||
process.env.ANONYMOUS_ACCOUNT_PRIVATEKEY,
|
||||
},
|
||||
|
||||
async headers() {
|
||||
return [
|
||||
{
|
||||
source: "/.well-known/apple-app-site-association",
|
||||
headers: [
|
||||
{
|
||||
key: "Content-Type",
|
||||
value: "application/json",
|
||||
},
|
||||
],
|
||||
},
|
||||
]
|
||||
},
|
||||
staticPageGenerationTimeout: 3600,
|
||||
async headers() {
|
||||
return [
|
||||
{
|
||||
source: "/.well-known/apple-app-site-association",
|
||||
headers: [
|
||||
{
|
||||
key: "Content-Type",
|
||||
value: "application/json",
|
||||
},
|
||||
],
|
||||
},
|
||||
]
|
||||
},
|
||||
staticPageGenerationTimeout: 3600,
|
||||
|
||||
async redirects() {
|
||||
return [
|
||||
{
|
||||
source: "/sitemap.txt",
|
||||
destination: "/sitemap.xml",
|
||||
permanent: true,
|
||||
},
|
||||
{
|
||||
source: "/sitemap.xml.gz",
|
||||
destination: "/sitemap.xml",
|
||||
permanent: true,
|
||||
},
|
||||
{
|
||||
source: "/sitemap_index.xml",
|
||||
destination: "/sitemap.xml",
|
||||
permanent: true,
|
||||
},
|
||||
{
|
||||
source: "/sitemaps.xml",
|
||||
destination: "/sitemap.xml",
|
||||
permanent: true,
|
||||
},
|
||||
]
|
||||
},
|
||||
}),
|
||||
),
|
||||
async redirects() {
|
||||
return [
|
||||
{
|
||||
source: "/sitemap.txt",
|
||||
destination: "/sitemap.xml",
|
||||
permanent: true,
|
||||
},
|
||||
{
|
||||
source: "/sitemap.xml.gz",
|
||||
destination: "/sitemap.xml",
|
||||
permanent: true,
|
||||
},
|
||||
{
|
||||
source: "/sitemap_index.xml",
|
||||
destination: "/sitemap.xml",
|
||||
permanent: true,
|
||||
},
|
||||
{
|
||||
source: "/sitemaps.xml",
|
||||
destination: "/sitemap.xml",
|
||||
permanent: true,
|
||||
},
|
||||
]
|
||||
},
|
||||
}),
|
||||
{
|
||||
// For all available options, see:
|
||||
// https://github.com/getsentry/sentry-webpack-plugin#options
|
||||
|
||||
@@ -157,7 +157,6 @@
|
||||
"zustand": "4.3.9"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@ducanh2912/next-pwa": "9.4.0",
|
||||
"@iconify/tailwind": "0.1.3",
|
||||
"@next/bundle-analyzer": "13.4.12",
|
||||
"@trivago/prettier-plugin-sort-imports": "4.2.0",
|
||||
|
||||
Generated
+25
-1695
File diff suppressed because it is too large
Load Diff
@@ -20,7 +20,7 @@
|
||||
},
|
||||
"Easy to get started text": "xLog supports <strong>web3 wallets</strong> and <strong>email</strong> connections, allowing you to quickly create a customized blog with features like a custom domain, subscriptions, comments, NFT minting, RSS feeds, and AI enhancements in just 5 minutes - with no application or costs required.",
|
||||
"Elegant experience text": "xLog offers a dual-pane editor with <strong>real-time preview</strong> for an excellent writing experience, using standard <axfm>Markdown syntax</axfm> with support for <strong>HTML</strong>, <strong>audio/video</strong>, and math expressions. The elegantly designed page provides a comfortable reading experience for readers.",
|
||||
"Fast text": "Blockchain doesn't always mean low efficiency. xLog operates at peak performance thanks to its efficient caching mechanism and numerous optimizations. The site also supports <strong>PWA</strong> for local installation and use.",
|
||||
"Fast text": "Blockchain doesn't always mean low efficiency. xLog operates at peak performance thanks to its efficient caching mechanism and numerous optimizations.",
|
||||
"Safe text": "All blog data, including configs, posts, subscriptions, comments, etc., are signed and securely stored on the <strong>blockchain</strong> with your own hands, with control only accessible through the <strong>private key</strong> held by yourself. No one else, including xLog, can make any changes.",
|
||||
"Customizable text": "You're free to use your <strong>own domain</strong>, customize your website, and <strong>design it</strong> in any way you like. This is your website, with no restrictions. xLog encourage and will provide a rich system of <strong>themes and plugins</strong> to help you customize it.",
|
||||
"Open text": "xLog offers import and export tools, as well as rich <strong>APIs</strong> and third-party <strong>integrations</strong>. All code is <strong>open source</strong> on GitHub, and all data is <strong>transparent</strong> on the blockchain. xLog has nothing to hide.",
|
||||
|
||||
@@ -39,7 +39,7 @@
|
||||
"Elegant experience": "優雅永不過時",
|
||||
"Elegant experience text": "雙欄編輯器,<strong>實時預覽</strong>,創作無壓力,使用標準的 <strong> Markdown 語法</strong> ,支持 <strong>HTML</strong> 、 <strong>音視頻</strong> 和 <strong>數學公式</strong>。頁面設計優雅,為讀者提供舒適的閱讀體驗。",
|
||||
"Fast": "一切精彩的背後",
|
||||
"Fast text": "區塊鏈低效?不!高效緩存機制和多種優化方案,激發區塊鏈的 <strong>極致性能</strong> ,同時提供 <strong>PWA</strong> 讓您輕鬆本地安裝和使用,加速實現目標!",
|
||||
"Fast text": "區塊鏈低效?不!高效緩存機制和多種優化方案,激發區塊鏈的 <strong>極致性能</strong>。",
|
||||
"Safe": "資安,我最在行",
|
||||
"Safe text": "所有資料,包括配置、文章、訂閱、留言等,都被安全地存儲在 <strong>區塊鏈</strong> 上。只有您持有的 <strong>私鑰</strong> 才能掌控和訪問這些資料,確保您的隱私得到最大程度的保護。",
|
||||
"Customizable": "創意,自由揮灑",
|
||||
|
||||
@@ -39,7 +39,7 @@
|
||||
"Safe": "安全",
|
||||
"Safe text": "所有博客数据,包括配置、文章、订阅、评论等,都由你自己签名并安全地存储在<strong>区块链</strong>上,只有你持有的<strong>私钥</strong>才能进行控制和访问。包括 xLog 在内的任何人都无法进行更改。",
|
||||
"Fast": "快速",
|
||||
"Fast text": "区块链并不总意味着低效率。xLog通过其高效的缓存机制和众多优化,可以达到最佳性能。站点还支持<strong>PWA</strong>用于本地安装和使用。",
|
||||
"Fast text": "区块链并不总意味着低效率。xLog通过其高效的缓存机制和众多优化,可以达到最佳性能。",
|
||||
"Customizable": "可定制",
|
||||
"Customizable text": "你可以自由地使用<strong>自己的域名</strong>、自定义网站并按自己的喜好进行<strong>设计</strong>。这是你的网站,没有任何限制。xLog 鼓励并将提供丰富的<strong>主题和插件</strong>系统,以帮助你进行自定义。",
|
||||
"Open": "开放",
|
||||
|
||||
Reference in New Issue
Block a user