@questwork/q-utilities 0.1.29 → 0.1.32

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/vite.config.js ADDED
@@ -0,0 +1,73 @@
1
+ import { defineConfig } from 'vite'
2
+ import path from 'path'
3
+ import dts from 'vite-plugin-dts'
4
+
5
+ export default defineConfig({
6
+ plugins: [
7
+ dts({
8
+ include: ['lib/**/*.js', 'lib/**/*.ts'],
9
+ exclude: ['**/*.spec.js', '**/*.spec.ts'],
10
+ rollupTypes: true,
11
+ outDir: 'dist',
12
+ rootDir: 'lib',
13
+ }),
14
+ ],
15
+ build: {
16
+ outDir: 'dist',
17
+ sourcemap: true,
18
+ lib: {
19
+ entry: path.resolve(__dirname, 'lib/index.ts'),
20
+ name: 'qUtilities', // This is the global variable name for IIFE/UMD
21
+ fileName: (format) => {
22
+ if (format === 'es') return 'q-utilities.esm.js'
23
+ if (format === 'cjs') return 'q-utilities.cjs'
24
+ if (format === 'umd') return 'q-utilities.umd.js'
25
+ if (format === 'iife') return 'q-utilities.iife.js'
26
+ return `q-utilities.${format}.js`
27
+ }
28
+ },
29
+ rollupOptions: {
30
+ external: [],
31
+ output: [
32
+ {
33
+ format: 'es',
34
+ generatedCode: 'es2015',
35
+ exports: 'named',
36
+ preserveModules: false
37
+ },
38
+ {
39
+ format: 'cjs',
40
+ exports: 'named',
41
+ interop: 'auto'
42
+ },
43
+ {
44
+ format: 'umd',
45
+ name: 'qUtilities',
46
+ exports: 'named',
47
+ extend: true,
48
+ esModule: true,
49
+ interop: 'auto'
50
+ },
51
+ {
52
+ format: 'iife',
53
+ name: 'qUtilities',
54
+ exports: 'named',
55
+ extend: true,
56
+ esModule: false,
57
+ interop: 'auto'
58
+ },
59
+ ],
60
+ },
61
+ },
62
+ test: {
63
+ environment: 'node',
64
+ coverage: {
65
+ reporter: ['text', 'html'],
66
+ },
67
+ globals: true,
68
+ setupFiles: ['lib/test.setup.js', 'lib/helpers/test.setup.js'],
69
+ mocha: {
70
+ ui: 'bdd',
71
+ },
72
+ },
73
+ })
@@ -0,0 +1,9 @@
1
+ import { defineConfig } from 'vitest/config'
2
+
3
+ export default defineConfig({
4
+ test: {
5
+ globals: true, // Required for your setup file's global hooks
6
+ setupFiles: ['./lib/test.setup.js'],
7
+ include: ['lib/**/*.spec.js'],
8
+ },
9
+ })