Skip to content

Disable AMD - #6018

Closed
martnu wants to merge 1 commit into
react:masterfrom
martnu:patch-1
Closed

Disable AMD#6018
martnu wants to merge 1 commit into
react:masterfrom
martnu:patch-1

Conversation

@martnu

@martnu martnu commented Dec 11, 2018

Copy link
Copy Markdown

Disable AMD and solve swagger client issues since there is no intention of supporting it:

#3247 (comment)

Disable AMD and solve swagger client issues since there is no intention of supporting it:

react#3247 (comment)
@martnu martnu changed the title Update webpack.config.js Disable AMD Dec 11, 2018
@Timer

Timer commented Dec 11, 2018

Copy link
Copy Markdown
Contributor

I've also seen an alternative way to disable AMD: https://github.com/webpack-contrib/imports-loader#disable-amd

Can you please explain the difference between the two?

p.s. thanks for the PR!

@Timer Timer added this to the 3.0 milestone Dec 11, 2018
@martnu

martnu commented Dec 11, 2018

Copy link
Copy Markdown
Author

@Timer Well, disabling it via module.rules.parser disables the entire AMD-plugin for webpack. (https://github.com/webpack/webpack/blob/ed9691585e5f5e8d8a6c5985465b85f5ea265011/lib/dependencies/AMDPlugin.js#L101)

While doing it via imports-loader sets the define-variable to false which is used to check for AMD in most UMD-modules. See https://github.com/umdjs/umd/blob/master/templates/commonjsStrict.js#L20

@Timer

Timer commented Dec 11, 2018

Copy link
Copy Markdown
Contributor

I just want to make sure we can still load a UMD module that specifies AMD and it's not broken using this proposed option. Can we add an e2e test for this, please?

@martnu martnu closed this Feb 17, 2019
@martnu
martnu deleted the patch-1 branch February 17, 2019 16:20
@Timer

Timer commented Feb 18, 2019

Copy link
Copy Markdown
Contributor

Hi @martnu! Could you please tell us why you closed this?

@martnu

martnu commented Feb 18, 2019

Copy link
Copy Markdown
Author

I suggest using another client generation language for swagger, for instance typescript-fetch. This will generate a commonjs-friendly client.

@Timer

Timer commented Feb 18, 2019

Copy link
Copy Markdown
Contributor

Sure, but we still want to disable AMD for other users!

@lock lock Bot locked and limited conversation to collaborators Feb 23, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants