Creating a Locker Service-compliant JavaScript bundle using webpack

So far, we have been lucky that our JavaScript libraries have worked perfectly under Locker Service. There are libraries that may not work under Locker Service due to their use of unsupported elements. All the window, Document, and DOM APIs that are supported by locker are listed at http://documentation.auraframework.Org/lockerApiTest/index.app?aura.mode=DEV.

If you are using the this keyword in JavaScript for window reference, then note that the Lightning Component framework does not support it, and has to explicitly use window.

Webpack is a module bundler that allows us to transform the source code and bundle it. We can use the power of webpack to create a static resource ...

Get Learning Salesforce Lightning Application Development now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.