Skip to content

Commit

Permalink
try webpack changes for Rspack
Browse files Browse the repository at this point in the history
  • Loading branch information
goodroot committed Nov 25, 2024
1 parent f13b997 commit 4eaaa61
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 7 deletions.
3 changes: 1 addition & 2 deletions docusaurus.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -89,13 +89,12 @@ const config = {
function (context, options) {
return {
name: 'development-redirects',
configureWebpack(config, isServer, utils) {
configureWebpack(config, isServer, { currentBundler }) {
if (process.env.NODE_ENV === 'development') {
return {
devServer: {
onBeforeSetupMiddleware: function (devServer) {
devServer.app.get('*', function (req, res, next) {
// If path doesn't start with /docs, redirect to Next.js
if (!req.path.startsWith('/docs/')) {
return res.redirect(`http://localhost:3000${req.path}`)
}
Expand Down
5 changes: 2 additions & 3 deletions plugins/manifest/index.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
const { WebpackManifestPlugin } = require("webpack-manifest-plugin")

module.exports = () => ({
name: "manifest",
configureWebpack: (_, isServer) => {
configureWebpack: (config, isServer, { currentBundler }) => {
const { WebpackManifestPlugin } = currentBundler.instance.require("webpack-manifest-plugin")
return {
plugins: isServer
? []
Expand Down
3 changes: 1 addition & 2 deletions plugins/optimize/index.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
module.exports = () => ({
name: "optimize",
configureWebpack: (_, isServer) => {
configureWebpack: (config, isServer, { currentBundler }) => {
return {
optimization: {
runtimeChunk: false,
splitChunks: isServer
? false
: {
// name: true, // Does not exist anymore, see https://webpack.js.org/blog/2020-10-10-webpack-5-release/
cacheGroups: {
common: {
name: "common",
Expand Down

0 comments on commit 4eaaa61

Please sign in to comment.