debugging - Require loads a module even though it's included in the build -
i'm working on complex require project; @ core of project third-party video player code base we're building app around. i'm working out our production build process, using require optimizer.
the optimizer works great, when use app "built" js, require insists on loading third-party module inserting additional script tag. i've searched through compiled js , confirmed module included in build; yet doesn't seem recognized @ runtime.
this module requires third-party module:
define(['models/widget','amp_lib'], function(widget) { // housekeeping/configuration // nothing return here }) the module amp_lib defined in main config:
require.config({ paths: { amp_lib: 'path/to/module/src' } }); can me understand how require determines whether particular module has been loaded or not? i've been poking around in require day long, hoping find out determination made, no avail.
as noted above:
i found problem today. turns out third-party module using few utility libraries, 1 of amd-compliant , has own define() function when detects loader. when building, optimizer defining library module, instead of entire codebase, in turn caused module reloaded @ runtime. lesson learned: careful stuffing third-party stuff require project.
Comments
Post a Comment