Skip to content

Commit

Permalink
added bundled version
Browse files Browse the repository at this point in the history
  • Loading branch information
Silas Günther committed Apr 13, 2023
1 parent 42fcccb commit a9b28a9
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ The import of the package slightly differs in a web application from a Node.js a
### Web Application

```html
<script src="node_modules/@churchtools/churchtools-client/dist/churchtools-client.js"></script>
<script src="node_modules/@churchtools/churchtools-client/dist/churchtools-client.bundled.js"></script>
<script>
const { churchtoolsClient, activateLogging } = window.churchtoolsClient;
Expand Down
2 changes: 1 addition & 1 deletion examples/Browser/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
<div id="greeting" style="display: none">
Hello <span id="name"></span>!
</div>
<script src="node_modules/@churchtools/churchtools-client/dist/churchtools-client.js"></script>
<script src="node_modules/@churchtools/churchtools-client/dist/churchtools-client.bundled.js"></script>
<script>
const { churchtoolsClient, activateLogging } = window.churchtoolsClient;

Expand Down
6 changes: 3 additions & 3 deletions webpack.config.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
const path = require('path');

const generateConfig = (extraTarget, outputFile) => ({
const generateConfig = (extraTarget, outputFile, includeLibraries) => ({
entry: './src/index.ts',
output: {
path: path.resolve(__dirname, 'dist'),
Expand Down Expand Up @@ -29,7 +29,7 @@ const generateConfig = (extraTarget, outputFile) => ({
}
]
},
externals: extraTarget === 'node' ? {
externals: !includeLibraries ? {
'axios': 'commonjs axios',
'axios-logger': 'commonjs axios-logger'
} : {},
Expand All @@ -40,4 +40,4 @@ const generateConfig = (extraTarget, outputFile) => ({
}
});

module.exports = [generateConfig('web', 'churchtools-client.js'), generateConfig('node', 'churchtools-client.node.js')];
module.exports = [generateConfig('web', 'churchtools-client.js', false), generateConfig('web', 'churchtools-client.bundled.js', true), generateConfig('node', 'churchtools-client.node.js', false)];

0 comments on commit a9b28a9

Please sign in to comment.