File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ name : deploy-container
2+
3+ on :
4+ push :
5+ branches :
6+ - master
7+ path :
8+ - ' packages/container/**'
9+
10+ defaults :
11+ run :
12+ working-directory : packages/container
13+
14+ jobs :
15+ build :
16+ runs-on : ubuntu-latest
17+
18+ steps :
19+ - uses : actions/checkout@v2
20+ - run : npm install
21+ - run : npm run build
22+
23+ - uses : shinyinc/action-aws-cli@v1.2
24+ - run : aws s3 sync dist s3://${{ secrets.AWS_S3_BUCKET_NAME }}/container/latest
25+ env :
26+ AWS_ACCESS_KEY_ID : ${{ secrets.AWS_ACCESS_KEY_ID }}
27+ AWS_SECRET_ACCESS_KEY : ${{ secrets.AWS_SECRET_ACCESS_KEY }}
28+ AWS_DEFAULT_REGION : " "
Original file line number Diff line number Diff line change 1+ const HtmlWebpackPlugin = require ( 'html-webpack-plugin' )
12module . exports = {
23 module : {
34 rules : [
@@ -13,5 +14,10 @@ module.exports = {
1314 }
1415 }
1516 ]
16- }
17+ } ,
18+ plugins : [
19+ new HtmlWebpackPlugin ( {
20+ template : './public/index.html'
21+ } )
22+ ]
1723}
Original file line number Diff line number Diff line change 11const { merge } = require ( 'webpack-merge' )
2- const HtmlWebpackPlugin = require ( 'html-webpack-plugin' )
32const ModuleFederationPlugin = require ( 'webpack/lib/container/ModuleFederationPlugin' )
43const commonConfig = require ( './webpack.common' )
54const packageJson = require ( '../package.json' )
@@ -22,9 +21,7 @@ const devConfig = {
2221 } ,
2322 shared : packageJson . dependencies ,
2423 } ) ,
25- new HtmlWebpackPlugin ( {
26- template : './public/index.html'
27- } )
24+
2825 ]
2926}
3027
Original file line number Diff line number Diff line change 1+ const { merge } = require ( 'webpack-merge' )
2+ const ModuleFederationPlugin = require ( 'webpack/lib/container/ModuleFederationPlugin' )
3+ const commonConfig = require ( './webpack.common' )
4+ const packageJson = require ( '../package.json' )
5+
6+ const domain = process . env . PRODUCTION_DOMAIN
7+
8+ const prodConfig = {
9+ mode : "production" ,
10+ output : {
11+ filename : '[name].[contenthash].js'
12+ } ,
13+ plugins : [
14+ new ModuleFederationPlugin ( {
15+ name : 'container' ,
16+ remotes : {
17+ marketingPage : `marketing@${ domain } /marketing/remoteEntry.js`
18+ } ,
19+ shared : packageJson . dependencies
20+ } )
21+ ]
22+ }
23+ module . exports = merge ( commonConfig , prodConfig )
Original file line number Diff line number Diff line change 22 "name" : " container" ,
33 "version" : " 1.0.0" ,
44 "scripts" : {
5- "start" : " webpack serve --config config/webpack.dev.js"
5+ "start" : " webpack serve --config config/webpack.dev.js" ,
6+ "build" : " webpack --config config/webpack.prod.js"
67 },
78 "dependencies" : {
89 "@material-ui/core" : " ^4.11.0" ,
Original file line number Diff line number Diff line change 1+ const { merge } = require ( 'webpack-merge' )
2+ const ModuleFederationPlugin = require ( 'webpack/lib/container/ModuleFederationPlugin' )
3+ const commonConfig = require ( './webpack.common' )
4+ const packageJson = require ( '../package.json' )
5+
6+ const prodConfig = {
7+ mode : 'production' ,
8+ output : {
9+ filename : '[name].[contenthash].js'
10+ } ,
11+ plugins : [
12+ new ModuleFederationPlugin ( {
13+ name : 'marketing' ,
14+ filename : 'remoteEntry.js' ,
15+ exposes : {
16+ './MarketingApp' : './src/bootstrap'
17+ } ,
18+ shared : packageJson . dependencies
19+ } )
20+ ]
21+ }
22+ module . exports = merge ( commonConfig , prodConfig )
Original file line number Diff line number Diff line change 22 "name" : " marketing" ,
33 "version" : " 1.0.0" ,
44 "scripts" : {
5- "start" : " webpack serve --config config/webpack.dev.js"
5+ "start" : " webpack serve --config config/webpack.dev.js" ,
6+ "build" : " webpack --config config/webpack.prod.js"
67 },
78 "dependencies" : {
89 "@material-ui/core" : " ^4.11.0" ,
You can’t perform that action at this time.
0 commit comments