react-global-state-hooks 15.0.18 → 16.0.0-beta

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/webpack.config.js DELETED
@@ -1,112 +0,0 @@
1
- const path = require('path');
2
- const TerserPlugin = require('terser-webpack-plugin');
3
-
4
- const individualEntries = {
5
- // inherit from react-global-state-hooks
6
- GlobalStore: './src/GlobalStore.ts',
7
- actions: './src/actions.ts',
8
- createContext: './src/createContext.ts',
9
- createGlobalState: './src/createGlobalState.ts',
10
- isRecord: './src/isRecord.ts',
11
- shallowCompare: './src/shallowCompare.ts',
12
- throwWrongKeyOnActionCollectionConfig: './src/throwWrongKeyOnActionCollectionConfig.ts',
13
- types: './src/types.ts',
14
- uniqueId: './src/uniqueId.ts',
15
- };
16
-
17
- const getExternalsForEntries = () => {
18
- const keys = Object.keys(individualEntries);
19
- const fromEntries = keys.reduce((acc, key) => {
20
- acc[`./${key}`] = `./${key}.js`;
21
- return acc;
22
- }, {});
23
-
24
- const fromBasePackage = keys.reduce((acc, key) => {
25
- acc[`react-hooks-global-states/${key}`] = `react-hooks-global-states/${key}`;
26
- return acc;
27
- }, {});
28
-
29
- return {
30
- ...fromEntries,
31
- ...fromBasePackage,
32
- };
33
- };
34
-
35
- module.exports = {
36
- mode: 'production',
37
- entry: {
38
- // inherit from react-global-state-hooks
39
- bundle: './src/index.ts',
40
- ...individualEntries,
41
- },
42
- externals: {
43
- react: 'react',
44
-
45
- 'json-storage-formatter': 'json-storage-formatter',
46
- 'json-storage-formatter/clone': 'json-storage-formatter/clone',
47
- 'json-storage-formatter/isNil': 'json-storage-formatter/isNil',
48
- 'json-storage-formatter/isNumber': 'json-storage-formatter/isNumber',
49
- 'json-storage-formatter/isBoolean': 'json-storage-formatter/isBoolean',
50
- 'json-storage-formatter/isString': 'json-storage-formatter/isString',
51
- 'json-storage-formatter/isDate': 'json-storage-formatter/isDate',
52
- 'json-storage-formatter/isRegex': 'json-storage-formatter/isRegex',
53
- 'json-storage-formatter/isFunction': 'json-storage-formatter/isFunction',
54
- 'json-storage-formatter/isPrimitive': 'json-storage-formatter/isPrimitive',
55
- 'json-storage-formatter/types': 'json-storage-formatter/types',
56
- 'json-storage-formatter/formatFromStore': 'json-storage-formatter/formatFromStore',
57
- 'json-storage-formatter/formatToStore': 'json-storage-formatter/formatToStore',
58
-
59
- 'react-hooks-global-states': 'react-hooks-global-states',
60
-
61
- ...getExternalsForEntries(),
62
- },
63
- output: {
64
- path: path.resolve(__dirname),
65
- filename: ({ chunk: { name } }) => {
66
- return `${name}.js`;
67
- },
68
- libraryTarget: 'umd',
69
- library: 'react-global-state-hooks',
70
- globalObject: 'this',
71
- },
72
- resolve: {
73
- extensions: ['.ts', '.js'],
74
- },
75
- module: {
76
- rules: [
77
- {
78
- test: /\.ts$/,
79
- use: 'ts-loader',
80
- exclude: /node_modules/,
81
- },
82
- ],
83
- },
84
- optimization: {
85
- minimize: true,
86
- minimizer: [
87
- new TerserPlugin({
88
- extractComments: false,
89
- terserOptions: {
90
- compress: {
91
- passes: 5,
92
- drop_console: true,
93
- drop_debugger: true,
94
- keep_fargs: false,
95
- keep_infinity: true,
96
- reduce_funcs: true,
97
- reduce_vars: true,
98
- keep_fnames: false,
99
- toplevel: true,
100
- },
101
- mangle: {
102
- toplevel: true,
103
- properties: false,
104
- },
105
- format: {
106
- comments: false,
107
- },
108
- },
109
- }),
110
- ],
111
- },
112
- };