代码拉取完成,页面将自动刷新
同步操作将从 vertx-china/vertx-web-site 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
const mdxOptions = require("./components/lib/mdx-options")
const svgToMiniDataURI = require("mini-svg-data-uri")
const withPlugins = require("next-compose-plugins")
const isProd = process.env.NODE_ENV === "production"
const mdx = require("@next/mdx")({
options: mdxOptions
})
// configure base path based on environment variable `VERTX_WEBSITE_BASEPATH`
const basePath = (() => {
let p = process.env.VERTX_WEBSITE_BASEPATH || ""
if (!p.startsWith("/")) {
p = `/${p}`
}
if (p.endsWith("/")) {
p = p.substring(0, p.length - 1)
}
return p
})()
const config = {
env: {
basePath,
// URL to the website. MUST NOT end with a slash.
baseUrl: isProd ? `https://vertx.io${basePath}` : `http://localhost:3000${basePath}`,
buildDate: new Date().toISOString()
},
// also render markdown pages
pageExtensions: ["js", "jsx", "md", "mdx"],
// create a folder for each page
trailingSlash: true,
// opt-in to using SWC for minifying JavaScript
// (does not work with the docs search panel yet!)
// swcMinify: true,
// configure base path
basePath,
assetPrefix: basePath,
eslint: {
dirs: ["components", "pages", "docs/metadata"]
},
images: {
// make build compatible with next-optimized-images
disableStaticImages: true
},
// list pages to export
exportPathMap() {
return {
"/": { page: "/" },
"/blog": { page: "/blog/[[...slug]]" },
"/channels": { page: "/channels" },
"/community": { page: "/community" },
"/docs": { page: "/docs/[[...slug]]" },
"/download": { page: "/download" },
"/faq": { page: "/faq" },
"/get-started": { page: "/get-started" },
"/introduction-to-vertx-and-reactive": { page: "/introduction-to-vertx-and-reactive" },
"/materials": { page: "/materials" },
"/translation": { page: "/translation" }
}
},
webpack: (config, { dev, defaultLoaders }) => {
config.module.rules.push({
test: /\.scss$/,
use: [
defaultLoaders.babel,
{
loader: require("styled-jsx/webpack").loader,
options: {
type: (fileName, options) => options.query.type || "scoped"
}
},
"sass-loader"
]
})
config.module.rules.push({
test: /\.(gif|png|jpe?g)$/i,
type: "asset",
use: "image-webpack-loader"
})
config.module.rules.push({
test: /\.svg$/i,
type: "asset",
use: "image-webpack-loader",
generator: {
dataUrl: content => {
content = content.toString()
return svgToMiniDataURI(content)
}
}
})
if (dev) {
config.module.rules.push({
test: /\.jsx?$/,
loader: "eslint-loader",
exclude: [/node_modules/, /\.next/, /out/],
enforce: "pre",
options: {
emitWarning: true
}
})
}
return config
}
}
module.exports = withPlugins([
[mdx]
], config)
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。