Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • C create-react-app
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 1,547
    • Issues 1,547
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 417
    • Merge requests 417
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Meta
  • create-react-app
  • Issues
  • #7741
Closed
Open
Issue created Sep 26, 2019 by Administrator@rootContributor

Set output.globalObject to `this`

Created by: kentcdodds

When using workerize-loader, things work great (it's a fantastic tool), except that it does not work in dev mode. This is because HotModuleReplacement gets loaded into the webworker and the HMR file references window.

Describe the solution you'd like

I'd like to have the webpack configuration set output.globalObject to 'this'. The default is 'window'. Changing it to 'this' will have no negative impact on existing or future users, and it will allow people to begin using workerize-loader without ejecting.

Describe alternatives you've considered

You can manually modify the configuration in node_modules (and just remember to do that anytime you re-install deps). Or you can eject.

Additional context

Before:

image

After:

image

This code is generated from this template:

https://github.com/webpack/webpack/blob/ba20513223607eaccb615c8ffabe824413b1613c/lib/web/JsonpMainTemplatePlugin.js#L603-L606

Assignee
Assign to
Time tracking