Skip to content

Commit

Permalink
Merge pull request #13 from casper-ecosystem/dev/client-and-node-buil…
Browse files Browse the repository at this point in the history
…d-in-webpack

fix for exports in compiled library
  • Loading branch information
hoffmannjan authored Mar 5, 2021
2 parents dbd12d7 + b8ad8eb commit 2e00d86
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 21 deletions.
7 changes: 2 additions & 5 deletions .github/workflows/publish-casper-client-sdk.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,9 @@ jobs:
- name: Get latest release version number
id: get_version
uses: battila7/get-version-action@v2
- run: npm run build:umd
env:
INPUT_TOKEN: ''
- run: mv dist/lib.umd.js dist/casper-client-sdk.v${{ steps.get_version.outputs.version }}.umd.js
- run: cp dist/lib.js casper-client-sdk.v${{ steps.get_version.outputs.version }}.js
- uses: meeDamian/github-release@2.0
with:
token: ${{ secrets.GITHUB_TOKEN }}
files: dist/casper-client-sdk.v${{ steps.get_version.outputs.version }}.umd.js
files: casper-client-sdk.v${{ steps.get_version.outputs.version }}.js
allow_override: true
3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "casper-client-sdk",
"version": "1.0.30",
"version": "1.0.31",
"license": "Apache 2.0",
"description": "SDK to interact with the Casper blockchain",
"main": "dist/lib.node.js",
Expand All @@ -11,7 +11,6 @@
"lint": "eslint src/ --fix",
"prebuild": "npm run clean && npm run lint",
"build": "webpack --config webpack.config.js",
"build:umd": "webpack --config webpack.config.umd.js",
"clean": "rm -rf ./dist",
"~build": "tsc --watch",
"test": "TS_NODE_FILES=true mocha -r ts-node/register test/**/*.test.ts",
Expand Down
6 changes: 4 additions & 2 deletions webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ const serverConfig = {
target: 'node',
output: {
path: path.resolve(__dirname, 'dist'),
filename: 'lib.node.js'
filename: 'lib.node.js',
libraryTarget: 'umd'
},
externals: [nodeExternals()] // in order to ignore all modules in node_modules folder
};
Expand All @@ -47,7 +48,8 @@ const clientConfig = {
],
output: {
path: path.resolve(__dirname, 'dist'),
filename: 'lib.js'
filename: 'lib.js',
libraryTarget: 'umd'
}
};

Expand Down
12 changes: 0 additions & 12 deletions webpack.config.umd.js

This file was deleted.

0 comments on commit 2e00d86

Please sign in to comment.