Comments (4)
site.process([".js"], (pages) => {
for (const page of pages) {
if (!page.content) return
console.log(page.content)
page.content = (page.content as string).replace(
re,
(line) => line.replace(/"(\..*)\.tsx?/, '"$1.js'),
)
}
})
This hack works as a band-aid but is very prone to error as it does not use AST.
from lume.
Thanks for highlighting this.
I'll try if https://esbuild.github.io/api/#out-extension can fix that.
from lume.
After different attemps, I wasn't able to configure esbuild to make this change automatically. Seems like this decision is made by design, and the only way to change the extension is configuring the bundle
option as true: evanw/esbuild#3371
from lume.
@scarf005 I've been making a lot of changes in the esbuild plugin, and, among other things, I tried to fix this issue.
It's not a perfect solution but I think covers most of cases (even npm:
and jsr:
imports are replaced by esm.sh
). You can take a look here:
Lines 342 to 356 in 9937f59
Could you test it to make sure it works fine?
Just ugrade Lume with deno task lume upgrade --dev
.
from lume.
Related Issues (20)
- Merged key in the layouts
- inline plugin types for JSX
- webp asset files corrupted on build HOT 3
- How to include/inline external CSS (npm | cdn)
- Improve performance of some plugins with an internal cache
- search not finding generated pages (doesn't seem to be a renderOrder issue?) HOT 2
- Option to allow case sensitive filenames
- lume -s, Fail to copy file to where the path once was a directory HOT 2
- Images are no longer copied to dest. HOT 7
- buildOrder: make page render after all plugins are run HOT 6
- Transform Images plugin: "VipsOperation: class "jxlsave_buffer" not found" HOT 5
- HMR doesn't detect new _data.yml when remote file is specified HOT 2
- Search misses pages that have a tag with spaces HOT 4
- IA blocker
- Feeds plugin: item.updated?.toISOString is not a function HOT 2
- Error: The pages (generated) and (generated) have the same output path "/favicon.ico". Use distinct 'url' values to resolve the conflict HOT 10
- [sitemap plugin] lastmod is ctime HOT 4
- Extra spaces after the opening dashes of the frontmatter trigger the TOC plugin to interpret them as h2 HOT 1
- Serve mode performance with many pages HOT 1
- JS file changes require server restart HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from lume.