Compare commits
No commits in common. "master" and "v1.4.3" have entirely different histories.
@ -1,4 +0,0 @@
|
|||||||
.eslintrc.js
|
|
||||||
babel.config.js
|
|
||||||
webpack.config.js
|
|
||||||
dist/
|
|
22
.eslintrc.js
22
.eslintrc.js
@ -1,22 +0,0 @@
|
|||||||
module.exports = {
|
|
||||||
env: {
|
|
||||||
browser: true,
|
|
||||||
es2021: true
|
|
||||||
},
|
|
||||||
extends: [
|
|
||||||
'eslint:recommended',
|
|
||||||
'plugin:@typescript-eslint/recommended'
|
|
||||||
],
|
|
||||||
overrides: [
|
|
||||||
],
|
|
||||||
parser: '@typescript-eslint/parser',
|
|
||||||
parserOptions: {
|
|
||||||
ecmaVersion: 'latest',
|
|
||||||
sourceType: 'module'
|
|
||||||
},
|
|
||||||
plugins: [
|
|
||||||
'@typescript-eslint'
|
|
||||||
],
|
|
||||||
rules: {
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,6 +0,0 @@
|
|||||||
module.exports = {
|
|
||||||
presets: [
|
|
||||||
'@babel/preset-env',
|
|
||||||
'@babel/preset-typescript'
|
|
||||||
]
|
|
||||||
}
|
|
278
dist/index.js
vendored
278
dist/index.js
vendored
File diff suppressed because one or more lines are too long
1
dist/index.js.LICENSE.txt
vendored
1
dist/index.js.LICENSE.txt
vendored
@ -1 +0,0 @@
|
|||||||
/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */
|
|
10003
package-lock.json
generated
10003
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
24
package.json
24
package.json
@ -1,36 +1,30 @@
|
|||||||
{
|
{
|
||||||
"name": "@ijl/fire.app",
|
"name": "@ijl/fire.app",
|
||||||
"version": "1.6.1",
|
"version": "1.4.3",
|
||||||
"description": "",
|
"description": "",
|
||||||
"main": "dist/index.js",
|
"main": "dist/index.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"start": "nodemon ./stubs/server.js",
|
"start": "nodemon ./stubs/server.js",
|
||||||
"build": "webpack --mode development",
|
"build": "webpack --mode development"
|
||||||
"build:prod": "webpack --mode production"
|
|
||||||
},
|
},
|
||||||
"author": "innoavvlasov@gmail.com",
|
"author": "innoavvlasov@gmail.com",
|
||||||
"license": "ISC",
|
"license": "ISC",
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@babel/core": "^7.21.0",
|
"@types/node": "13.7.0",
|
||||||
"@babel/preset-env": "^7.20.2",
|
|
||||||
"@babel/preset-typescript": "^7.21.0",
|
|
||||||
"@types/node": "16.18.12",
|
|
||||||
"@types/systemjs": "6.1.0",
|
"@types/systemjs": "6.1.0",
|
||||||
"@typescript-eslint/eslint-plugin": "^5.53.0",
|
"awesome-typescript-loader": "5.2.1",
|
||||||
"@typescript-eslint/parser": "^5.53.0",
|
|
||||||
"babel-loader": "^9.1.2",
|
|
||||||
"clean-webpack-plugin": "3.0.0",
|
"clean-webpack-plugin": "3.0.0",
|
||||||
"es6-promise": "4.2.8",
|
"es6-promise": "4.2.8",
|
||||||
"eslint": "^8.34.0",
|
|
||||||
"exports-loader": "0.7.0",
|
"exports-loader": "0.7.0",
|
||||||
"fbjs": "1.0.0",
|
"fbjs": "1.0.0",
|
||||||
|
"file-loader": "5.0.2",
|
||||||
"history": "4.10.1",
|
"history": "4.10.1",
|
||||||
"imports-loader": "0.8.0",
|
"imports-loader": "0.8.0",
|
||||||
"nodemon": "^2.0.20",
|
|
||||||
"rimraf": "3.0.1",
|
"rimraf": "3.0.1",
|
||||||
"systemjs": "6.2.2",
|
"systemjs": "6.2.2",
|
||||||
"typescript": "^4.9.5",
|
"typescript": "3.7.5",
|
||||||
"webpack": "^5.75.0",
|
"webpack": "4.41.5",
|
||||||
"webpack-cli": "^5.0.1"
|
"webpack-cli": "3.3.10",
|
||||||
|
"whatwg-fetch": "3.0.0"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
16
src/main.ts
16
src/main.ts
@ -1,11 +1,8 @@
|
|||||||
/* eslint-disable prefer-const */
|
|
||||||
import "systemjs/dist/system";
|
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";
|
||||||
import "systemjs/dist/extras/transform";
|
import "systemjs/dist/extras/transform";
|
||||||
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';
|
import history from './history';
|
||||||
@ -17,15 +14,6 @@ const systemJSImport = async (requestUrl: string) => {
|
|||||||
return { component, mount, unmount }
|
return { component, mount, unmount }
|
||||||
}
|
}
|
||||||
|
|
||||||
let mainMountElement = document.getElementById('app');
|
|
||||||
|
|
||||||
if (!mainMountElement) {
|
|
||||||
mainMountElement = document.createElement('div');
|
|
||||||
mainMountElement.id = 'app';
|
|
||||||
|
|
||||||
document.body.append(mainMountElement);
|
|
||||||
}
|
|
||||||
|
|
||||||
export default async ({ apps: rawApps, navigations, config, features }) => {
|
export default async ({ apps: rawApps, navigations, config, features }) => {
|
||||||
defineVirtualModule({ navigations, config, features })
|
defineVirtualModule({ navigations, config, features })
|
||||||
|
|
||||||
@ -48,7 +36,7 @@ export default async ({ apps: rawApps, navigations, config, features }) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
let { component, mount, unmount } = await getApp()
|
let { component, mount, unmount } = await getApp()
|
||||||
mount(component.default, mainMountElement);
|
mount(component.default);
|
||||||
|
|
||||||
history.listen(async (location) => {
|
history.listen(async (location) => {
|
||||||
if (location.pathname !== prevPathname) {
|
if (location.pathname !== prevPathname) {
|
||||||
@ -56,7 +44,7 @@ export default async ({ apps: rawApps, navigations, config, features }) => {
|
|||||||
unmount()
|
unmount()
|
||||||
|
|
||||||
const nextApp = await getApp();
|
const nextApp = await getApp();
|
||||||
nextApp.mount(nextApp.component.default, mainMountElement)
|
nextApp.mount(nextApp.component.default)
|
||||||
unmount = nextApp.unmount;
|
unmount = nextApp.unmount;
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
@ -12,6 +12,7 @@ const createVirtualModule = ({ config, navigations, features }) => ({
|
|||||||
|
|
||||||
export const defineVirtualModule = (params) => {
|
export const defineVirtualModule = (params) => {
|
||||||
const virtualModule = createVirtualModule(params)
|
const virtualModule = createVirtualModule(params)
|
||||||
|
// @ts-ignore
|
||||||
System.set('root.scope', {
|
System.set('root.scope', {
|
||||||
...virtualModule
|
...virtualModule
|
||||||
});
|
});
|
||||||
|
@ -1,23 +1,20 @@
|
|||||||
{
|
{
|
||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
"lib": [
|
"lib": [
|
||||||
"dom",
|
"dom",
|
||||||
"ESNext"
|
"es7"
|
||||||
],
|
],
|
||||||
"outDir": "./dist/",
|
"outDir": "./dist/",
|
||||||
"sourceMap": true,
|
"sourceMap": true,
|
||||||
"esModuleInterop": true,
|
"esModuleInterop": true,
|
||||||
"downlevelIteration": true,
|
"downlevelIteration" :true,
|
||||||
"noImplicitAny": false,
|
"noImplicitAny": false,
|
||||||
"module": "commonjs",
|
"module": "commonjs",
|
||||||
"target": "es6",
|
"target": "es6",
|
||||||
"typeRoots": [
|
"jsx": "react",
|
||||||
"node_modules/@types",
|
"typeRoots": ["node_modules/@types", "src/typings", "../../node_modules/@types"]
|
||||||
"src/typings",
|
},
|
||||||
"../../node_modules/@types"
|
"exclude": [
|
||||||
|
"node_modules"
|
||||||
]
|
]
|
||||||
},
|
|
||||||
"exclude": [
|
|
||||||
"node_modules"
|
|
||||||
]
|
|
||||||
}
|
}
|
@ -6,20 +6,21 @@ const outputDirectory = 'dist';
|
|||||||
const pkg = require('./package.json')
|
const pkg = require('./package.json')
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
|
mode: "development",
|
||||||
entry: {
|
entry: {
|
||||||
index: './src/main.ts'
|
index: "./src/main.ts"
|
||||||
},
|
},
|
||||||
output: {
|
output: {
|
||||||
library: 'fireapp',
|
library: "fireapp",
|
||||||
path: path.resolve(__dirname, outputDirectory),
|
path: path.resolve(__dirname, outputDirectory),
|
||||||
libraryExport: 'default',
|
libraryExport: "default",
|
||||||
publicPath: `/fireapp/${pkg.version}/`
|
publicPath: `/fireapp/${pkg.version}/`
|
||||||
},
|
},
|
||||||
|
|
||||||
plugins: [new CleanWebpackPlugin()],
|
plugins: [new CleanWebpackPlugin()],
|
||||||
|
|
||||||
resolve: {
|
resolve: {
|
||||||
extensions: ['.ts', '.js']
|
extensions: [".ts", ".js"]
|
||||||
},
|
},
|
||||||
|
|
||||||
module: {
|
module: {
|
||||||
@ -27,7 +28,11 @@ module.exports = {
|
|||||||
{ parser: { system: false } },
|
{ parser: { system: false } },
|
||||||
{
|
{
|
||||||
test: /\.tsx?$/,
|
test: /\.tsx?$/,
|
||||||
loader: 'babel-loader'
|
loader: "awesome-typescript-loader"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
test: /\.(jpe?g|gif|png|svg|woff|ttf|eot|wav|mp3)$/,
|
||||||
|
loader: "file-loader"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user