@sabaaa1/common 0.0.7 → 0.0.9
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/package.json +1 -1
- package/vite.config.ts +11 -17
package/package.json
CHANGED
package/vite.config.ts
CHANGED
|
@@ -13,11 +13,8 @@ type ViteConfig = UserConfig & { test: InlineConfig };
|
|
|
13
13
|
const config: ViteConfig = {
|
|
14
14
|
root: __dirname,
|
|
15
15
|
base: './',
|
|
16
|
-
|
|
17
16
|
plugins: [
|
|
18
17
|
polyfillConstants(),
|
|
19
|
-
// TODO: needs to be decided if it is needed
|
|
20
|
-
// polyfillWorker(),
|
|
21
18
|
dts({
|
|
22
19
|
entryRoot: 'src',
|
|
23
20
|
tsconfigPath: path.join(__dirname, 'tsconfig.lib.json'),
|
|
@@ -29,22 +26,17 @@ const config: ViteConfig = {
|
|
|
29
26
|
closeBundle: copyPackage,
|
|
30
27
|
},
|
|
31
28
|
],
|
|
32
|
-
|
|
33
29
|
worker: {
|
|
34
30
|
format: 'es',
|
|
35
31
|
plugins: () => [polyfillConstants(), nxViteTsPaths()],
|
|
36
32
|
},
|
|
37
|
-
|
|
38
|
-
// Configuration for building your library.
|
|
39
|
-
// See: https://vitejs.dev/guide/build.html#library-mode
|
|
40
33
|
build: {
|
|
41
|
-
target: 'esnext',
|
|
34
|
+
target: 'esnext',
|
|
42
35
|
outDir: '../../../dist/libs/shared/common',
|
|
43
36
|
reportCompressedSize: true,
|
|
44
37
|
commonjsOptions: { transformMixedEsModules: true },
|
|
45
38
|
emptyOutDir: true,
|
|
46
39
|
lib: {
|
|
47
|
-
// Could also be a dictionary or array of multiple entry points.
|
|
48
40
|
entry: [
|
|
49
41
|
'src/index.ts',
|
|
50
42
|
'src/providers/WagmiProviderAdapter.ts',
|
|
@@ -54,26 +46,28 @@ const config: ViteConfig = {
|
|
|
54
46
|
],
|
|
55
47
|
name: 'shared-common',
|
|
56
48
|
fileName: (format, entryName) => `${entryName}.${format === 'cjs' ? 'cjs' : 'mjs'}`,
|
|
57
|
-
// Change this to the formats you want to support.
|
|
58
|
-
// Don't forgot to update your package.json as well.
|
|
59
49
|
formats: ['es', 'cjs'],
|
|
60
50
|
},
|
|
61
51
|
rollupOptions: {
|
|
62
52
|
output: {
|
|
63
|
-
// Required for partial imports functionality in sdk
|
|
64
53
|
preserveModules: true,
|
|
65
|
-
// remove unnedded folders structure from dist table
|
|
66
54
|
preserveModulesRoot: path.resolve(__dirname, './src'),
|
|
67
55
|
},
|
|
68
|
-
|
|
69
|
-
|
|
56
|
+
external: (id) => {
|
|
57
|
+
const allDeps = [
|
|
58
|
+
...Object.keys(dependencies),
|
|
59
|
+
...Object.keys(devDependencies),
|
|
60
|
+
...Object.keys(peerDependencies),
|
|
61
|
+
];
|
|
62
|
+
|
|
63
|
+
// Match exact package or any subpath (e.g., '@wagmi/core' or '@wagmi/core/actions')
|
|
64
|
+
return allDeps.some((dep) => id === dep || id.startsWith(`${dep}/`));
|
|
65
|
+
},
|
|
70
66
|
},
|
|
71
67
|
},
|
|
72
|
-
|
|
73
68
|
test: {
|
|
74
69
|
globals: true,
|
|
75
70
|
environment: 'jsdom',
|
|
76
|
-
// setupFiles: './setupTests.ts',
|
|
77
71
|
include: ['src/**/*.{test,spec}.{js,mjs,cjs,ts,mts,cts,jsx,tsx}'],
|
|
78
72
|
hookTimeout: 1000000,
|
|
79
73
|
},
|