Skip to content

Commit

Permalink
🔧 config: close ssr
Browse files Browse the repository at this point in the history
  • Loading branch information
eternallycyf committed Sep 1, 2024
1 parent 7b6187e commit 364e6ac
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 6 deletions.
14 changes: 13 additions & 1 deletion .dumirc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ export default defineConfig({
targets: { chrome: 79 },
codeSplitting: { jsStrategy: 'granularChunks' },
themeConfig,
ssr: isProd ? {} : false,
ssr: false,
extraBabelPlugins: ['antd-style'],
hash: true,
mock: {},
Expand All @@ -97,4 +97,16 @@ export default defineConfig({
entryFile: './src/index.ts',
codeBlockMode: 'passive',
},
chainWebpack(config) {
// 配置 worker-loader 处理 .worker 文件
config.module
.rule('worker')
.test(/\.worker\.js$/)
.use('worker-loader')
.loader('worker-loader')
.options({
inline: 'no-fallback', // 或者 'fallback', 根据需求选择
filename: '[name].[hash].worker.js',
});
},
});
16 changes: 11 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -64,16 +64,20 @@
]
},
"resolutions": {
"dumi": "~2.2.17",
"react": "~18.2.x",
"react-dom": "~18.2.x"
},
"dependencies": {
"@babel/runtime": "^7.23.1",
"@babel/standalone": "^7.24.5",
"@monaco-editor/react": "^4.6.0",
"@typescript/ata": "^0.9.4",
"@typescript/ata": "^0.9.6",
"allotment": "^1.20.0",
"classnames": "^2.5.1",
"copy-to-clipboard": "^3.3.3",
"fflate": "^0.8.2",
"file-saver": "^2.0.5",
"jszip": "^3.10.1",
"monaco-editor": "^0.48.0",
"react": "^18.2.0",
"react-dom": "^18.2.0",
Expand All @@ -85,6 +89,7 @@
"@testing-library/react": "^14",
"@types/babel__core": "^7.20.5",
"@types/babel__standalone": "^7.1.7",
"@types/file-saver": "^2.0.7",
"@types/lodash": "^4.14.199",
"@types/react": "^18.2.0",
"@types/react-dom": "^18.2.0",
Expand All @@ -98,8 +103,8 @@
"concurrently": "^7",
"conventional-changelog-gitmoji-config": "^1",
"cross-env": "^7",
"dumi": "~2.2.17",
"dumi-theme-antd-style": "^0.29.5",
"dumi": "latest",
"dumi-theme-antd-style": "latest",
"eslint": "^8",
"father": "^4",
"husky": "^8",
Expand All @@ -113,7 +118,8 @@
"semantic-release": "^20",
"semantic-release-config-gitmoji": "^1",
"stylelint": "^15",
"vitest": "latest"
"vitest": "latest",
"worker-loader": "^3.0.8"
},
"peerDependencies": {
"@ant-design/icons": "^5.2.6",
Expand Down

0 comments on commit 364e6ac

Please sign in to comment.