Skip to content

Commit

Permalink
docs: 屏蔽文档打包时 anaylysis 服务,添加移除 console 的选项,移除无用依赖
Browse files Browse the repository at this point in the history
  • Loading branch information
boyongjiong committed Aug 19, 2024
1 parent c1171ab commit f6801fc
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 17 deletions.
3 changes: 0 additions & 3 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 4 additions & 1 deletion rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,10 @@ export function rollupConfig(config = {}) {
],
}),
nodePolyfills(),
terser({ sourceMap: true }),
terser({
sourceMap: true,
drop_console: true,
}),
fileSize({
reporter: [
async (options, bundle, result) => {
Expand Down
23 changes: 12 additions & 11 deletions sites/docs/.dumirc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -433,14 +433,15 @@ export default defineConfig({
},
'@ant-design/icons',
],
// [
// 'import',
// {
// libraryName: 'lodash-es',
// libraryDirectory: '',
// camel2DashComponentName: false
// }, 'lodash-es'
// ]
[
'import',
{
libraryName: 'lodash-es',
libraryDirectory: '',
camel2DashComponentName: false,
},
'lodash-es',
],
],
codeSplitting: { jsStrategy: 'granularChunks' },
chainWebpack: (config) => {
Expand All @@ -456,9 +457,9 @@ export default defineConfig({
]);

// 打开 bundle 分析器
config
.plugin('webpack-bundle-analyzer')
.use(require('webpack-bundle-analyzer').BundleAnalyzerPlugin);
// config
// .plugin('webpack-bundle-analyzer')
// .use(require('webpack-bundle-analyzer').BundleAnalyzerPlugin);
}

return config;
Expand Down
2 changes: 0 additions & 2 deletions sites/docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
"react-dom": ">=16.8"
},
"devDependencies": {
"@babel/plugin-transform-runtime": "^7.24.7",
"@types/react": "^18.2.17",
"@types/react-copy-to-clipboard": "^5.0.4",
"@types/react-dom": "^18.3.0",
Expand All @@ -30,7 +29,6 @@
},
"dependencies": {
"@ant-design/icons": "^5.0.1",
"@babel/runtime": "^7.25.0",
"@logicflow/core": "workspace:*",
"@logicflow/dumi-theme-simple": "^0.0.19",
"@logicflow/extension": "workspace:*",
Expand Down

0 comments on commit f6801fc

Please sign in to comment.