The build pipeline of an app component includes an additional build task which generates the app's artifacts.
To test your app's build without snapping and deploying you app, run its build pipeline:
Alternatively, snap your app component to build, version and deploy it (if a deployer is set):
The app's build pipeline generates its artifacts in your workspace capsule directory. Run the following to get the path to your workspace capsule directory:
The output is similar to the following:
Your app's artifacts are placed in the artifacts/apps
directory, nested inside the directory of the app component, in that capsule directory.
Head over to this component's (app) capsule to examine the output of its build.
For example, the following uses serve to serve the app's build from its capsule:
An app's build can be modified using the app-type's API, or replaced, altogether, by using a different app-type (this is done by replacing the app plugin file).
Bit's Vue app-type uses Vite and @vitejs/plugin-vue
for bundling. Change the bundle strategy by adding an extra vite.config.ts
.
For example:
// vite.config.ts import { defineConfig } from 'vite' import VueDevTools from 'vite-plugin-vue-devtools' export default defineConfig({ base: '/my-vite-app/', plugins: [ VueDevTools() ] })
It will be merged with the default Vite config.
Note that an app's build configuration is not identical to the component preview configuration set by its env. A Vue app component may have one set of bundle configurations for its component previews and a different one for its deployment. That means, among other things, that a working composition does not guarantee a working app (and vice-versa).