christophebe / strapi-julius-editor

3 stars 1 forks source link

[BUG]: TypeError: webpack.NormalModuleReplacementPlugin is not a constructor #3

Open danOcoder opened 2 weeks ago

danOcoder commented 2 weeks ago

Version │ 4.25.1 (node v20.14.0)

Hi,

Any suggestions for getting around this build error? If not please feel free to close this.

Cheers

christophebe commented 1 week ago

Hi,

Weird! I haven't yet migrated to v 4.25.1. I'll check on this version.

Here's my webpack.config.js. Do you have the same ?

"use strict;

const webpack = require("webpack") ;

/* eslint-disable no-unused-vars */
module.exports = (config) => {
  // Required for julius/tiptap editor integration
  // This is because tippy.js has no ES6 module, and a tiptap dependency imports it
  config.plugins.push(
    new webpack.NormalModuleReplacementPlugin(
      /^tippy\.js$/,
      "tippy.js/dist/tippy-bundle.umd.min.js"
    )
  ) ;
  return config ;
} ;