The code below works fine in VsCode + webpack
Index.ts:
require("./jQueryPlugin-No-Module");
debugger;
$.fn.test(); // fails here
I am using the ProvidePlugin to inject jQuery into this script file.
jQueryPlugin-No-Module.js:
(function ($) {
$.fn.test = function () {
console.log("jQuery-Plugin called with options");
};
})(jQuery);
I have copied the all code from VsCode to VS2017-ASP.NET Core Project and just adapted the paths. Everything runs perfect except the plugin above, I get this error:
In index.ts
I put a debugger
statement. When I run the application it stops there, the plugin $.fn.test
has been successfully attached to jQuery. I switch to the Chrome console and execute $.fn.test();
there, works as expected.
I go back to source view and hit F11 to execute the next step and I get the error above.
Perhaps someone has experienced this issue using ASP.NET Core 2 and VS2017 before...?
tsc && webpack -d --env.dev --display-modules --progress --display-error-details --config webpack.config.dev.js