将preg_replace替换为preg_replace_callback()

时间:2019-05-23 09:46:14

标签: php preg-replace preg-replace-callback

我使用了PHP7,我需要将preg_replace的插件中的两行替换为preg_replace_callback()。我觉得这很简单,但我不知道如何解决。

    module.exports = {
      //...
      optimization: {
        splitChunks: {
          chunks: 'async',
          minSize: 30000,
          maxSize: 0,
          minChunks: 1,
          maxAsyncRequests: 5,
          maxInitialRequests: 3,
          automaticNameDelimiter: '~',
          name: true,
          cacheGroups: {
            vendors: {
              test: /[\\/]node_modules[\\/]/, // this is what you are looking for
              priority: -10
            },
            default: {
              minChunks: 2,
              priority: -20,
              reuseExistingChunk: true
            }
          }
        }
      }
    };

0 个答案:

没有答案