webpack-contrib / imports-loader

Imports Loader
MIT License
520 stars 63 forks source link

define=>false in 0.8.0 doesn't work in 1.1.0 #83

Closed thegrandpoobah closed 4 years ago

thegrandpoobah commented 4 years ago

In Imports-Loader 0.8.0, you could use define=>false to short circuit AMD modules in older style jQuery plugins (see https://stackoverflow.com/questions/35531126/how-to-use-scrollmagic-with-gsap-and-webpack). However this functionality seems to have changed in 1.1.0 and I'm not exactly sure what the new style should be. I've tried additionalCode: 'var define = false' and various imports, but no luck. With additionalCode specifically I get a TypeError: false is not a function in the browser's debugger. Any thoughts on how this can be alleviated?

Also, define=>false used to be specifically documented, but the equivalent isn't in 1.1.0 (at least as far as I can tell), would be nice if the analogue would be written down now.

fmal commented 4 years ago

@thegrandpoobah did you manage to find some equivalent since you closed the issue?

thegrandpoobah commented 4 years ago

Hello, yes. I must admit that I had a 1 character typo when using additionalCode (no more coding at 1pm :D). I had used:

additionalCode: 'var define = false'

whereas I should have been using

additionalCode: 'var define = false;'

That fixed the problem with my upgrade. Not sure how often the use case of disabling AMD comes up anymore, but it might still be nice if it was explicitly documented in the newer version.

alexander-akait commented 4 years ago

@thegrandpoobah feel free to send a PR with docs