Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provide UMD in 'window' by default #11

Open
andersevenrud opened this issue Jan 5, 2019 · 0 comments
Open

Provide UMD in 'window' by default #11

andersevenrud opened this issue Jan 5, 2019 · 0 comments
Assignees
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed

Comments

@andersevenrud
Copy link
Member

To prevent additional build sizes of applications, @osjs/gui could be provded by the service provider this package provides via window.osjsGui just as the UMD module does.

As far as I know there's no way to use a webpack generated module as both a global and included module. So if I were to do window.osjsGui = osjsGui where import * as osjsGui from 'index.js' would not create a ES5 compatible object since they all will be of the type Module.

Would be nice to sort this out without loading an additional @osjs/gui bundle file.


This way apps can just use this in the webpack config instead of having it as a dependency:

module.export = {
  externals: {
    '@osjs/gui': 'osjsGui'
  }
};

No changes required in the actual implementations:

import {foo} from '@osjs/gui';
@andersevenrud andersevenrud added the enhancement New feature or request label Jan 5, 2019
@andersevenrud andersevenrud self-assigned this Jan 5, 2019
@andersevenrud andersevenrud added the help wanted Extra attention is needed label Jan 5, 2019
@andersevenrud andersevenrud added the good first issue Good for newcomers label Jan 17, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

1 participant