share-loaderShare modules between webpack applications
Share Loader
The share loader allows you to share modules between webpack builds via a global namespace
Install
npm i share-loader --save-dev
Or
yarn add share-loader --save-dev
Usage
webpack config of exposing app
module: {
rules: [{
test: /\.js?$/,
use: [{
loader: 'share-loader',
options: {
modules: [/@angular/, /@uirouter\/angular/],
exclude: [/@angular\/material/],
namespace: 'some-name-space'
}
}]
}]
}
webpack config of consumer apps
const {Externals} = require('./share-loader');
externals: [
Externals({
namespace: 'some-name-space',
modules: [/@angular/, /@uirouter\/angular/]
})
],
output: {
library: 'some-name-space',
libraryTarget: 'umd'
}
Example
1. In the root folder, run npm bootstrap
2. Run npm run build:prod in the ext-app-1 root
3. Host the ext1.js file from ext-app-1 project in some localhost server
4. Change the <%path-to-server-host%> in the shell project app.state.ts
5. Run npm run serve:dev in the shell project root
Example-cli
1. In the root folder, run npm bootstrap
2. In "shell app" folder run npm run start:prod
3. In the "ext-app1" folder run npm run start:ext:prod
4. For AOT run npm serve --prod in "shell-app" and npm run serve:ext:prod in "ext-app1"
5. You can also run ext-app1 in standalone mode with ng serve
评论
MCW-Cloud-native-applicationsMCW Cloud-native applications
MicrosoftCloudWorkshops-RetirementSurveyAswelooktostreamlinecontentandimprovetraining,weareconsideri
MCW-Cloud-native-applicationsMCW Cloud-native applications
0
MCW-Cloud-native-applicationsMCW Cloud-native applications
Microsoft Cloud Workshops - Retirement SurveyAs we
MCW-Cloud-native-applicationsMCW Cloud-native applications
0
Android Applications Manager
AndroidApplicationsManager是一个第三方的Android手机应用程序管理工具,你可以直接在PC上对手机的应用进行管理。
Android Applications Manager
0
ManageEngine Applications Manager
卓豪Applications Manager是针对企业各种业务监控管理需求推出的应用性能监控与管理解决方案,采用了无监控代理(Agentless)最新技术,易于部署的Web架构.
Zoho CRM Analytics
0
eyeglassNPM Modules for Sass
Welcome to the Eyeglass MonorepoEyeglass provides
eyeglassNPM Modules for Sass
0
eyeglassNPM Modules for Sass
WelcometotheEyeglassMonorepoEyeglassprovidesawaytodistributeSassfilesandtheirassociatedassetsandjava
eyeglassNPM Modules for Sass
0
Spring Dynamic Modules
SpringDynamicModules的前身是SpringOSGi。SpringDynamicModules,让写Spring应用可以部署在一个的OSGi执行环境,而且还可以充分利用所提供的服务的O
Spring Dynamic Modules
0