@thednp/shorty 2.0.0-alpha9 → 2.0.1

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/tsconfig.json ADDED
@@ -0,0 +1,30 @@
1
+ {
2
+ // https://janessagarrow.com/blog/typescript-and-esbuild/
3
+ "compilerOptions": {
4
+ "lib": ["DOM", "ESNext", "DOM.Iterable"],
5
+ // "types": ["vite", "vite/client"],
6
+ "rootDir": "./",
7
+ "baseUrl": "./",
8
+ "module": "ESNext",
9
+ "target": "ESNext",
10
+ "moduleResolution": "Node",
11
+ "allowJs": true,
12
+ "forceConsistentCasingInFileNames": true,
13
+ "useDefineForClassFields": true,
14
+ "strict": true,
15
+ "sourceMap": true,
16
+ "resolveJsonModule": true,
17
+ "esModuleInterop": true,
18
+ "isolatedModules": true,
19
+ "noUnusedLocals": true,
20
+ "noUnusedParameters": true,
21
+ "noImplicitReturns": true,
22
+ "removeComments": false,
23
+ "allowSyntheticDefaultImports": true,
24
+ "noEmit": true,
25
+ "checkJs": true,
26
+ "skipLibCheck": true // allows dts-bundle-generator to import from package.json
27
+ },
28
+ "include": ["src/*", "src/**/*"],
29
+ "exclude": ["node_modules", "experiments", "coverage", "dist"],
30
+ }
package/vite.config.ts ADDED
@@ -0,0 +1,30 @@
1
+ import { resolve } from 'path';
2
+ import { defineConfig } from 'vite';
3
+ import { name } from './package.json';
4
+
5
+ const getPackageName = () => {
6
+ return name.includes('@') ? name.split('/')[1] : name;
7
+ };
8
+
9
+ const NAME = 'SHORTY';
10
+
11
+ const fileName = {
12
+ es: `${getPackageName()}.mjs`,
13
+ cjs: `${getPackageName()}.cjs`,
14
+ iife: `${getPackageName()}.js`,
15
+ };
16
+
17
+ export default defineConfig({
18
+ base: './',
19
+ build: {
20
+ emptyOutDir: true,
21
+ outDir: 'dist',
22
+ lib: {
23
+ entry: resolve(__dirname, 'src/index.ts'),
24
+ name: NAME,
25
+ formats: ['es', 'cjs', 'iife'],
26
+ fileName: (format) => fileName[format],
27
+ },
28
+ sourcemap: true,
29
+ },
30
+ });