npm @rspack/cli 0.3.7
v0.3.7

latest releases: 0.7.6-canary-fd6c40d-20240918093542, 1.0.5, 1.0.4...
11 months ago

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 #4228
  • feat: handle react-refresh resolving in @rspack/plugin-react-refresh by @h-a-n-a in #4267
  • feat: support Compilation.namedChunks by @h-a-n-a in #4255
  • feat: source order for harmony import dependency by @ahabhgk in #4262
  • feat(rspack_core): configurable tsconfig project references by @Boshen in #4290
  • feat(split chunks): split chunks should consider chunk combinations by @JSerFeng in #4280
  • feat: Adding runtime param when executing codegen by @IWANABETHATGUY in #4263
  • feat: comment test markdown for webpack-test by @ahabhgk in #4316
  • feat(plugin-copy): support info option by @JSerFeng in #3949

Bug Fixes 🐞

Other Changes

New Contributors

Full Changelog: v0.3.6...v0.3.7

Don't miss a new cli release

NewReleases is sending notifications on new releases.