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

Requesting support for Android Termux #903

Open
Yassinproweb opened this issue Jan 29, 2025 · 10 comments
Open

Requesting support for Android Termux #903

Yassinproweb opened this issue Jan 29, 2025 · 10 comments

Comments

@Yassinproweb
Copy link

We request you to add support for Android Termux, I am using tailwindcss v4.0 and it is not working due to lack of support for Android Termux by lightingcss.

@CodeWithSushil
Copy link

Please provide support for Android devices ARMv7(32-bit) ARMv8(64-bit) (arm64) new version for TailwindCSS (v4.0.4) throw some errors.

@Haiz14
Copy link

Haiz14 commented Feb 27, 2025

Bumping it up, tailwind v4 doesn't work without lightningcss. And nothing runs. :(

Temporary fix is to use proot distro

@devongovett
Copy link
Member

I'm confused. Are people really running lightningcss on their phones?? 😲

@Haiz14
Copy link

Haiz14 commented Mar 5, 2025

Running tailwind css with vite.

If you try out termux, you'll see it's an exactly replica of linux subsystem with limited user permissions. If it's linux, you certainly can code. And do lots of stuff.

Though i prefer to use tablets, just use termux to ssh into a powerful phone. Phones these days are pretty powerful.

@CodeWithSushil
Copy link

I'm confused. Are people really running lightningcss on their phones?? 😲

Yes, android phones and some android based laptops 💻

@hoshiiro
Copy link

hoshiiro commented Mar 7, 2025

Imo, lightningcss can support android by targeting aarch64-linux-android in rustup. Cmiiw, though.


You can definitely compile the node add-on yourself like below. You also need to install rust in termux first (pkg install rust).

$ git clone https://github.com/parcel-bundler/lightningcss.git
$ cd lightningcss
$ pnpm i

In scripts/build.js replace napi with pnpm napi (if you use PNPM or just install napi globally [pnpm i -g napi]).

diff --git a/scripts/build.js b/scripts/build.js
index 59807fa..cfba4d0 100644
--- a/scripts/build.js
+++ b/scripts/build.js
@@ -21,7 +21,7 @@ async function build() {
     args.push('--target', process.env.RUST_TARGET);
     }
-    let yarn = spawn('napi', args, {
+    let yarn = spawn('pnpm napi', args, {
       stdio: 'inherit',
       cwd: __dirname + '/../',
       shell: true,

Then finally, build the node addon;

$ RUSTFLAGS="-C linker=aarch64-linux-android-clang" node scripts/build.js --release && node scripts/build-flow.js

Now wait, it will take a long time (mine is 11 minutes, SD680). When done lightningcss.android-arm64.node should be in current directory.

Copy that file to lightningcss directory inside your node_modules, OUTSIDE node directory.

~/code/vite-project/node_modules/.pnpm/[email protected]/node_modules/lightningcss
❯ ls
LICENSE  lightningcss.android-arm64.node  node  package.json  README.md

@ozipoetra
Copy link

I'm opening PR for Android support, hope they can considering to merge it.

#932

@CodeWithSushil
Copy link

I'm opening PR for Android support, hope they can considering to merge it.

#932

both ARM7 ARM64 support?

@ozipoetra
Copy link

I'm opening PR for Android support, hope they can considering to merge it.
#932

both ARM7 ARM64 support?

Only ARM64

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

7 participants