Skip to content

Commit

Permalink
Change the extension path to not expand to sub-directories to stop OO…
Browse files Browse the repository at this point in the history
…M error.

After upgrading to 2.0, I was consistently running out of RAM when trying to run webpack.

After some digging, I came across a comment on the webpack project that helped shed some light.

webpack/webpack#1914 (comment)

It seems that in PR 201 (rails#201), the `extensionGlob`
was changed from `*{${paths.extensions.join(',')}}*` to `**/*{${paths.extensions.join(',')}}*`

This change removes the `**/` in the extension and fixes my OOM issue.

I am not sure about the ramifications for allowing pack files in subdirectories
(the original intent of the PR that introduced the change). Maybe we need a comment or a
flag when generating the configuration that will set it one way or the other?
  • Loading branch information
Rob Di Marco committed May 24, 2017
1 parent 79b0c59 commit 6bdd76e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/install/config/webpack/shared.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const ManifestPlugin = require('webpack-manifest-plugin')
const extname = require('path-complete-extname')
const { env, settings, output, loadersDir } = require('./configuration.js')

const extensionGlob = `**/*{${settings.extensions.join(',')}}*`
const extensionGlob = `*{${settings.extensions.join(',')}}*`
const entryPath = join(settings.source_path, settings.source_entry_path)
const packPaths = sync(join(entryPath, extensionGlob))

Expand Down

0 comments on commit 6bdd76e

Please sign in to comment.