v0.3.7
版本发布时间: 2023-10-17 20:03:48
web-infra-dev/rspack最新发布版本:v0.3.13(2023-11-15 21:30:09)
Highlights
experiments.rspackFuture.newResolver
This feature enables the new resolver implementation provided by oxc, which is 5 times faster than the previous resolver implementation.
The new resolver also supports tsconfig project references defined in tsconfig-paths-webpack-plugin, which handles the support of nested paths alias inside project references.
To fully opt-in this feature, use the following configuration or see resolve.tsConfig
for details.
module.exports = {
resolve: {
tsconfig: {
configFile: path.resolve(__dirname, './tsconfig.json'),
references: 'auto'
},
}
experiments: {
rspackFuture: {
newResolver: true
}
}
}
styled-components support
This feature enables the builtin:swc-loader
to provide compile-time support for styled-components. Now you can configure it through options.rspackExperiments.styledComponents
.
/** @type {import('@rspack/core').Configuration}*/
module.exports = {
module: {
rules: [
{
test: /\.jsx?$/,
loader: "builtin:swc-loader",
options: {
jsc: {
parser: {
syntax: "ecmascript",
jsx: true
}
},
rspackExperiments: {
styledComponents: {
displayName: true,
ssr: true,
fileName: true,
meaninglessFileNames: ["index", "styles"],
namespace: "rspack-test",
topLevelImportPaths: [
"@xstyled/styled-components",
"@xstyled/styled-components/*"
],
transpileTemplateLiterals: true,
minify: true,
pure: true,
cssProps: true
}
}
}
}
]
}
};
SWC's support for styled-components is essentially aligned with the official Babel plugin, so you can visit babel-plugin-styled-components for more information.
Vue2 css extract support
Finished support for experiments.css for Vue2, you can extract css with our custom vue-loader (@rspack/loader-vue2). First, add our custom vue-loader to package.json
{
"devDependencies": {
"vue": "2.7.14",
"vue-loader": "npm:@rspack/loader-vue2@15.10.1-alpha.0"
}
}
Then, enable vue-loader with experimentalInlineMatchResource
just like how you did with Vue3:
const { VueLoaderPlugin } = require("vue-loader");
module.exports = {
plugins: [new VueLoaderPlugin()],
module: {
rules: [
{
test: /\.vue$/,
use: [
{
loader: "vue-loader",
options: {
// to extract css, you should enable this
experimentalInlineMatchResource: true
}
}
]
}
]
},
experiments: {
css: true
}
};
Check out the example for details.
Rspress 1.0
Rspress is a static site generator based on Rspack and mdx-rs. It is 5~10 times faster than Docusaurus/Nextra and supports lots of nice features out of the box, such as i18n, full-text search, component preview and etc. See detail in https://github.com/orgs/web-infra-dev/discussions/5
What's Changed
Exciting New Features 🎉
- feat: implement styled_components visitor by @Asuka109 in https://github.com/web-infra-dev/rspack/pull/4228
- feat: handle
react-refresh
resolving in@rspack/plugin-react-refresh
by @h-a-n-a in https://github.com/web-infra-dev/rspack/pull/4267 - feat: support
Compilation.namedChunks
by @h-a-n-a in https://github.com/web-infra-dev/rspack/pull/4255 - feat: source order for harmony import dependency by @ahabhgk in https://github.com/web-infra-dev/rspack/pull/4262
- feat(rspack_core): configurable tsconfig project references by @Boshen in https://github.com/web-infra-dev/rspack/pull/4290
- feat(split chunks): split chunks should consider chunk combinations by @JSerFeng in https://github.com/web-infra-dev/rspack/pull/4280
- feat: Adding runtime param when executing codegen by @IWANABETHATGUY in https://github.com/web-infra-dev/rspack/pull/4263
- feat: comment test markdown for webpack-test by @ahabhgk in https://github.com/web-infra-dev/rspack/pull/4316
- feat(plugin-copy): support info option by @JSerFeng in https://github.com/web-infra-dev/rspack/pull/3949
Bug Fixes 🐞
- fix: rspack builtin.html.meta.* support Record<string, string> by @jerrykingxyz in https://github.com/web-infra-dev/rspack/pull/4294
- fix(4314): remove help info print when throw error by @OceanPresentChao in https://github.com/web-infra-dev/rspack/pull/4322
- fix: detect cjs assign esModule mark by @ahabhgk in https://github.com/web-infra-dev/rspack/pull/4330
Other Changes
- chore: add github-sync-issue by @hardfist in https://github.com/web-infra-dev/rspack/pull/4281
- chore: move sync workflow by @hardfist in https://github.com/web-infra-dev/rspack/pull/4282
- chore: try free disk for linux by @hardfist in https://github.com/web-infra-dev/rspack/pull/4287
- build: static link msvc runtime on Windows x86_64 platform by @Brooooooklyn in https://github.com/web-infra-dev/rspack/pull/4283
- chore: only remove android sdk by @hardfist in https://github.com/web-infra-dev/rspack/pull/4288
- chore(core): Optimization of compilation duration unit by @cunzaizhuyi in https://github.com/web-infra-dev/rspack/pull/4264
- chore: enable more webpack-test by @ahabhgk in https://github.com/web-infra-dev/rspack/pull/4302
- chore: fix nestjs example by @hardfist in https://github.com/web-infra-dev/rspack/pull/4308
- chore: remove unused imports by @bvanjoi in https://github.com/web-infra-dev/rspack/pull/4312
- chore: update vue2 example using experiments.css by @hardfist in https://github.com/web-infra-dev/rspack/pull/4292
New Contributors
- @cunzaizhuyi made their first contribution in https://github.com/web-infra-dev/rspack/pull/4264
- @OceanPresentChao made their first contribution in https://github.com/web-infra-dev/rspack/pull/4322
Full Changelog: https://github.com/web-infra-dev/rspack/compare/v0.3.6...v0.3.7