Compare commits
11 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f2209f6708 | ||
|
|
753eaada75 | ||
| fe6d5df006 | |||
| d5e08e4178 | |||
| 14e5c02a03 | |||
| ac1e2a4df3 | |||
|
|
0636ce1ff2 | ||
|
|
47839a963c | ||
|
|
3683151cb2 | ||
|
|
033865105f | ||
|
|
556c31c56c |
42
dist/index.js
vendored
42
dist/index.js
vendored
File diff suppressed because one or more lines are too long
@@ -1,12 +1,11 @@
|
|||||||
{
|
{
|
||||||
"name": "@ijl/fire.app",
|
"name": "@ijl/fire.app",
|
||||||
"version": "1.0.3",
|
"version": "1.3.0",
|
||||||
"description": "",
|
"description": "",
|
||||||
"main": "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"
|
||||||
"test": "echo \"Error: no test specified\" && exit 1"
|
|
||||||
},
|
},
|
||||||
"author": "innoavvlasov@gmail.com",
|
"author": "innoavvlasov@gmail.com",
|
||||||
"license": "ISC",
|
"license": "ISC",
|
||||||
|
|||||||
@@ -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";
|
||||||
@@ -33,8 +33,8 @@ const systemJSImport = async (requestUrl: string) => {
|
|||||||
// sections: { version: '1.0.0', name: 'sections' }
|
// sections: { version: '1.0.0', name: 'sections' }
|
||||||
// }
|
// }
|
||||||
|
|
||||||
export default async ({ apps: rawApps, navigations, config }) => {
|
export default async ({ apps: rawApps, navigations, config, features }) => {
|
||||||
defineVirtualModule({navigations, config})
|
defineVirtualModule({ navigations, config, features })
|
||||||
|
|
||||||
const apps = new Apps(rawApps)
|
const apps = new Apps(rawApps)
|
||||||
|
|
||||||
|
|||||||
@@ -1,12 +1,17 @@
|
|||||||
|
const createVirtualModule = ({ config, navigations, features }) => ({
|
||||||
|
getConfig: () => config,
|
||||||
|
getConfigValue: (pkg: string) => config[pkg],
|
||||||
|
getNavigations: () => navigations,
|
||||||
|
getNavigationsValue: (pkg: string) => navigations[pkg],
|
||||||
|
getAllFeatures: () => features,
|
||||||
|
getFeatures: (pkg: string) => features[pkg]
|
||||||
|
})
|
||||||
|
|
||||||
export const defineVirtualModule = (params) => {
|
export const defineVirtualModule = (params) => {
|
||||||
const virtualModule = createVirtualModule(params)
|
const virtualModule = createVirtualModule(params)
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
global.define('@ijl/fire.app', [], virtualModule)
|
System.set('root.scope', {
|
||||||
|
...virtualModule
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
const createVirtualModule = ({config, navigations}) => ({
|
|
||||||
getConfig: () => config,
|
|
||||||
getConfigValue: (key) => config[key],
|
|
||||||
getNavigations: () => navigations,
|
|
||||||
getNavigationsValue: (key) => navigations[key],
|
|
||||||
})
|
|
||||||
@@ -11,10 +11,10 @@ module.exports = {
|
|||||||
index: "./src/main.ts"
|
index: "./src/main.ts"
|
||||||
},
|
},
|
||||||
output: {
|
output: {
|
||||||
library: "bootstrap",
|
library: "fireapp",
|
||||||
path: path.resolve(__dirname, outputDirectory),
|
path: path.resolve(__dirname, outputDirectory),
|
||||||
libraryExport: "default",
|
libraryExport: "default",
|
||||||
publicPath: `/boorstrap/${pkg.version}/`
|
publicPath: `/fireapp/${pkg.version}/`
|
||||||
},
|
},
|
||||||
|
|
||||||
plugins: [new CleanWebpackPlugin()],
|
plugins: [new CleanWebpackPlugin()],
|
||||||
|
|||||||
Reference in New Issue
Block a user