diff --git a/package-lock.json b/package-lock.json index 55ecfba8..b4b785c9 100644 --- a/package-lock.json +++ b/package-lock.json @@ -5698,6 +5698,11 @@ "version": "0.1.0", "license": "Apache-2.0", "devDependencies": { + "@rollup/plugin-commonjs": "^25.0.0", + "@rollup/plugin-node-resolve": "^15.0.0", + "@rollup/plugin-typescript": "^11.0.0", + "rollup": "^4.0.0", + "tslib": "^2.6.0", "typescript": "^5.3.0" } }, diff --git a/packages/core/icons/package.json b/packages/core/icons/package.json index a643ec18..4909b847 100644 --- a/packages/core/icons/package.json +++ b/packages/core/icons/package.json @@ -16,7 +16,7 @@ "dist" ], "scripts": { - "build": "tsup", + "build": "rollup -c && tsc --project tsconfig.build.json", "test": "echo \"No tests yet\"", "clean": "rm -rf dist" }, @@ -29,6 +29,11 @@ ], "license": "Apache-2.0", "devDependencies": { + "rollup": "^4.0.0", + "@rollup/plugin-typescript": "^11.0.0", + "@rollup/plugin-node-resolve": "^15.0.0", + "@rollup/plugin-commonjs": "^25.0.0", + "tslib": "^2.6.0", "typescript": "^5.3.0" }, "publishConfig": { diff --git a/packages/core/icons/rollup.config.js b/packages/core/icons/rollup.config.js new file mode 100644 index 00000000..0fe567ba --- /dev/null +++ b/packages/core/icons/rollup.config.js @@ -0,0 +1,62 @@ +const typescript = require('@rollup/plugin-typescript'); +const resolve = require('@rollup/plugin-node-resolve'); +const commonjs = require('@rollup/plugin-commonjs'); + +module.exports = [ + // ESM build + { + input: 'src/index.ts', + output: { + file: 'dist/index.mjs', + format: 'esm', + sourcemap: true, + }, + external: (id) => { + // Don't externalize relative imports (starts with . or /) + if (id.startsWith('.') || id.startsWith('/')) return false; + // Don't externalize absolute paths (local files) + if (id.includes('/') && !id.startsWith('@')) return false; + // Externalize all npm packages (including scoped ones) + return true; + }, + plugins: [ + resolve({ + extensions: ['.js', '.jsx', '.ts', '.tsx'] + }), + commonjs(), + typescript({ + tsconfig: 'tsconfig.json', + declaration: false, + outDir: 'dist', + }), + ], + }, + // CommonJS build + { + input: 'src/index.ts', + output: { + file: 'dist/index.js', + format: 'cjs', + sourcemap: true, + }, + external: (id) => { + // Don't externalize relative imports (starts with . or /) + if (id.startsWith('.') || id.startsWith('/')) return false; + // Don't externalize absolute paths (local files) + if (id.includes('/') && !id.startsWith('@')) return false; + // Externalize all npm packages (including scoped ones) + return true; + }, + plugins: [ + resolve({ + extensions: ['.js', '.jsx', '.ts', '.tsx'] + }), + commonjs(), + typescript({ + tsconfig: 'tsconfig.json', + declaration: false, + outDir: 'dist', + }), + ], + }, +]; \ No newline at end of file diff --git a/packages/core/icons/tsconfig.build.json b/packages/core/icons/tsconfig.build.json new file mode 100644 index 00000000..4f424202 --- /dev/null +++ b/packages/core/icons/tsconfig.build.json @@ -0,0 +1,11 @@ +{ + "extends": "./tsconfig.json", + "compilerOptions": { + "declaration": true, + "declarationDir": "dist", + "emitDeclarationOnly": true, + "outDir": "dist", + "skipLibCheck": true + }, + "exclude": ["dist", "node_modules"] +} \ No newline at end of file diff --git a/packages/core/icons/tsup.config.ts b/packages/core/icons/tsup.config.ts deleted file mode 100644 index 108499a4..00000000 --- a/packages/core/icons/tsup.config.ts +++ /dev/null @@ -1,21 +0,0 @@ -import { defineConfig } from 'tsup'; - -export default defineConfig({ - entry: ['src/index.ts'], - format: ['cjs', 'esm'], - clean: true, - sourcemap: true, - outDir: 'dist', - external: [ - // Keep all dependencies external for library builds - /^@vjs-10\//, - /^[^.]/, - ], - // Generate TypeScript declarations with custom config - dts: { - compilerOptions: { - composite: false, - incremental: false, - }, - }, -}); \ No newline at end of file diff --git a/packages/html/html-icons/package.json b/packages/html/html-icons/package.json index 0ae27fbf..f8b255e1 100644 --- a/packages/html/html-icons/package.json +++ b/packages/html/html-icons/package.json @@ -16,7 +16,7 @@ "dist" ], "scripts": { - "build": "tsup", + "build": "rollup -c && tsc --project tsconfig.build.json", "test": "echo \"No tests yet\"", "clean": "rm -rf dist" }, @@ -33,6 +33,11 @@ "@vjs-10/icons": "*" }, "devDependencies": { + "rollup": "^4.0.0", + "@rollup/plugin-typescript": "^11.0.0", + "@rollup/plugin-node-resolve": "^15.0.0", + "@rollup/plugin-commonjs": "^25.0.0", + "tslib": "^2.6.0", "typescript": "^5.3.0" }, "publishConfig": { diff --git a/packages/html/html-icons/rollup.config.js b/packages/html/html-icons/rollup.config.js new file mode 100644 index 00000000..0fe567ba --- /dev/null +++ b/packages/html/html-icons/rollup.config.js @@ -0,0 +1,62 @@ +const typescript = require('@rollup/plugin-typescript'); +const resolve = require('@rollup/plugin-node-resolve'); +const commonjs = require('@rollup/plugin-commonjs'); + +module.exports = [ + // ESM build + { + input: 'src/index.ts', + output: { + file: 'dist/index.mjs', + format: 'esm', + sourcemap: true, + }, + external: (id) => { + // Don't externalize relative imports (starts with . or /) + if (id.startsWith('.') || id.startsWith('/')) return false; + // Don't externalize absolute paths (local files) + if (id.includes('/') && !id.startsWith('@')) return false; + // Externalize all npm packages (including scoped ones) + return true; + }, + plugins: [ + resolve({ + extensions: ['.js', '.jsx', '.ts', '.tsx'] + }), + commonjs(), + typescript({ + tsconfig: 'tsconfig.json', + declaration: false, + outDir: 'dist', + }), + ], + }, + // CommonJS build + { + input: 'src/index.ts', + output: { + file: 'dist/index.js', + format: 'cjs', + sourcemap: true, + }, + external: (id) => { + // Don't externalize relative imports (starts with . or /) + if (id.startsWith('.') || id.startsWith('/')) return false; + // Don't externalize absolute paths (local files) + if (id.includes('/') && !id.startsWith('@')) return false; + // Externalize all npm packages (including scoped ones) + return true; + }, + plugins: [ + resolve({ + extensions: ['.js', '.jsx', '.ts', '.tsx'] + }), + commonjs(), + typescript({ + tsconfig: 'tsconfig.json', + declaration: false, + outDir: 'dist', + }), + ], + }, +]; \ No newline at end of file diff --git a/packages/html/html-icons/tsconfig.build.json b/packages/html/html-icons/tsconfig.build.json new file mode 100644 index 00000000..4f424202 --- /dev/null +++ b/packages/html/html-icons/tsconfig.build.json @@ -0,0 +1,11 @@ +{ + "extends": "./tsconfig.json", + "compilerOptions": { + "declaration": true, + "declarationDir": "dist", + "emitDeclarationOnly": true, + "outDir": "dist", + "skipLibCheck": true + }, + "exclude": ["dist", "node_modules"] +} \ No newline at end of file diff --git a/packages/html/html-icons/tsup.config.ts b/packages/html/html-icons/tsup.config.ts deleted file mode 100644 index 108499a4..00000000 --- a/packages/html/html-icons/tsup.config.ts +++ /dev/null @@ -1,21 +0,0 @@ -import { defineConfig } from 'tsup'; - -export default defineConfig({ - entry: ['src/index.ts'], - format: ['cjs', 'esm'], - clean: true, - sourcemap: true, - outDir: 'dist', - external: [ - // Keep all dependencies external for library builds - /^@vjs-10\//, - /^[^.]/, - ], - // Generate TypeScript declarations with custom config - dts: { - compilerOptions: { - composite: false, - incremental: false, - }, - }, -}); \ No newline at end of file diff --git a/packages/html/html/package.json b/packages/html/html/package.json index 55cdf1d2..e3942d09 100644 --- a/packages/html/html/package.json +++ b/packages/html/html/package.json @@ -16,7 +16,7 @@ "dist" ], "scripts": { - "build": "tsup", + "build": "rollup -c && tsc --project tsconfig.build.json", "test": "echo \"No tests yet\"", "clean": "rm -rf dist" }, @@ -34,6 +34,11 @@ "@vjs-10/html-media-store": "*" }, "devDependencies": { + "rollup": "^4.0.0", + "@rollup/plugin-typescript": "^11.0.0", + "@rollup/plugin-node-resolve": "^15.0.0", + "@rollup/plugin-commonjs": "^25.0.0", + "tslib": "^2.6.0", "typescript": "^5.3.0" }, "publishConfig": { diff --git a/packages/html/html/rollup.config.js b/packages/html/html/rollup.config.js new file mode 100644 index 00000000..0fe567ba --- /dev/null +++ b/packages/html/html/rollup.config.js @@ -0,0 +1,62 @@ +const typescript = require('@rollup/plugin-typescript'); +const resolve = require('@rollup/plugin-node-resolve'); +const commonjs = require('@rollup/plugin-commonjs'); + +module.exports = [ + // ESM build + { + input: 'src/index.ts', + output: { + file: 'dist/index.mjs', + format: 'esm', + sourcemap: true, + }, + external: (id) => { + // Don't externalize relative imports (starts with . or /) + if (id.startsWith('.') || id.startsWith('/')) return false; + // Don't externalize absolute paths (local files) + if (id.includes('/') && !id.startsWith('@')) return false; + // Externalize all npm packages (including scoped ones) + return true; + }, + plugins: [ + resolve({ + extensions: ['.js', '.jsx', '.ts', '.tsx'] + }), + commonjs(), + typescript({ + tsconfig: 'tsconfig.json', + declaration: false, + outDir: 'dist', + }), + ], + }, + // CommonJS build + { + input: 'src/index.ts', + output: { + file: 'dist/index.js', + format: 'cjs', + sourcemap: true, + }, + external: (id) => { + // Don't externalize relative imports (starts with . or /) + if (id.startsWith('.') || id.startsWith('/')) return false; + // Don't externalize absolute paths (local files) + if (id.includes('/') && !id.startsWith('@')) return false; + // Externalize all npm packages (including scoped ones) + return true; + }, + plugins: [ + resolve({ + extensions: ['.js', '.jsx', '.ts', '.tsx'] + }), + commonjs(), + typescript({ + tsconfig: 'tsconfig.json', + declaration: false, + outDir: 'dist', + }), + ], + }, +]; \ No newline at end of file diff --git a/packages/html/html/tsconfig.build.json b/packages/html/html/tsconfig.build.json new file mode 100644 index 00000000..4f424202 --- /dev/null +++ b/packages/html/html/tsconfig.build.json @@ -0,0 +1,11 @@ +{ + "extends": "./tsconfig.json", + "compilerOptions": { + "declaration": true, + "declarationDir": "dist", + "emitDeclarationOnly": true, + "outDir": "dist", + "skipLibCheck": true + }, + "exclude": ["dist", "node_modules"] +} \ No newline at end of file diff --git a/packages/html/html/tsup.config.ts b/packages/html/html/tsup.config.ts deleted file mode 100644 index 108499a4..00000000 --- a/packages/html/html/tsup.config.ts +++ /dev/null @@ -1,21 +0,0 @@ -import { defineConfig } from 'tsup'; - -export default defineConfig({ - entry: ['src/index.ts'], - format: ['cjs', 'esm'], - clean: true, - sourcemap: true, - outDir: 'dist', - external: [ - // Keep all dependencies external for library builds - /^@vjs-10\//, - /^[^.]/, - ], - // Generate TypeScript declarations with custom config - dts: { - compilerOptions: { - composite: false, - incremental: false, - }, - }, -}); \ No newline at end of file diff --git a/packages/react/react-icons/package.json b/packages/react/react-icons/package.json index e8fe596b..e9d62c39 100644 --- a/packages/react/react-icons/package.json +++ b/packages/react/react-icons/package.json @@ -16,7 +16,7 @@ "dist" ], "scripts": { - "build": "tsup", + "build": "rollup -c && tsc --project tsconfig.build.json", "test": "echo \"No tests yet\"", "clean": "rm -rf dist" }, @@ -35,6 +35,11 @@ "react": ">=16.8.0" }, "devDependencies": { + "rollup": "^4.0.0", + "@rollup/plugin-typescript": "^11.0.0", + "@rollup/plugin-node-resolve": "^15.0.0", + "@rollup/plugin-commonjs": "^25.0.0", + "tslib": "^2.6.0", "typescript": "^5.3.0", "@types/react": "^18.0.0", "react": "^18.0.0" diff --git a/packages/react/react-icons/rollup.config.js b/packages/react/react-icons/rollup.config.js new file mode 100644 index 00000000..0fe567ba --- /dev/null +++ b/packages/react/react-icons/rollup.config.js @@ -0,0 +1,62 @@ +const typescript = require('@rollup/plugin-typescript'); +const resolve = require('@rollup/plugin-node-resolve'); +const commonjs = require('@rollup/plugin-commonjs'); + +module.exports = [ + // ESM build + { + input: 'src/index.ts', + output: { + file: 'dist/index.mjs', + format: 'esm', + sourcemap: true, + }, + external: (id) => { + // Don't externalize relative imports (starts with . or /) + if (id.startsWith('.') || id.startsWith('/')) return false; + // Don't externalize absolute paths (local files) + if (id.includes('/') && !id.startsWith('@')) return false; + // Externalize all npm packages (including scoped ones) + return true; + }, + plugins: [ + resolve({ + extensions: ['.js', '.jsx', '.ts', '.tsx'] + }), + commonjs(), + typescript({ + tsconfig: 'tsconfig.json', + declaration: false, + outDir: 'dist', + }), + ], + }, + // CommonJS build + { + input: 'src/index.ts', + output: { + file: 'dist/index.js', + format: 'cjs', + sourcemap: true, + }, + external: (id) => { + // Don't externalize relative imports (starts with . or /) + if (id.startsWith('.') || id.startsWith('/')) return false; + // Don't externalize absolute paths (local files) + if (id.includes('/') && !id.startsWith('@')) return false; + // Externalize all npm packages (including scoped ones) + return true; + }, + plugins: [ + resolve({ + extensions: ['.js', '.jsx', '.ts', '.tsx'] + }), + commonjs(), + typescript({ + tsconfig: 'tsconfig.json', + declaration: false, + outDir: 'dist', + }), + ], + }, +]; \ No newline at end of file diff --git a/packages/react/react-icons/tsconfig.build.json b/packages/react/react-icons/tsconfig.build.json new file mode 100644 index 00000000..4f424202 --- /dev/null +++ b/packages/react/react-icons/tsconfig.build.json @@ -0,0 +1,11 @@ +{ + "extends": "./tsconfig.json", + "compilerOptions": { + "declaration": true, + "declarationDir": "dist", + "emitDeclarationOnly": true, + "outDir": "dist", + "skipLibCheck": true + }, + "exclude": ["dist", "node_modules"] +} \ No newline at end of file diff --git a/packages/react/react-icons/tsup.config.ts b/packages/react/react-icons/tsup.config.ts deleted file mode 100644 index a4bebd83..00000000 --- a/packages/react/react-icons/tsup.config.ts +++ /dev/null @@ -1,21 +0,0 @@ -import { defineConfig } from 'tsup'; - -export default defineConfig({ - entry: ['src/index.ts'], - format: ['cjs', 'esm'], - clean: true, - sourcemap: true, - outDir: 'dist', - external: [ - // Keep all dependencies external for library builds - /^@vjs-10\//, - /^[^.]/, - ], - // Generate TypeScript declarations with custom config - dts: { - compilerOptions: { - composite: false, - incremental: false, - }, - }, -});