diff --git a/web/packages/README.md b/web/packages/README.md index fd5a681135d54..c1ec58d98d563 100644 --- a/web/packages/README.md +++ b/web/packages/README.md @@ -9,6 +9,6 @@ library referenced by other packages. | ---------- | ----------------------------------------------------------------------- | | `teleport` | Open-source version of Teleport Web UI | | `teleterm` | Open-source version of Teleport Connect (Electron app) | -| `build` | Collection of webpack and build scripts used to build Teleport packages | +| `build` | Collection of Vite build scripts used to build Teleport packages | | `design` | Teleport design system | | `shared` | Shared code | diff --git a/web/packages/build/webpack/resolvepath.js b/web/packages/build/webpack/resolvepath.js deleted file mode 100644 index d6aafbb14bf43..0000000000000 --- a/web/packages/build/webpack/resolvepath.js +++ /dev/null @@ -1,9 +0,0 @@ -const fs = require('fs'); -const path = require('path'); - -function resolvePath(relativePath) { - const appDirectory = fs.realpathSync(process.cwd()); - return path.resolve(appDirectory, relativePath); -} - -module.exports = resolvePath; diff --git a/web/packages/build/webpack/webpack.base.js b/web/packages/build/webpack/webpack.base.js deleted file mode 100644 index 6ca2d7ae905df..0000000000000 --- a/web/packages/build/webpack/webpack.base.js +++ /dev/null @@ -1,71 +0,0 @@ -/* - * Teleport - * Copyright (C) 2023 Gravitational, Inc. - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - */ - -const path = require('path'); - -const resolvePath = require('./resolvepath'); - -const configFactory = { - createDefaultConfig, -}; - -function createDefaultConfig() { - return { - entry: { - app: ['./src/boot'], - }, - - output: { - // used by loaders to generate various URLs within CSS, JS based off publicPath - publicPath: '/web/app/', - - path: resolvePath('dist/app'), - - /* - * format of the output file names. [name] stands for 'entry' keys - * defined in the 'entry' section - **/ - filename: '[name].[contenthash].js', - - // chunk file name format - chunkFilename: '[name].[chunkhash].js', - }, - - resolve: { - // some vendor libraries expect below globals to be defined - alias: { - teleterm: path.join(__dirname, '/../../teleterm/src'), - teleport: path.join(__dirname, '/../../teleport/src'), - 'e-teleport': path.join(__dirname, '/../../../../e/web/teleport/src'), - design: path.join(__dirname, '/../../design/src'), - shared: path.join(__dirname, '/../../shared'), - 'gen-proto-js': path.join(__dirname, '/../../../../gen/proto/js'), - 'gen-proto-ts': path.join(__dirname, '/../../../../gen/proto/ts'), - }, - - /* - * root path to resolve js our modules, enables us to use absolute path. - * For ex: require('./../../../config') can be replaced with require('app/config') - **/ - modules: ['node_modules', 'src'], - extensions: ['.ts', '.tsx', '.js', '.jsx'], - }, - }; -} - -module.exports = configFactory; diff --git a/web/packages/teleterm/build_resources/README.md b/web/packages/teleterm/build_resources/README.md index c90ca5e61af8d..b3cf09526fb8a 100644 --- a/web/packages/teleterm/build_resources/README.md +++ b/web/packages/teleterm/build_resources/README.md @@ -1,7 +1,7 @@ This is the directory we use as the `buildResources` dir for electron-builder. By default, electron-builder uses the `build` dir at the project root. However, we already use that -directory for webpack output. +directory for the build output from Vite. If you see a path in electron-builder docs referring to `build`, you can assume that they meant the `buildResources` directory. diff --git a/web/packages/teleterm/src/staticConfig.ts b/web/packages/teleterm/src/staticConfig.ts index 6c070115bcddc..aac83903b8764 100644 --- a/web/packages/teleterm/src/staticConfig.ts +++ b/web/packages/teleterm/src/staticConfig.ts @@ -19,7 +19,7 @@ /** * `StaticConfig` allows providing different values between the dev build and * the packaged app. - * The proper config is resolved by webpack at compile time. + * The proper config is resolved by Vite at compile time. * This differs from `RuntimeSettings`, where properties are resolved during * the app's runtime. */