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
I have a TypeScript file which just centralizes some type definitions.
Whenever I build my Lume site, I get an unhelpful warning telling me that the corresponding .js file is empty and will be skipped. But this should not be a warning; this is expected.
How often does it reproduce? Is there a required condition?
When running deno run build, I'd get something like
$ deno run build
Task build deno task lume
Task lume echo "import 'lume/cli.ts'" | deno run -A -
Loading config file file:///C:/Users/d/OneDrive%20-%20domenic.me/Code/WIP/lume-test/_config.ts
🔥 /test.js <- /test.ts
🔥 /index.html <- /index.html
🍾 Site built into ./_site
3 files generated in 0.03 seconds
What do you see instead?
I get
$ deno run build
Task build deno task lume
Task lume echo "import 'lume/cli.ts'" | deno run -A -
Loading config file file:///C:/Users/d/OneDrive%20-%20domenic.me/Code/WIP/lume-test/_config.ts
WARN [Lume] Skipped page /types.js (file content is empty)
🔥 /test.js <- /test.ts
🔥 /index.html <- /index.html
🍾 Site built into ./_site
3 files generated in 0.03 seconds
Additional information
It'd be ideal if this situation could be detected and handled without me having to manually annotate the files in _config.ts.
It's a little strange the message says "Skipped page" because a JavaScript file is not a page.
That's not a bug. Lume pages are not only html pages. Learn about html pages and asset pages. It's just the way to tell you that Lume won't save a file with no content.
I understand the issue but I don't know if it's easy to fix. It's like if you have a javascript file with all code commented (and removed by a minifier). The best way to do this is ignoring the file renaming it to _types.ts or in the _config.ts file adding the site.ignore("types.ts").
Maybe, due it's only a file with types declarations, you can rename it to types.d.ts. I'm not sure if Lume ignored the .d.ts files but definitely it should. I can make Lume to ignore this extension by default. What do you think?
I'd never used personally-written .d.ts files before, and the documentation doesn't make it seem like it would work. But I just tested renaming my file to use that extension, and it seems to work well! So I think this is a pretty good solution.
Version
2.4.3
Platform
Windows
What steps will reproduce the bug?
I have a TypeScript file which just centralizes some type definitions.
Whenever I build my Lume site, I get an unhelpful warning telling me that the corresponding
.js
file is empty and will be skipped. But this should not be a warning; this is expected.How often does it reproduce? Is there a required condition?
Full repro:
deno.json
_config.ts
src/types.ts
src/test.ts
src/index.html
What is the expected behavior?
When running
deno run build
, I'd get something likeWhat do you see instead?
I get
Additional information
It'd be ideal if this situation could be detected and handled without me having to manually annotate the files in
_config.ts
.It's a little strange the message says "Skipped page" because a JavaScript file is not a page.
/cc @bryophyta who seems to have originally implemented this warning in Warn user when empty files are skipped #221.
The text was updated successfully, but these errors were encountered: