Setup Lightning

Created on November 04, 2020, Last modified on May 19, 2022

Create a Lightning build

git clone
cd Lightning
npm i

You can find the distributable in dist/lightning-wpe.js.


Create a file src/MyApp.js:

import Lightning from 'wpe-lightning'
export default class MyApp extends Lightning.Application {
    static _template() {
        return {
            Text: {text: {text: "hello world"}}

Add an index.html file:

<!DOCTYPE html>
<html lang="en">
    <meta charset="UTF-8" />
    <script src="./lightning-web.js"></script>
    <script type="module">
        import MyApp from "./src/MyApp.js";
        window.onload = function() {
            const options = {stage: {w: 1920, h: 1080, clearColor: 0xFF000000}}
            const app = new MyApp(options);

For more settings please check Stage Configuration

Give feedback

Rating - 4.2 / 5. . Reviews - 5

No votes so far! Be the first to rate this post.

Go To Top