bsv2 2.0.18 → 2.0.20

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/entry.js CHANGED
@@ -16,7 +16,7 @@ import pbkdf2 from 'pbkdf2'
16
16
  import { Buffer } from 'buffer';
17
17
 
18
18
  // version string.
19
- import pkgInfo from './package.json'
19
+ import pkgInfo from './package.json' assert {type: 'json'};
20
20
 
21
21
  // Dependencies, subject to change.
22
22
  const deps = {
package/package.json CHANGED
@@ -1,13 +1,13 @@
1
1
  {
2
2
  "name": "bsv2",
3
3
  "description": "Javascript library for Bitcoin SV (BSV).",
4
- "version": "2.0.18",
4
+ "version": "2.0.20",
5
5
  "author": "Tomás Díaz",
6
6
  "homepage": "https://github.com/samooth/bsv",
7
7
  "source": "entry.js",
8
- "main": "dist/bsv2.cjs.js",
9
- "module": "dist/bsv2.module.js",
10
- "unpkg": "dist/bsv2.bundle.js",
8
+ "main": "dist/main.cjs.js",
9
+ "module": "dist/main.module.js",
10
+ "unpkg": "dist/main.bundle.js",
11
11
  "library": "bsv2",
12
12
  "scripts": {
13
13
  "clean": "rm -rf node_modules/* yarn.lock",
@@ -105,7 +105,8 @@
105
105
  "hash.js": "^1.1.7",
106
106
  "is-hexadecimal": "^2.0.1",
107
107
  "pbkdf2": "3.1.2",
108
- "randombytes": "^2.1.0"
108
+ "randombytes": "^2.1.0",
109
+ "webpack-merge": "^5.10.0"
109
110
  },
110
111
  "devDependencies": {
111
112
  "@babel/core": "7.18.10",
@@ -116,6 +117,7 @@
116
117
  "assert": "2.0.0",
117
118
  "babel-loader": "8.2.5",
118
119
  "documentation": "^14.0.1",
120
+ "esbuild-loader": "^4.1.0",
119
121
  "husky": "^9.0.10",
120
122
  "karma": "^6.4.0",
121
123
  "karma-chrome-launcher": "^3.1.1",
package/webpack.config.js CHANGED
@@ -1,5 +1,7 @@
1
1
  const path = require('path')
2
2
  const webpack = require('webpack')
3
+
4
+ const { EsbuildPlugin } = require('esbuild-loader')
3
5
  const pkg = require('./package.json')
4
6
 
5
7
  module.exports = [
@@ -8,7 +10,7 @@ module.exports = [
8
10
  target: 'web',
9
11
  output: {
10
12
  path: path.resolve(__dirname, 'dist'),
11
- filename: 'bsv2.bundle.js',
13
+ filename: '[name].bundle.js',
12
14
  library: {
13
15
  name: 'bsv2',
14
16
  type: 'umd2'
@@ -17,11 +19,25 @@ module.exports = [
17
19
  resolve: {
18
20
  fallback:{
19
21
  buffer: require.resolve('buffer/'),
22
+ "util": false,
20
23
  },
21
24
  alias: {
22
25
  process: 'process/browser'
23
26
  }
24
27
  },
28
+ optimization: {
29
+ // ...
30
+ splitChunks: {
31
+ chunks: 'all',
32
+ },
33
+
34
+ minimizer: [
35
+ new EsbuildPlugin({
36
+ keepNames: true,
37
+ }),
38
+ // ...
39
+ ],
40
+ },
25
41
  plugins: [
26
42
  new webpack.ProvidePlugin({
27
43
  process: 'process/browser',
@@ -30,7 +46,7 @@ module.exports = [
30
46
  Buffer: ['buffer', 'Buffer']
31
47
  })
32
48
  ],
33
- devtool: 'source-map',
49
+ //devtool: 'source-map',
34
50
  mode: 'production'
35
51
  },
36
52
  {
@@ -38,25 +54,55 @@ module.exports = [
38
54
  target: 'node',
39
55
  output: {
40
56
  path: path.resolve(__dirname, 'dist'),
41
- filename: 'bsv2.module.js',
57
+ filename: '[name].module.js',
42
58
  library: {
43
59
  type: 'commonjs-module'
44
60
  }
45
61
  },
46
- devtool: 'source-map',
62
+ optimization: {
63
+ splitChunks: {
64
+ chunks: 'all',
65
+ },
66
+
67
+ // ...
68
+ minimizer: [
69
+ new EsbuildPlugin({
70
+ keepNames: true,
71
+ }),
72
+ // ...
73
+ ],
74
+ },
75
+ resolve: {
76
+ fallback:{
77
+ "util": false
78
+ }
79
+ },
80
+ //devtool: 'source-map',
47
81
  mode: 'production'
48
82
  },
49
83
  {
50
84
  entry: './entry.js',
51
85
  experiments:{outputModule:true},
86
+ optimization: {
87
+ splitChunks: {
88
+ chunks: 'all',
89
+ },
90
+ // ...
91
+ minimizer: [
92
+ new EsbuildPlugin({
93
+ keepNames: true,
94
+ }),
95
+ // ...
96
+ ],
97
+ },
52
98
  output: {
53
99
  path: path.resolve(__dirname, 'dist'),
54
- filename: 'bsv2.mjs',
100
+ filename: '[name].mjs',
55
101
  library: {
56
102
  type: 'module'
57
103
  }
58
104
  },
59
- devtool: 'source-map',
105
+ // devtool: 'source-map',
60
106
  mode: 'production'
61
107
  },
62
108
  {
@@ -64,12 +110,17 @@ module.exports = [
64
110
  target: 'node',
65
111
  output: {
66
112
  path: path.resolve(__dirname, 'dist'),
67
- filename: 'bsv2.cjs.js',
113
+ filename: '[name].cjs.js',
68
114
  library: {
69
115
  type: 'commonjs2'
70
116
  }
71
117
  },
72
- devtool: 'source-map',
118
+ resolve: {
119
+ fallback:{
120
+ "util": false
121
+ }
122
+ },
123
+ // devtool: 'source-map',
73
124
  mode: 'production'
74
125
  }
75
126
  ]