Skip to content

Commit

Permalink
build(webpack): introduce index.web.ts to allow separate exports per …
Browse files Browse the repository at this point in the history
…platform (NodeJS vs Browser)

This implicitly solves the issue of having webpack bundling issues when the browser build has node
only APIs pulled in such as an HTTP server.

Signed-off-by: Peter Somogyvari <peter.somogyvari@accenture.com>
  • Loading branch information
petermetz committed May 19, 2020
1 parent 7bfd7aa commit 195d759
Show file tree
Hide file tree
Showing 13 changed files with 13 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export {};
1 change: 1 addition & 0 deletions packages/cactus-common/src/main/typescript/index.web.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from "./public-api";
1 change: 1 addition & 0 deletions packages/cactus-core-api/src/main/typescript/index.web.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from "./public-api";
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export {};
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export {};
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export {};
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export {};
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from "./generated/openapi/typescript-axios/index";
1 change: 1 addition & 0 deletions packages/cactus-sdk/src/main/typescript/index.web.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from "./public-api";
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export {};
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export {};
2 changes: 1 addition & 1 deletion webpack.dev.web.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ const libraryName = `${packageNameNoScope}`;

module.exports = {
entry: {
[pkg.browser]: `${packageDir}/src/main/typescript/index.ts`,
[pkg.browser]: `${packageDir}/src/main/typescript/index.web.ts`,
},
mode: "development",
devtool: "inline-source-map",
Expand Down
2 changes: 1 addition & 1 deletion webpack.prod.web.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ const libraryName = `${packageNameNoScope}`;

module.exports = {
entry: {
[pkg.browserMinified]: `${packageDir}/src/main/typescript/index.ts`,
[pkg.browserMinified]: `${packageDir}/src/main/typescript/index.web.ts`,
},
mode: "production",
devtool: "source-map",
Expand Down

0 comments on commit 195d759

Please sign in to comment.