Uh wtf? Here's the content of a file, `webpack.con...
# javascript
r
Uh wtf? Here's the content of a file,
webpack.config.d/chunk.js
Copy code
config.optimization = {
    moduleIds: 'hashed',
    runtimeChunk: 'single',
    splitChunks: {
        cacheGroups: {
            vendor: {
                test: /[\\/]node_modules[\\/]/,
                name: function(module) {
                    const packageName = module.context.match(/[\\/]node_modules[\\/](.*?)([\\/]|$)/)[1];
                    return `npm.${packageName.replace('@', '')}`;
                }
            }
        }
    }
};
And here's the matching
webpack.evaluated.config.js
part:
Copy code
optimization: {
    moduleIds: 'hashed',
    runtimeChunk: 'single',
    splitChunks: {
      cacheGroups: {
        vendor: {
          test: /[\\\/]node_modules[\\\/]/,
          name: [Function: name]
        }
      }
    }
  }
What should I do with that?
youtrack 1
t
Kotlin
1.3.61
?
r
Yes
I'm opening an issue
t
I test it on
1.3.70-eap-274
- no problem detected (possibly resolved).
i
Yes, it is because it is string snapshot of real webpack configuration. But webpack should work as well with appropriate configuration. Because in fact webpack config is in
build/js/packages/module-name/webpack.config.js
webpack.evaluated.config.js
is only for debug issues because it is convinient way to get real declarative webpack config. What exactly the problem? How do you use this file?
r
You’re right, it looks like it actually works on my Mac. The
evaluated
content isn’t right but the right code is still executed. I thought it was not working because it actually wasn’t on Windows, I guess the function’s regex don’t work on Windows for some reason. It’s weird because the regexes do use
[\\/]
as file separator...