📎 Webclip
NestJS - Adding a frontend to the monorepo
The post explains how to add a Vue frontend inside an existing NestJS monorepo. It covers the dependency installs, the folder structure for a frontend/blog app, and the files needed to make Vue work with Webpack and TypeScript.
Reading notes#
- Installs Vue plus several development dependencies for Webpack to build and serve the frontend.
- Creates a
frontend/blogfolder and anindex.htmlfile with adivwhoseidisapp. - Uses a
webpack.config.jsthat setscontextto__dirname, outputs todist/frontend, and handles Vue, CSS, SCSS, SVG, PNG, and TypeScript. - Describes the
devServerrunning on port9000and reading files frompublic. - Adds a TypeScript config that includes
./blog/src/**/*to avoid TypeScript errors. - Creates
src/index.tsto mountApp.vueon#app. - Creates
App.vueas a simple component that renders the headerlampeweb dev blog. - Adds
vue-shim.d.tsso TypeScript can import.vuefiles. - Defines npm scripts for watching and building the blog frontend with Webpack.
