Compare commits
10 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| d94d9e03cf | |||
| 1ae0790319 | |||
| 729addc469 | |||
| b718dd3b03 | |||
| ff2f20aebe | |||
| 1e76d60284 | |||
| 612f326515 | |||
| fcb72a4547 | |||
| a028c2b767 | |||
| 8ea30cb9a0 |
29
dist/index.js
vendored
29
dist/index.js
vendored
File diff suppressed because one or more lines are too long
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@ijl/fire.app",
|
"name": "@ijl/fire.app",
|
||||||
"version": "1.4.0",
|
"version": "1.5.0",
|
||||||
"description": "",
|
"description": "",
|
||||||
"main": "dist/index.js",
|
"main": "dist/index.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
|||||||
6
src/history.ts
Normal file
6
src/history.ts
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
import { createBrowserHistory } from 'history'
|
||||||
|
|
||||||
|
|
||||||
|
const history = createBrowserHistory();
|
||||||
|
|
||||||
|
export default history;
|
||||||
@@ -3,9 +3,11 @@ 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";
|
||||||
import "systemjs/dist/extras/transform";
|
import "systemjs/dist/extras/transform";
|
||||||
import { createBrowserHistory } from 'history'
|
import "regenerator-runtime/runtime";
|
||||||
|
|
||||||
import { Apps } from './apps'
|
import { Apps } from './apps'
|
||||||
import { defineVirtualModule } from './virtual-module'
|
import { defineVirtualModule } from './virtual-module'
|
||||||
|
import history from './history';
|
||||||
|
|
||||||
const systemJSImport = async (requestUrl: string) => {
|
const systemJSImport = async (requestUrl: string) => {
|
||||||
const { default: component, mount, unmount } = await System.import(
|
const { default: component, mount, unmount } = await System.import(
|
||||||
@@ -19,8 +21,6 @@ export default async ({ apps: rawApps, navigations, config, features }) => {
|
|||||||
|
|
||||||
const apps = new Apps(rawApps)
|
const apps = new Apps(rawApps)
|
||||||
|
|
||||||
const history = createBrowserHistory()
|
|
||||||
|
|
||||||
let prevPathname = window.location.pathname
|
let prevPathname = window.location.pathname
|
||||||
|
|
||||||
async function getApp() {
|
async function getApp() {
|
||||||
|
|||||||
@@ -1,10 +1,13 @@
|
|||||||
|
import history from './history';
|
||||||
|
|
||||||
const createVirtualModule = ({ config, navigations, features }) => ({
|
const createVirtualModule = ({ config, navigations, features }) => ({
|
||||||
getConfig: () => config,
|
getConfig: () => config,
|
||||||
getConfigValue: (pkg: string) => config[pkg],
|
getConfigValue: (pkg: string) => config[pkg],
|
||||||
getNavigations: () => navigations,
|
getNavigations: () => navigations,
|
||||||
getNavigationsValue: (pkg: string) => navigations[pkg],
|
getNavigationsValue: (pkg: string) => navigations[pkg],
|
||||||
getAllFeatures: () => features,
|
getAllFeatures: () => features,
|
||||||
getFeatures: (pkg: string) => features[pkg]
|
getFeatures: (pkg: string) => features[pkg],
|
||||||
|
getHistory: () => history,
|
||||||
})
|
})
|
||||||
|
|
||||||
export const defineVirtualModule = (params) => {
|
export const defineVirtualModule = (params) => {
|
||||||
|
|||||||
@@ -4,15 +4,6 @@
|
|||||||
"dom",
|
"dom",
|
||||||
"es7"
|
"es7"
|
||||||
],
|
],
|
||||||
"baseUrl": ".",
|
|
||||||
"paths": {
|
|
||||||
"*": [
|
|
||||||
"*",
|
|
||||||
"src/*",
|
|
||||||
"lib/*",
|
|
||||||
"dist/*"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"outDir": "./dist/",
|
"outDir": "./dist/",
|
||||||
"sourceMap": true,
|
"sourceMap": true,
|
||||||
"esModuleInterop": true,
|
"esModuleInterop": true,
|
||||||
|
|||||||
Reference in New Issue
Block a user