bundle_example icon indicating copy to clipboard operation
bundle_example copied to clipboard

Explicitly reference the loader

Open guusdk opened this issue 8 years ago • 0 comments

By using the short name for a loader, another node module that matches the loader shortname might be used, giving weird errors. This is prevented by referencing the loader by its full name (by adding '-loader' to most short names).

This prevents errors like these:

/vagrant/node_modules/loader-runner/lib/loadLoader.js:35
                        throw new Error("Module '" + loader.path + "' is not a loader (must have normal or pitch function)");
                        ^

Error: Module '/vagrant/node_modules/url/url.js' is not a loader (must have normal or pitch function)
    at loadLoader (/vagrant/node_modules/loader-runner/lib/loadLoader.js:35:10)
    at iteratePitchingLoaders (/vagrant/node_modules/loader-runner/lib/LoaderRunner.js:169:2)
    at runLoaders (/vagrant/node_modules/loader-runner/lib/LoaderRunner.js:362:2)
    at NormalModule.doBuild (/vagrant/node_modules/webpack/lib/NormalModule.js:179:3)
    at NormalModule.build (/vagrant/node_modules/webpack/lib/NormalModule.js:268:15)
    at Compilation.buildModule (/vagrant/node_modules/webpack/lib/Compilation.js:142:10)
    at factoryCallback (/vagrant/node_modules/webpack/lib/Compilation.js:325:11)
    at factory (/vagrant/node_modules/webpack/lib/NormalModuleFactory.js:253:5)
    at applyPluginsAsyncWaterfall (/vagrant/node_modules/webpack/lib/NormalModuleFactory.js:99:14)
    at /vagrant/node_modules/tapable/lib/Tapable.js:204:11

guusdk avatar May 03 '17 13:05 guusdk