-
-
Notifications
You must be signed in to change notification settings - Fork 103
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
Client side Javascript broken (or works differently) in lume 2.0.x #547
Comments
In a Lume 1.x site I have :
A bundle gets created and deposited in _/site. In lume 2.0.x, I can't get it to work. |
Hmm, this |
@oscarotero I created this repo: /~https://github.com/max-l/lume_2_with_client_js I managed to get the bundle to build, but then it seems that the esbuild takes over everything, including the static pre generation. |
Okay, looks like you're trying to do two different things with the same extension
site.use(jsx({
pageSubExtension: ".page",
}))
site.use(esbuild({
extensions: [".jsx"],
options: {
jsxDev: ! isProduction,
minify: isProduction
}
})) Now you can rename your |
Ok, that works, thanks ! I pushed your suggested fixes to the repo : /~https://github.com/max-l/lume_2_with_client_js I'm now getting a problem with imports on the client side:
/~https://github.com/max-l/lume_2_with_client_js/blob/main/main.jsx#L1 I tried importing with :
without success |
I've disabled the import lume from "lume/mod.ts";
import jsx from "lume/plugins/jsx.ts";
import esbuild from "lume/plugins/esbuild.ts";
import sourceMaps from "lume/plugins/source_maps.ts";
const site = lume()
const isProduction = false
// site.use(jsx({
// pageSubExtension: ".page",
// }))
site.use(esbuild({
extensions: [".jsx"],
options: {
jsxDev: ! isProduction,
minify: isProduction
}
}))
.use(sourceMaps({}))
export default site; Looks like there is some kind of conflict between |
Okay, I found the bug and it's fixed now. |
It works, I've uploaded the changes here: /~https://github.com/max-l/lume_2_with_client_js Thanks |
Fix released in Lume 2.0.3. |
Version
2.0.2
Platform
ubuntu
What steps will reproduce the bug?
Port a 1.x site that has client side javascript
How often does it reproduce? Is there a required condition?
always
What is the expected behavior?
I would expect a compiled javascript bundle to be created (ex main.js), in _site/
What do you see instead?
no bundle gets created
Additional information
No response
The text was updated successfully, but these errors were encountered: