Carl Patenaude Poulin Carl Patenaude Poulin - 4 months ago 18
Javascript Question

How do I import libraries into my JavaScript-based UWP app service?

I'm writing a UWP app in JavaScript. I have an App Service declared in

package.appxmanifest
. By pointing its
StartPage
attribute to a JavaScript source file, I can control what gets executed.

Within that
.js
file, is it possible to import third-party libraries?

Answer

Use the importScripts method. For example:

importScripts("/node_modules/jquery/dist/jquery.min.js");
Comments