程序问答   发布时间:2022-06-02  发布网站:大佬教程  code.js-code.com
大佬教程收集整理的这篇文章主要介绍了Webpack - 节点模块'TypeError: ...replace is not a function'大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。

如何解决Webpack - 节点模块'TypeError: ...replace is not a function'?

开发过程中遇到Webpack - 节点模块'TypeError: ...replace is not a function'的问题如何解决?下面主要结合日常开发的经验,给出你关于Webpack - 节点模块'TypeError: ...replace is not a function'的解决方法建议,希望对你解决Webpack - 节点模块'TypeError: ...replace is not a function'有所启发或帮助;

我曾尝试查看诸如 this 之类的相关答案,但它们都非常不同,因此希望有人能指导我一下。我对 webpack 很陌生,刚刚将我的烧瓶应用程序更新为新的引导程序主题。在 docker build 中,我突然在命令 yard run 中收到错误消息。有趣的是,之前的 git commit 构建得很好,当我恢复到它时,它现在也会出现相同的错误。

TypeError: prevIoUsExtractedCommentssource.replace is not a function
at Object.callBACk (/app/assets/node_modules/terser-webpack-plugin/dist/index.Js:320:43)
at enqueue (/app/assets/node_modules/terser-webpack-plugin/dist/index.Js:450:14)

This answer 表明这可能是代码拼写错误,但如果是这样,我将如何找到它?

我的 webpack.config.Js,以防万一:

var { merge } = require('webpack-merge');
var webpack = require('webpack');
var copyWebpackPlugin = require('copy-webpack-plugin');
var MiniCSSExtractPlugin = require('mini-css-extract-plugin');
var OptimizeCSSAssetsPlugin = require('optimize-css-assets-webpack-plugin');
var TerserPlugin = require('terser-webpack-plugin');

var common = {
  watchOptions: {
    poll: (process.env.WEBPACK_WATCHER_PolL || 'true') === 'true'
  },module: {
    rules: [
      {
        test: /\.Js$/,exclude: [/node_modules/],loader: 'babel-loader'
      },{
        test: [/\.sCSS$/,/\.CSS$/],use: [
          MiniCSSExtractPlugin.loader,'css-loader','postcss-loader','sass-loader'
        ]
      },{
        test: /\.(png|jpg|gif|svg)$/,exclude: /Fonts/,loader: 'file-loader?name=/images/[name].[ext]'
      },{
        test: /\.(ttf|eot|svg|woff2?)$/,exclude: /images/,use: [{
          loader: 'file-loader',options: {
            name: '[name].[ext]',outputPath: 'Fonts/',publicPath: '../Fonts'
          }
        }]
      }
    ]
  },optimization: {
    minimizer: [
      new TerserPlugin({Cache: true,parallel: true,sourceMap: falsE}),new OptimizeCSSAssetsPlugin({})
    ]
  }
};

module.exports = [
  merge(common,{
    entry: [
      __dirname + '/app/app.sCSS',__dirname + '/app/app.Js'
    ],output: {
      path: __dirname + '/../public',filename: 'Js/app.Js'
    },resolve: {
      modules: [
        '/node_modules',__dirname + '/app'
      ]
    },plugins: [
      new copyWebpackPlugin({patterns: [{from: __dirname + '/static'}]}),new MiniCSSExtractPlugin({filename: 'CSS/app.CSS'}),new webpack.ProvIDePlugin({$: 'jquery',jquery: 'jquery'}),]
  })
];

我很感激任何帮助。谢谢

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)

大佬总结

以上是大佬教程为你收集整理的Webpack - 节点模块'TypeError: ...replace is not a function'全部内容,希望文章能够帮你解决Webpack - 节点模块'TypeError: ...replace is not a function'所遇到的程序开发问题。

如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。

本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。