diff --git a/dist/spark/DevLauncher.mjs b/dist/spark/DevLauncher.mjs index d7ac82c3..4eb1a81a 100644 --- a/dist/spark/DevLauncher.mjs +++ b/dist/spark/DevLauncher.mjs @@ -1,5 +1,5 @@ import ux from "./src/ux.mjs"; -import lng from 'wpe-lightning-spark'; +import lng from 'wpe-lightning/src/lightning.mjs'; import fetch from "node-fetch"; import keyboard from "./src/keyboard.mjs"; @@ -12,6 +12,9 @@ export default class DevLauncher { } launch(appType, lightningOptions, options = {}) { + if (undefined != global.LIGHTNING_PLATFORM) { + lng.Stage.platform = global.LIGHTNING_PLATFORM; + } this._appType = appType; this._options = options; return this._start(lightningOptions); diff --git a/dist/spark/package.json b/dist/spark/package.json index 21232e61..ce7374e8 100644 --- a/dist/spark/package.json +++ b/dist/spark/package.json @@ -6,8 +6,9 @@ "postinstall": "rollup -c" }, "dependencies": { + "rollup": "^1.10.0", "esm": "^3.2.11", - "wpe-lightning-spark": "https://github.com/pxscene/Lightning-Spark.git", + "wpe-lightning": "https://github.com/pxscene/Lightning.git#spark", "node-fetch": "^1.7.3" }, "devDependencies": { diff --git a/dist/spark/rollup.config.js b/dist/spark/rollup.config.js index 61b60a13..8bd01360 100644 --- a/dist/spark/rollup.config.js +++ b/dist/spark/rollup.config.js @@ -3,11 +3,11 @@ const resolve = require('rollup-plugin-node-resolve'); export default { input: 'start.mjs', plugins: [resolve({ - only: [ 'wpe-lightning-spark', 'wpe-lightning' ] + only: [ 'wpe-lightning' ] })], output: { - file: './lightning-demo-spark.js', - format: 'cjs', + file: './lightning-demo-spark.mjs', + format: 'esm', name: 'lng' } -}; \ No newline at end of file +}; diff --git a/scripts/release-spark.js b/scripts/release-spark.js index 062c8fc8..34e9677f 100644 --- a/scripts/release-spark.js +++ b/scripts/release-spark.js @@ -78,7 +78,7 @@ function getDependencies() { function bundleApp() { console.log("Generate rollup bundle for app (src/App.js)"); return rollup.rollup({input: "./src/App.js"}).then(bundle => { - return bundle.generate({format: 'esm', banner: 'import ux from "./ux";\nimport lng from "wpe-lightning-spark";\n' + getDependencies()}).then(content => { + return bundle.generate({format: 'esm', banner: 'import ux from "./ux";\nimport lightning from "wpe-lightning/src/lightning.mjs";\nconst lng = lightning;\n' + getDependencies()}).then(content => { const location = "./dist/" + info.dest + "/src/app.mjs"; fs.writeFileSync(location, content.code); }); @@ -88,7 +88,7 @@ function bundleApp() { function bundleUx() { console.log("Generate rollup bundle for ux"); return rollup.rollup({input: dir + "/js/src/ux.js"}).then(bundle => { - return bundle.generate({format: 'esm', banner: 'import lng from "wpe-lightning-spark";\n' + getDependencies()}).then(content => { + return bundle.generate({format: 'esm', banner: 'import lightning from "wpe-lightning/src/lightning.mjs";\nconst lng = lightning;\n' + getDependencies()}).then(content => { const location = "./dist/" + info.dest + "/src/ux.mjs"; fs.writeFileSync(location, content.code); }); @@ -114,4 +114,4 @@ function exec(command, opts) { resolve(stdout); }); }); -} \ No newline at end of file +}