Reputation: 915
Consider the full-stack application project with NodeJS back-end.
package.json
includes dependencies for both front-end (like vue
, vuex
, etc.) and back-end (like body-parser
, express
, etc.).EntryPoint-FrontEnd.js
) and entry point for backend (EntryPoint-BackEnd.js
) are being built by different Webpack config; the main differences is usage of webpack-node-externals and target: "node"
for back-end.EntryPoint-FrontEnd.js
, but EntryPoint-BackEnd.js
access to dependencies with webpack-node-externals
.Now: how to copy to 02-ProductionBuild
only those dependencies, which using EntryPoint-BackEnd.js
via
webpack-node-externals
?
I glad if can reach it by webpack-node-externals
, but if impossible, other tools are welcome.
The basic practice is deploying the full project to host and installing dependencies by npm install
.
However all that we need for working application in server is 02-ProductionBuild
folder including dependencies for EntryPoint-BackEnd.js
.
Upvotes: 3
Views: 713
Reputation: 16505
{
"build:frontend" : "packagify ....",
"build:backend" : "packagify ...."
}
{
"build:frontend" : "packagify.js ....",
"build:backend" : "packagify.js ...."
}
Since you are using vue, it is sure that your backend is a rest api. So you are close to the classic approach which is opposite to a monolithic application.
One monolithic characteristic:
But what happen if you put dozens of web features in the same web application? A new monster is born:
As a extremely summary, microfronted is the same as microservice but for frontends
As you should already know, microservices has a lot of advantages. These advantages also applies to microfrontends. One of most important is: Independent deployment
Just as with microservices, independent deployability of micro frontends is key. This reduces the scope of any given deployment, which in turn reduces the associated risk.
In your case,
Check these links;
Upvotes: 3