Skip to content

Commit

Permalink
Merge pull request #6970 from alibaba/release/next
Browse files Browse the repository at this point in the history
Release 3.4.11
  • Loading branch information
ClarkXia authored Aug 15, 2024
2 parents 2928447 + 9c22816 commit 61d7c95
Show file tree
Hide file tree
Showing 9 changed files with 52 additions and 10 deletions.
9 changes: 9 additions & 0 deletions packages/ice/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
# Changelog

## 3.4.11

### Patch Changes

- a7a6183b: fix: modify meta.renderer in server runner
- Updated dependencies [eb7e71eb]
- Updated dependencies [47a5773a]
- @ice/rspack-config@1.1.9

## 3.4.10

### Patch Changes
Expand Down
4 changes: 2 additions & 2 deletions packages/ice/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@ice/app",
"version": "3.4.10",
"version": "3.4.11",
"description": "provide scripts and configuration used by web framework ice",
"type": "module",
"main": "./esm/index.js",
Expand Down Expand Up @@ -52,7 +52,7 @@
"@ice/runtime": "^1.4.10",
"@ice/shared-config": "1.2.8",
"@ice/webpack-config": "1.1.15",
"@ice/rspack-config": "1.1.8",
"@ice/rspack-config": "1.1.9",
"@swc/helpers": "0.5.1",
"@types/express": "^4.17.14",
"address": "^1.1.2",
Expand Down
2 changes: 1 addition & 1 deletion packages/ice/src/service/ServerRunner.ts
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ class ServerRunner extends Runner {
super({
rootDir,
meta: {
renderer: 'client',
renderer: 'server',
target: 'web',
},
resolveId: async (id, importer) => {
Expand Down
2 changes: 1 addition & 1 deletion packages/plugin-i18n/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
"webpack-dev-server": "4.15.0"
},
"peerDependencies": {
"@ice/app": "^3.4.10",
"@ice/app": "^3.4.11",
"@ice/runtime": "^1.4.11"
},
"publishConfig": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@ export default function HeadStreamErrorRecoverScript({ downgradeCSRHostname }) {
window.location.hostname = '${downgradeCSRHostname}';
}
})`,
}
}
}}
crossOrigin="anonymous"
/>
);
Expand Down
7 changes: 7 additions & 0 deletions packages/rspack-config/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# @ice/rspack-config

## 1.1.9

### Patch Changes

- eb7e71eb: feat: align copy plugin with webpack mode
- 47a5773a: fix: support compileDendencies in speedup mode

## 1.1.8

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/rspack-config/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@ice/rspack-config",
"version": "1.1.8",
"version": "1.1.9",
"repository": "alibaba/ice",
"bugs": "https://github.com/alibaba/ice/issues",
"homepage": "https://v3.ice.work",
Expand Down
31 changes: 29 additions & 2 deletions packages/rspack-config/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -109,12 +109,13 @@ const getConfig: GetConfig = async (options) => {
fastRefresh,
sourceMap,
https,
enableCopyPlugin,
} = taskConfig || {};
const isDev = mode === 'development';
const absoluteOutputDir = path.isAbsolute(outputDir) ? outputDir : path.join(rootDir, outputDir);
const hashKey = hash === true ? 'hash:8' : (hash || '');

const { rspack: { DefinePlugin, ProvidePlugin, SwcJsMinimizerRspackPlugin } } = await import('@ice/bundles/esm/rspack.js');
const { rspack: { DefinePlugin, ProvidePlugin, SwcJsMinimizerRspackPlugin, CopyRspackPlugin } } = await import('@ice/bundles/esm/rspack.js');
const cssFilename = `css/${hashKey ? `[name]-[${hashKey}].css` : '[name].css'}`;
// get compile plugins
const compilerWebpackPlugins = getCompilerPlugins(rootDir, {
Expand Down Expand Up @@ -169,7 +170,16 @@ const getConfig: GetConfig = async (options) => {
if (!compileIncludes || compileIncludes?.length === 0) {
excludeRule = 'node_modules';
} else if (!compileIncludes?.includes('node_modules') && compileIncludes?.length > 0) {
excludeRule = `node_modules[\\/](?!${compileIncludes.map((pkg: string) => {
const flattenIncludes = [];
compileIncludes.forEach((pkg) => {
if (typeof pkg === 'string') {
flattenIncludes.push(pkg);
} else {
// The RegExp type of pkg may include multiple source paths.
flattenIncludes.push(...pkg.source.split('|'));
}
});
excludeRule = `node_modules[\\/](?!${flattenIncludes.map((pkg: string) => {
return `${pkg}[\\/]|_${pkg.replace('/', '_')}@[^/]+[\\/]`;
}).join('|')}).*`;
}
Expand Down Expand Up @@ -280,6 +290,23 @@ const getConfig: GetConfig = async (options) => {
process: [require.resolve('process/browser')],
}),
!!minify && new SwcJsMinimizerRspackPlugin(jsMinimizerPluginOptions),
(enableCopyPlugin || !isDev) && new CopyRspackPlugin({
patterns: [{
from: path.join(rootDir, 'public'),
to: absoluteOutputDir,
// ignore assets already in compilation.assets such as js and css files
force: false,
noErrorOnMissing: true,
// Skip minimization by default.
info: {
minimized: true,
},
globOptions: {
dot: true,
gitignore: true,
},
}],
}),
].filter(Boolean),
builtins: {
css: {
Expand Down
2 changes: 1 addition & 1 deletion pnpm-lock.yaml

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

0 comments on commit 61d7c95

Please sign in to comment.