diff --git a/webapp/packages/browserslist-config/index.js b/webapp/packages/browserslist-config/index.js new file mode 100644 index 0000000000..de089bf028 --- /dev/null +++ b/webapp/packages/browserslist-config/index.js @@ -0,0 +1 @@ +module.exports = ['defaults', 'not IE 11']; diff --git a/webapp/packages/browserslist-config/package.json b/webapp/packages/browserslist-config/package.json new file mode 100644 index 0000000000..63aac8cc0a --- /dev/null +++ b/webapp/packages/browserslist-config/package.json @@ -0,0 +1,7 @@ +{ + "name": "@cloudbeaver/browserslist-config", + "sideEffects": false, + "version": "0.1.0", + "license": "Apache-2.0", + "main": "index.js" +} diff --git a/webapp/packages/core-cli/configs/babel.config.js b/webapp/packages/core-cli/configs/babel.config.js index b1fb5c0648..d3974e9199 100644 --- a/webapp/packages/core-cli/configs/babel.config.js +++ b/webapp/packages/core-cli/configs/babel.config.js @@ -34,24 +34,24 @@ module.exports = api => { setSpreadProperties: true, }, presets: [ - [ - '@babel/preset-env', - { - modules: testMode ? undefined : false, - targets: { - node: 'current', - browsers: [ - 'defaults', - 'not IE 11', - // "last 1 chrome version", - // "last 1 firefox version", - // "last 1 edge version", - // "last 1 safari version" - ], - }, - exclude: ['transform-async-to-generator', 'transform-regenerator'], - }, - ], + // [ + // '@babel/preset-env', + // { + // modules: testMode ? undefined : false, + // targets: { + // node: 'current', + // browsers: [ + // 'defaults', + // 'not IE 11', + // // "last 1 chrome version", + // // "last 1 firefox version", + // // "last 1 edge version", + // // "last 1 safari version" + // ], + // }, + // exclude: ['transform-async-to-generator', 'transform-regenerator'], + // }, + // ], // ['@babel/preset-typescript', { isTSX: true, allExtensions: true, onlyRemoveTypeImports: true }], [ '@babel/preset-react', diff --git a/webapp/packages/core-cli/configs/excludedFromVendor.js b/webapp/packages/core-cli/configs/excludedFromVendor.js index 91866498ce..60973478ce 100644 --- a/webapp/packages/core-cli/configs/excludedFromVendor.js +++ b/webapp/packages/core-cli/configs/excludedFromVendor.js @@ -18,14 +18,6 @@ module.exports = [ 'd3', 'dagre', 'codemirror', - '@codemirror/*', - '@codemirror/commands', - '@codemirror/language', - '@codemirror/search', - '@codemirror/state', - '@codemirror/view', - '@codemirror/autocomplete', - '@codemirror/lang-*', + '@codemirror', '@lezer', - '@lezer/*', -]; \ No newline at end of file +]; diff --git a/webapp/packages/core-cli/configs/webpack.config.js b/webapp/packages/core-cli/configs/webpack.config.js index 3a48031e0a..20e899a14e 100644 --- a/webapp/packages/core-cli/configs/webpack.config.js +++ b/webapp/packages/core-cli/configs/webpack.config.js @@ -85,7 +85,6 @@ module.exports = (env, argv) => { }; return { - // target: !devMode ? "web" : "browserslist", optimization: { runtimeChunk: 'single', moduleIds: 'deterministic', @@ -104,7 +103,7 @@ module.exports = (env, argv) => { enforceSizeThreshold: 50000, cacheGroups: { locale: { - test: /[\\/]locales[\\/].*?\.ts/, + test: /[\\/]locales[\\/].*?\.js/, filename: '[name].[contenthash].js', name(module) { return module.rawRequest.substr(2); diff --git a/webapp/packages/product-default/package.json b/webapp/packages/product-default/package.json index cae9f1f2c3..80854c1325 100644 --- a/webapp/packages/product-default/package.json +++ b/webapp/packages/product-default/package.json @@ -9,11 +9,14 @@ "description": "CloudBeaver Community", "license": "Apache-2.0", "main": "dist/index.js", + "browserslist": [ + "extends @cloudbeaver/browserslist-config" + ], "scripts": { "build": "rimraf --glob lib && lerna run gql:gen --stream --parallel && tsc -b", "bundle": "yarn build && core-cli-build --mode=production --config ../core-cli/configs/webpack.product.config.js", "dev": "yarn build && concurrently -P -k \"yarn tsc -b --watch --preserveWatchOutput\" \"lerna run gql:gen:dev --stream --parallel\" \"core-cli-build serve --mode=development --progress --config=../core-cli/configs/webpack.product.dev.config.js --port=3100 {@}\"", - "analyse": "core-cli-build --mode=production --config ../core-cli/configs/webpack.product.config.js --profile --json > ./lib/stats.json", + "analyse": "yarn build && rimraf --glob lib && mkdir lib && core-cli-build --mode=production --config ../core-cli/configs/webpack.product.config.js --profile --json > ./lib/stats.json", "postanalyse": "core-cli-analyzer ./lib/stats.json", "lint": "eslint ./src/ --ext .ts,.tsx", "lint-fix": "eslint ./src/ --ext .ts,.tsx --fix", diff --git a/webapp/tsconfig.base.json b/webapp/tsconfig.base.json index 7b315a44e2..740e42f53c 100644 --- a/webapp/tsconfig.base.json +++ b/webapp/tsconfig.base.json @@ -41,6 +41,10 @@ "disableReferencedProjectLoad": true, "disableSolutionSearching": true, + // disable support of helpers + "noEmitHelpers": false, + "importHelpers": true, + "types": ["reflect-metadata", "node", "jest", "@cloudbeaver/core-cli/global.d.ts"], "plugins": [ {