eui-micro-frontend-builder

0.1.0 • Public • Published

eUI Micro frontend Builder

This is a custom webpack builder that is using angular architect package to build an angular module into a single js file. This can be then distributed and lazily loaded by an angular application.

How can i use the builder?

In your angular.json file, where projects are declared, under the architect.build set the builder to "eui-micro-frontend-builder:browser" .

Then you can build any module of your project like so: ng build --project features --prod --module=./app/features/module1/module1.module#Module --pluginName=module1 --sharedLibs=@micro/shared --outputPath=./features

Params

The builder support the below properties,

  • module: A string of the form path/to/file#exportName that acts as a path to include to bundle
  • pluginName: A name of compiled bundle
  • sharedLibs: A comma-delimited list of shared lib names used by current plugin
  • externals: A path to .json file which contains a list of external dependencies, like { dep1: 'mydep', dep2: 'another'}
  • extraWebpackConfig: path of the extra webpack configuration

Pay Attention!

Keep in mind that the builder works with the module mapping below. In case you import a module not mentioned here, you need to map it yourself by using the --externals <file.json> flag!

'rxjs': 'rxjs',
'@angular/core': 'ng.core',
'@angular/common': 'ng.common',
'@angular/forms': 'ng.forms',
'@angular/router': 'ng.router',
'@angular/platform-browser': 'ng.platform-browser',
'@angular/platform-browser/animations': 'ng.platform-browser-animation',
'@eui/core': 'eui.core',
'@eui/base': 'eui.base',
'@ngx-translate/core': 'ngx.translate',
'tslib': 'tslib'

Versions

Current Tags

VersionDownloads (Last 7 Days)Tag
0.1.01latest

Version History

VersionDownloads (Last 7 Days)Published
0.1.01
0.0.00

Package Sidebar

Install

npm i eui-micro-frontend-builder

Weekly Downloads

1

Version

0.1.0

License

MIT

Unpacked Size

21.7 kB

Total Files

6

Last publish

Collaborators

  • rambou