Skip to content

Conversation

@batchu5
Copy link

@batchu5 batchu5 commented Nov 27, 2025

Description
In generator if we give the params as -p single=false eventually, it is converting into single = 'false' , that is changed into singleFile='false', so changing the default value from false to 'false' in package.json results in string and css and js files are generated

Fixes #744

@sonarqubecloud
Copy link

@lightning-sagar
Copy link
Contributor

lightning-sagar commented Nov 27, 2025

Hey, you did an great job, but what i think is -> changing the default to a string ("false") isn’t the right fix.
The default should stay as a real boolean:

"default": false

The issue is in the generator not handling false defaults, not the template.
For the template, you can support both with:

 "const": false 

Check these lines and update to "const": "false" -> "const": false

Just sharing so the PR stays correct.
feedback or suggestions from maintainers are welcome!!!🙌

@batchu5
Copy link
Author

batchu5 commented Nov 27, 2025

okay, can you explain me where the generator is not handling the default false,
I tried to debug and found the error, same as where you raised the PR (in loader.js), you mentioned it is only handling singleFile="false".

and also i think params should be false not "false". there is no need to handle for both cases but let's see what maintainers say

@lightning-sagar
Copy link
Contributor

Yeah, that makes sense, ideally singleFile should always be a boolean...
But if you look at the template code, they already handle both cases for true:

const singleFile = (params?.singleFile === true || params?.singleFile == 'true');

So boolean true and string "true" are both supported....
to stay consistent, we should treat false the same way (boolean false and string "false"), at least until maintainers confirm the intended behavior

let’s wait and see what the maintainers say, they might want to standardize this one way or the other

@derberg
Copy link
Member

derberg commented Dec 2, 2025

folks did you see my comment in issue you linked?

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

Successfully merging this pull request may close these issues.

[BUG] Missing CSS/JS when generating without singleFile

4 participants