You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If template's node_modules is present, these are copied to webcontainer. This can easily lead into copying 10s of megabytes of content. Also platform specific modules will not work as they are not using wasm builds of native modules.
Though it's completely valid use case to add pre-optimized node_modules into templates to make tutorials load faster.
To get the best user experience here, we should ignore templates/*/node_modules by default. Including templates/*/node_modules should be possible by opt-in option. Maybe after #165 we could have:
template:
name: my-templateignoredFiles: [] # Defaults to '**/node_modules**/', [] makes node_modules included
This way we would still end up creating those 50MB <name>-template.json files, as exclusion would happen after the files have been loaded to the browser
Add ignoredFiles to .tk-config file, that is already used to configure src/templates
This would work well, but now it's not possible to set this in tutorial/part/chapter/lesson metadata
Implementing this into codebase is also a bit difficult now, but possible
More users are now running into this so we should publish a release with quick fix as soon as possible. I think I'll make node_modules exclusion non-configurable now, and create a separate feature issue for configuring ignoredFile in metadata or .tk-config.json.
Activity
[-]`template/*/node_modules` should be ignored[/-][+]`templates/*/node_modules` should be ignored[/+]AriPerkkio commentedon Jul 30, 2024
Though it's completely valid use case to add pre-optimized
node_modulesinto templates to make tutorials load faster.To get the best user experience here, we should ignore
templates/*/node_modulesby default. Includingtemplates/*/node_modulesshould be possible by opt-in option. Maybe after #165 we could have:AriPerkkio commentedon Aug 1, 2024
So far I've tried two approaches:
template.ignoredFilesinto metadata<name>-template.jsonfiles, as exclusion would happen after the files have been loaded to the browserignoredFilesto.tk-configfile, that is already used to configuresrc/templatesMore users are now running into this so we should publish a release with quick fix as soon as possible. I think I'll make
node_modulesexclusion non-configurable now, and create a separate feature issue for configuringignoredFilein metadata or.tk-config.json.noam-honig commentedon Aug 1, 2024
thanks