2 Commits

Author SHA1 Message Date
ac1e2a4df3 1.1.0 2020-03-31 00:08:19 +03:00
Andrey Vlasov
0636ce1ff2 fix virtual module 2020-03-29 12:49:07 +03:00
4 changed files with 22 additions and 19 deletions

16
dist/index.js vendored

File diff suppressed because one or more lines are too long

View File

@@ -1,6 +1,6 @@
{ {
"name": "@ijl/fire.app", "name": "@ijl/fire.app",
"version": "1.0.5", "version": "1.1.0",
"description": "", "description": "",
"main": "dist/index.js", "main": "dist/index.js",
"scripts": { "scripts": {

View File

@@ -1,4 +1,4 @@
import "systemjs/dist/s"; import "systemjs/dist/system";
import "systemjs/dist/extras/amd"; import "systemjs/dist/extras/amd";
import "systemjs/dist/extras/named-register"; import "systemjs/dist/extras/named-register";
import "systemjs/dist/extras/named-exports"; import "systemjs/dist/extras/named-exports";

View File

@@ -1,12 +1,15 @@
export const defineVirtualModule = (params) => {
const virtualModule = createVirtualModule(params)
// @ts-ignore
global.define('@ijl/fire.app', [], virtualModule)
}
const createVirtualModule = ({ config, navigations }) => ({ const createVirtualModule = ({ config, navigations }) => ({
getConfig: () => config, getConfig: () => config,
getConfigValue: (key) => config[key], getConfigValue: (key) => config[key],
getNavigations: () => navigations, getNavigations: () => navigations,
getNavigationsValue: (key) => navigations[key], getNavigationsValue: (key) => navigations[key],
}) })
export const defineVirtualModule = (params) => {
const virtualModule = createVirtualModule(params)
// @ts-ignore
System.set('root.scope', {
...virtualModule
});
}