Skip to content

Commit 9c6819e

Browse files
committed
support for npm specifiers
1 parent e83765a commit 9c6819e

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@ and this project try to adheres to [Semantic Versioning](https://semver.org/).
66
Go to the `v2` branch to see the changelog of Lume 2.
77
Go to the `v1` branch to see the changelog of Lume 1.
88

9+
## [3.0.11] - Unreleased
10+
### Fixed
11+
- `tailwind` plugin: Support to import styles from npm. (i.e. `npm:npm:tw-animate-css`)
12+
913
## [3.0.10] - 2025-09-24
1014
### Added
1115
- New env variable `LUME_PROXIED` to use a location with a different hostname and port to the server's hostname and port.
@@ -248,6 +252,7 @@ Go to the `v1` branch to see the changelog of Lume 1.
248252
[#779]: https://github.com/lumeland/lume/issues/779
249253
[#782]: https://github.com/lumeland/lume/issues/782
250254

255+
[3.0.11]: https://github.com/lumeland/lume/compare/v3.0.10...HEAD
251256
[3.0.10]: https://github.com/lumeland/lume/compare/v3.0.9...v3.0.10
252257
[3.0.9]: https://github.com/lumeland/lume/compare/v3.0.8...v3.0.9
253258
[3.0.8]: https://github.com/lumeland/lume/compare/v3.0.7...v3.0.8

plugins/tailwindcss.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,13 @@ export function tailwindCSS(userOptions?: Options) {
115115
}
116116
}
117117

118+
// Support npm: prefix to load from npm CDN (ex: npm:tw-animate-css)
119+
if (id.startsWith("npm:")) {
120+
id = id.replace("npm:", "https://cdn.jsdelivr.net/npm/");
121+
const content = await readFile(id);
122+
return { content, path: id, base };
123+
}
124+
118125
const path = resolveInclude(id, options.includes || "", base);
119126
const content = await site.getContent(path, false);
120127

0 commit comments

Comments
 (0)