one more optimalization of plugin size & load time

This commit is contained in:
Jan Prochazka
2021-05-20 08:55:50 +02:00
parent 0200c7c78b
commit e43fa96e34
19 changed files with 74 additions and 26 deletions

View File

@@ -1,4 +1,4 @@
const SqlDumper = require('dbgate-tools/lib/SqlDumper');
const { SqlDumper } = global.DBGATE_TOOLS;
class Dumper extends SqlDumper {
/** @param type {import('dbgate-types').TransformType} */

View File

@@ -1,4 +1,4 @@
const driverBase = require('dbgate-tools/lib/driverBase');
const { driverBase } = global.DBGATE_TOOLS;
const Dumper = require('./Dumper');
/** @type {import('dbgate-types').SqlDialect} */

View File

@@ -1,20 +1,26 @@
var webpack = require("webpack");
var path = require("path");
var webpack = require('webpack');
var path = require('path');
var config = {
context: __dirname + "/src/frontend",
context: __dirname + '/src/frontend',
entry: {
app: "./index.js",
app: './index.js',
},
target: "web",
target: 'web',
output: {
path: path.resolve(__dirname, "dist"),
filename: "frontend.js",
libraryTarget: "var",
path: path.resolve(__dirname, 'dist'),
filename: 'frontend.js',
libraryTarget: 'var',
library: 'plugin',
},
plugins: [
new webpack.DefinePlugin({
'global.DBGATE_TOOLS': 'window.DBGATE_TOOLS',
}),
],
// uncomment for disable minimalization
// optimization: {
// minimize: false,