globalize-webpack-plugin icon indicating copy to clipboard operation
globalize-webpack-plugin copied to clipboard

try to migrate from CommonChunksPlugin to optimization.splitChunks

Open jzaefferer opened this issue 6 years ago • 2 comments

Mostly following https://gist.github.com/sokra/1522d586b8e5c0f5072d7565c2bee693

I didn't get far though. Current output:

> [email protected] test /Users/joern.zaefferer/dev/other/globalize-webpack-plugin
> mocha test

  PatchedRawModule
    updateHash
      ✓ should produce the same hash for modules with the same source
      ✓ should produce different hashes for modules with different source

  Globalize Webpack Plugin
    Production Mode
      Custom tempdir
(node:17457) DeprecationWarning: Tapable.apply is deprecated. Call apply on the plugin directly instead
(node:17457) DeprecationWarning: Tapable.plugin is deprecated. Use new API on `.hooks` instead
No Globalize compiled data module found
(node:17457) DeprecationWarning: Chunk.forEachModule: Use for(const module of chunk.modulesIterable) instead
(node:17457) DeprecationWarning: Chunk.mapModules: Use Array.from(chunk.modulesIterable, fn) instead
        ✓ should extract formatters and parsers from basic code
        The compiled bundle
          1) "before all" hook for "should extract formatters and parsers from basic code"
      Default module ids
No Globalize compiled data module found
[...]


  6 passing (518ms)
  4 failing

  1) Globalize Webpack Plugin Production Mode Custom tempdir The compiled bundle "before all" hook for "should extract formatters and parsers from basic code":
     Error: ENOENT: no such file or directory, open '/Users/joern.zaefferer/dev/other/globalize-webpack-plugin/_test-output/tempdir/runtime.js'
      at Object.fs.openSync (fs.js:646:18)
      at Object.fs.readFileSync (fs.js:551:33)
      at Context.before (test/ProductionModePlugin.js:104:33)

[...]

jzaefferer avatar May 15 '18 10:05 jzaefferer

Tried a few more configuration properties, but nothing helped. I don't even understand what that runtime.js is supposed to do.

jzaefferer avatar May 15 '18 11:05 jzaefferer

I have an unfinished webpack-4 globalize example here: https://github.com/rxaviers/globalize/commit/1515713aad95debe22817fe7001f453920be7bf1. It could be useful...

rxaviers avatar May 15 '18 20:05 rxaviers