mirror of
https://github.com/dbeaver/cloudbeaver.git
synced 2026-09-24 16:04:36 +08:00
chore: move bootstrap to core
This commit is contained in:
@@ -2,16 +2,16 @@ module.exports = {
|
||||
presets: [
|
||||
"@babel/preset-env",
|
||||
"@babel/preset-react",
|
||||
['@babel/preset-typescript', { isTSX: true, allExtensions: true }],
|
||||
// ['@babel/preset-typescript', { isTSX: true, allExtensions: true }],
|
||||
],
|
||||
plugins: [
|
||||
'@babel/plugin-transform-runtime',
|
||||
'@babel/plugin-syntax-dynamic-import',
|
||||
'babel-plugin-transform-typescript-metadata',
|
||||
// 'babel-plugin-transform-typescript-metadata',
|
||||
'@babel/plugin-proposal-optional-chaining',
|
||||
['@babel/plugin-proposal-decorators', { legacy: true }],
|
||||
// ['@babel/plugin-proposal-decorators', { legacy: true }],
|
||||
['@babel/plugin-proposal-class-properties', { loose: true }],
|
||||
'react-require',
|
||||
'reshadow/babel',
|
||||
// 'react-require',
|
||||
// 'reshadow/babel',
|
||||
],
|
||||
}
|
||||
|
||||
@@ -74,7 +74,7 @@ module.exports = (env, argv) => merge(commonConfig(env, argv), {
|
||||
module: {
|
||||
rules: [
|
||||
{
|
||||
test: /\.tsx?$/,
|
||||
test: /\.js?$/,
|
||||
use: [
|
||||
{
|
||||
loader: StringReplacePlugin.replace({
|
||||
|
||||
@@ -71,7 +71,8 @@ module.exports = (env, argv) => {
|
||||
|
||||
return {
|
||||
resolve: {
|
||||
extensions: ['.ts', '.tsx', '.js', '.jsx'],
|
||||
// extensions: ['.ts', '.tsx', '.js', '.jsx'],
|
||||
extensions: ['.js'],
|
||||
},
|
||||
module: {
|
||||
rules: [
|
||||
@@ -152,9 +153,9 @@ module.exports = (env, argv) => {
|
||||
modules: true,
|
||||
modulesCount: 100,
|
||||
profile: true,
|
||||
handler: (percentage, message, ...args) => {
|
||||
// custom logic
|
||||
}
|
||||
// handler: (percentage, message, ...args) => {
|
||||
// // custom logic
|
||||
// }
|
||||
}),
|
||||
new CircularDependencyPlugin({
|
||||
// exclude detection of files based on a RegExp
|
||||
|
||||
@@ -9,7 +9,7 @@ module.exports = (env, argv) => merge(commonConfig(env, argv), {
|
||||
// 'react-hot-loader/patch', // activate HMR for React
|
||||
'webpack-dev-server/client?http://localhost:3100',// bundle the client for webpack-dev-server and connect to the provided endpoint
|
||||
// 'webpack/hot/only-dev-server', // bundle the client for hot reloading, only- means to only hot reload for successful updates
|
||||
'./index.ts' // the entry point of our app
|
||||
'./index.js' // the entry point of our app
|
||||
],
|
||||
devServer: {
|
||||
hot: false, // enable HMR on the server
|
||||
|
||||
@@ -6,7 +6,7 @@ const commonConfig = require('./common-exp');
|
||||
|
||||
module.exports = (env, argv) => merge(commonConfig(env, argv), {
|
||||
mode: argv.mode || 'development',
|
||||
entry: './index.ts',
|
||||
entry: './index.js',
|
||||
output: {
|
||||
filename: 'js/bundle.[hash].js',
|
||||
path: resolve(argv.currentDir, './dist'),
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
/* eslint-disable import-helpers/order-imports, import/order, import/no-duplicates */
|
||||
/* this eslint-disable required for webpack inject */
|
||||
import 'reflect-metadata';
|
||||
|
||||
import { bootstrap } from '@dbeaver/core';
|
||||
|
||||
const PLUGINS = []; // will be injected by webpack
|
||||
|
||||
bootstrap(PLUGINS);
|
||||
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"extends": "../../tsconfig.json",
|
||||
"extends": "../../tsconfig.base.json",
|
||||
"exclude": ["node_modules"],
|
||||
"include": [
|
||||
"src/**/*",
|
||||
|
||||
@@ -1,18 +1,12 @@
|
||||
/* eslint-disable import-helpers/order-imports, import/order, import/no-duplicates */
|
||||
/* this eslint-disable required for webpack inject */
|
||||
import 'reflect-metadata';
|
||||
|
||||
import { AppBootstrap } from '@dbeaver/core';
|
||||
import { App, PluginManifest } from '@dbeaver/core/di';
|
||||
|
||||
import { renderLayout } from './renderLayout';
|
||||
import { AppBootstrap } from './AppBootstrap';
|
||||
import { showErrorPage } from './ErrorPage';
|
||||
import { renderLayout } from './renderLayout';
|
||||
|
||||
const PLUGINS = [] as PluginManifest[]; // will be injected by webpack
|
||||
export async function bootstrap(plugins: PluginManifest[]) {
|
||||
|
||||
async function bootstrap() {
|
||||
|
||||
const app = new App(PLUGINS);
|
||||
const app = new App(plugins);
|
||||
app.registerServices();
|
||||
|
||||
const appBootstrap = app.getServiceInjector().resolveServiceByClass(AppBootstrap);
|
||||
@@ -29,5 +23,3 @@ async function bootstrap() {
|
||||
showErrorPage();
|
||||
}
|
||||
}
|
||||
|
||||
bootstrap();
|
||||
@@ -1,6 +1,6 @@
|
||||
// reexports
|
||||
import { coreManifest } from './manifest';
|
||||
|
||||
export * from './AppBootstrap';
|
||||
export * from './bootstrap';
|
||||
|
||||
export default coreManifest;
|
||||
|
||||
Reference in New Issue
Block a user