代码拉取完成,页面将自动刷新
同步操作将从 Gitee 极速下载/Material-UI 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
const webpack = require('webpack');
const pkg = require('./package.json');
const withTM = require('@weco/next-plugin-transpile-modules');
const { BundleAnalyzerPlugin } = require('webpack-bundle-analyzer');
const { findPages } = require('./docs/src/modules/utils/find');
process.env.LIB_VERSION = pkg.version;
module.exports = {
webpack: (config, options) => {
// Alias @material-ui/core peer dependency imports form the following modules to our sources.
config = withTM({
transpileModules: ['notistack', 'material-ui-pickers'],
}).webpack(config, options);
const plugins = config.plugins.concat([
new webpack.DefinePlugin({
'process.env': {
LIB_VERSION: JSON.stringify(process.env.LIB_VERSION),
},
}),
]);
if (process.env.DOCS_STATS_ENABLED) {
plugins.push(
// For all options see https://github.com/th0r/webpack-bundle-analyzer#as-plugin
new BundleAnalyzerPlugin({
analyzerMode: 'server',
generateStatsFile: true,
// Will be available at `.next/stats.json`
statsFilename: 'stats.json',
}),
);
}
return Object.assign({}, config, {
plugins,
node: {
fs: 'empty',
},
module: Object.assign({}, config.module, {
rules: config.module.rules.concat([
{
test: /\.(css|md)$/,
loader: 'emit-file-loader',
options: {
name: 'dist/[path][name].[ext]',
},
},
{
test: /\.(css|md)$/,
loader: 'raw-loader',
},
]),
}),
});
},
webpackDevMiddleware: config => config,
// next.js also provide a `defaultPathMap` so we could simplify the logic.
// However, we keep it in order to prevent any future regression on the `findPages()` side.
exportPathMap: () => {
const map = {};
function generateMap(pages) {
pages.forEach(page => {
if (!page.children) {
map[page.pathname] = {
page: page.pathname,
};
return;
}
generateMap(page.children);
});
}
generateMap(findPages());
return map;
},
onDemandEntries: {
// Period (in ms) where the server will keep pages in the buffer
maxInactiveAge: 120 * 1e3, // default 25s
// Number of pages that should be kept simultaneously without being disposed
pagesBufferLength: 3, // default 2
},
};
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。