Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Building on Windows #2

Open
pidgeon777 opened this issue Dec 17, 2024 · 1 comment
Open

Building on Windows #2

pidgeon777 opened this issue Dec 17, 2024 · 1 comment

Comments

@pidgeon777
Copy link

First of all, interesting project, thanks for sharing it.

Secondly, I was wondering how to build it on Windows.

In the README it is requested:

./build.sh

Maybe a Windows script should also be added?

I wrote this, but it should be tested:

# Stop on first error
$ErrorActionPreference = "Stop"

Write-Host "🧹 Cleaning dist directory..."
if (Test-Path dist) {
    Remove-Item -Path dist -Recurse -Force
}
New-Item -ItemType Directory -Path dist

Write-Host "📦 Compiling each TypeScript file to JavaScript..."
npx tsc

Write-Host "📝 Copying CSS files..."
# Copy CSS files preserving directory structure
Get-ChildItem -Path src -Filter *.css -Recurse | ForEach-Object {
    $targetPath = $_.FullName.Replace($PSScriptRoot + "\src\", $PSScriptRoot + "\dist\")
    $targetDir = Split-Path -Path $targetPath -Parent
    if (!(Test-Path $targetDir)) {
        New-Item -ItemType Directory -Path $targetDir -Force
    }
    Copy-Item $_.FullName -Destination $targetPath
}

Write-Host "📝 Copying JS files..."
# Copy JS files preserving directory structure
Get-ChildItem -Path src -Filter *.js -Recurse | ForEach-Object {
    $targetPath = $_.FullName.Replace($PSScriptRoot + "\src\", $PSScriptRoot + "\dist\")
    $targetDir = Split-Path -Path $targetPath -Parent
    if (!(Test-Path $targetDir)) {
        New-Item -ItemType Directory -Path $targetDir -Force
    }
    Copy-Item $_.FullName -Destination $targetPath
}

Write-Host "✅ Build complete! Individual .js and .css files are in the dist directory with original structure."
@jeswin
Copy link
Member

jeswin commented Dec 17, 2024

I dont have access to windows. Will you be able to make a PR?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants