diff --git a/.github/workflows/bundle_webpack.yml b/.github/workflows/bundle_webpack.yml index 8a109221fb..e0575229a8 100644 --- a/.github/workflows/bundle_webpack.yml +++ b/.github/workflows/bundle_webpack.yml @@ -13,7 +13,7 @@ jobs: bundle-webpack: runs-on: ubuntu-latest steps: - - + - name: Checkout repository uses: actions/checkout@v2 - @@ -22,7 +22,7 @@ jobs: node-version: lts/hydrogen - run: npm ci - run: npm run build - - run: cd packages/taquito-local-forging && npm run build-webpack + - run: npm -w packages/taquito-local-forging run build-webpack - uses: actions/upload-artifact@v3 with: @@ -30,3 +30,12 @@ jobs: path: | packages/taquito-local-forging/dist/taquito_local_forging.js packages/taquito-local-forging/dist/taquito_local_forging.js.map + + - run: npm -w packages/taquito-beacon-wallet run build-webpack + - + uses: actions/upload-artifact@v3 + with: + name: taquito-beacon-wallet-vanilla + path: | + packages/taquito-beacon-wallet/dist/taquito_beacon_wallet.js + packages/taquito-beacon-wallet/dist/taquito_beacon_wallet.js.map diff --git a/package-lock.json b/package-lock.json index 2beb08ccbc..69e6b426f5 100644 --- a/package-lock.json +++ b/package-lock.json @@ -20601,7 +20601,9 @@ "ts-jest": "^29.1.1", "ts-node": "^10.9.1", "ts-toolbelt": "^9.6.0", - "typescript": "5.2.2" + "typescript": "5.2.2", + "webpack": "^5.89.0", + "webpack-cli": "^5.1.4" }, "engines": { "node": ">=18" diff --git a/packages/taquito-beacon-wallet/package.json b/packages/taquito-beacon-wallet/package.json index 372f782c46..f30b227fad 100644 --- a/packages/taquito-beacon-wallet/package.json +++ b/packages/taquito-beacon-wallet/package.json @@ -35,7 +35,8 @@ "prebuild": "rimraf dist", "version-stamp": "node ../taquito/version-stamping.js", "build": "tsc --project ./tsconfig.prod.json --module commonjs && rollup -c rollup.config.ts --bundleConfigAsCjs", - "start": "rollup -c rollup.config.ts --bundleConfigAsCjs -w" + "start": "rollup -c rollup.config.ts --bundleConfigAsCjs -w", + "build-webpack": "webpack --progress --color" }, "lint-staged": { "{src,test}/**/*.ts": [ @@ -97,7 +98,9 @@ "ts-jest": "^29.1.1", "ts-node": "^10.9.1", "ts-toolbelt": "^9.6.0", - "typescript": "5.2.2" + "typescript": "5.2.2", + "webpack": "^5.89.0", + "webpack-cli": "^5.1.4" }, "gitHead": "551e35aeff7d6dcde1c72284238c0ed3c3aae77e" } diff --git a/packages/taquito-beacon-wallet/webpack.config.js b/packages/taquito-beacon-wallet/webpack.config.js new file mode 100644 index 0000000000..17184a8080 --- /dev/null +++ b/packages/taquito-beacon-wallet/webpack.config.js @@ -0,0 +1,37 @@ +/* eslint-disable @typescript-eslint/no-var-requires */ +const webpack = require('webpack'); +const path = require('path'); + +module.exports = { + entry: { + "taquito_beacon_wallet": ['./src/taquito-beacon-wallet.ts'] + }, + mode: 'production', + module: { + rules: [ + { + test: /\.ts$/, + use: 'ts-loader', + exclude: /node_modules/ + } + ] + }, + devtool: 'source-map', + resolve: { + extensions: ['.tsx', '.ts', '.js'], + modules: ['node_modules'], + fallback: { + fs: false, + stream: require.resolve("stream-browserify") + } + }, + output: { + filename: '[name].js', + path: path.resolve(__dirname, 'dist'), + library: ['[name]'], + libraryTarget: "var" + }, + plugins: [ + new webpack.ProvidePlugin({ Buffer: ['buffer', 'Buffer'] }) + ] +}; \ No newline at end of file