mirror of
https://github.com/zoriya/v10.git
synced 2026-08-16 02:45:09 +00:00
- Create centralized SVG files in core icons package assets directory - Add rollup-plugin-string to core icons for SVG file processing - Export SVG_ICONS object from core package for cross-package sharing - Refactor html-icons to import SVG strings from @vjs-10/icons - Remove hardcoded SVG strings in favor of shared definitions - Add TypeScript declarations for SVG imports This establishes a foundation for sharing more code across the monorepo while maintaining proper package boundaries and build system integration. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
69 lines
1.8 KiB
JavaScript
69 lines
1.8 KiB
JavaScript
const typescript = require('@rollup/plugin-typescript');
|
|
const resolve = require('@rollup/plugin-node-resolve');
|
|
const commonjs = require('@rollup/plugin-commonjs');
|
|
const { string } = require('rollup-plugin-string');
|
|
|
|
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: [
|
|
string({
|
|
include: '**/*.svg'
|
|
}),
|
|
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: [
|
|
string({
|
|
include: '**/*.svg'
|
|
}),
|
|
resolve({
|
|
extensions: ['.js', '.jsx', '.ts', '.tsx']
|
|
}),
|
|
commonjs(),
|
|
typescript({
|
|
tsconfig: 'tsconfig.json',
|
|
declaration: false,
|
|
outDir: 'dist',
|
|
}),
|
|
],
|
|
},
|
|
]; |