Skip to content

Commit

Permalink
build: configure browserslist config (#2054)
Browse files Browse the repository at this point in the history
  • Loading branch information
Wroud authored Oct 10, 2023
1 parent b52c278 commit baef7fb
Show file tree
Hide file tree
Showing 7 changed files with 37 additions and 31 deletions.
1 change: 1 addition & 0 deletions webapp/packages/browserslist-config/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = ['defaults', 'not IE 11'];
7 changes: 7 additions & 0 deletions webapp/packages/browserslist-config/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"name": "@cloudbeaver/browserslist-config",
"sideEffects": false,
"version": "0.1.0",
"license": "Apache-2.0",
"main": "index.js"
}
36 changes: 18 additions & 18 deletions webapp/packages/core-cli/configs/babel.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
12 changes: 2 additions & 10 deletions webapp/packages/core-cli/configs/excludedFromVendor.js
Original file line number Diff line number Diff line change
Expand Up @@ -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/*',
];
];
3 changes: 1 addition & 2 deletions webapp/packages/core-cli/configs/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,6 @@ module.exports = (env, argv) => {
};

return {
// target: !devMode ? "web" : "browserslist",
optimization: {
runtimeChunk: 'single',
moduleIds: 'deterministic',
Expand All @@ -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);
Expand Down
5 changes: 4 additions & 1 deletion webapp/packages/product-default/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
4 changes: 4 additions & 0 deletions webapp/tsconfig.base.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": [
{
Expand Down

0 comments on commit baef7fb

Please sign in to comment.