33
44const path = require ( "path" ) ;
55const { createHash } = require ( "crypto" ) ;
6- const webpack = require ( "webpack" ) ;
76const _ = require ( "lodash" ) ;
8- const CopyPlugin = require ( "copy-webpack-plugin" ) ;
97const MonacoEditorWebpackPlugin = require ( "monaco-editor-webpack-plugin" ) ;
108
119const originalFilePath = path . resolve (
@@ -109,6 +107,10 @@ const config = {
109107 onBrokenLinks : "throw" ,
110108 onBrokenMarkdownLinks : "warn" ,
111109
110+ future : {
111+ experimental_faster : true ,
112+ } ,
113+
112114 // Even if you don't use internalization, you can use this field to set useful
113115 // metadata like html lang. For example, if your site is Chinese, you may want
114116 // to replace "en" with "zh-Hans".
@@ -234,7 +236,7 @@ const config = {
234236 plugins : [
235237 ( ) => ( {
236238 name : "docusaurus-next-runtime" ,
237- configureWebpack ( ) {
239+ configureWebpack ( config , isServer , { currentBundler } ) {
238240 const previewDir = path . join (
239241 require . resolve ( "@next-core/preview/package.json" ) ,
240242 "../dist"
@@ -252,18 +254,10 @@ const config = {
252254 test : / \. y a m l / ,
253255 type : "asset/source" ,
254256 } ,
255- {
256- // This file contains static initialization blocks which are not supported until Chrome 94
257- test : / [ \\ / ] n o d e _ m o d u l e s [ \\ / ] m o n a c o - e d i t o r [ \\ / ] e s m [ \\ / ] v s [ \\ / ] l a n g u a g e [ \\ / ] t y p e s c r i p t [ \\ / ] t s M o d e \. j s $ / ,
258- loader : "babel-loader" ,
259- options : {
260- rootMode : "upward" ,
261- } ,
262- } ,
263257 ] ,
264258 } ,
265259 plugins : [
266- new CopyPlugin ( {
260+ new currentBundler . instance . CopyRspackPlugin ( {
267261 patterns : [
268262 {
269263 from : previewDir ,
@@ -309,7 +303,7 @@ const config = {
309303 ] ,
310304 filename : `workers/[name].[contenthash:8].worker.js` ,
311305 } ) ,
312- new webpack . NormalModuleReplacementPlugin (
306+ new currentBundler . instance . NormalModuleReplacementPlugin (
313307 new RegExp ( `^${ _ . escapeRegExp ( originalFilePath ) } $` ) ,
314308 // Refactor without 'd' flag of RegExp
315309 path . resolve ( __dirname , "src/replaces/findSectionHeaders.js" )
0 commit comments