Elderjs / elderjs

Elder.js is an opinionated static site generator and web framework for Svelte built with SEO in mind.
https://elderguide.com/tech/elderjs/
MIT License
2.11k stars 52 forks source link

Warnings on fresh install #253

Open altano opened 2 years ago

altano commented 2 years ago

I'm trying out Elder.js and on the default setup of a project there is a lot of noise, including build warnings (errors?) at build:

> npm run build

> elderjs-template@1.3.4 build
> node ./src/cleanPublic.js && npm run build:rollup && npm run build:html

 Clearing out public folder.

> elderjs-template@1.3.4 build:rollup
> rollup -c

CSS file not found in /home/alan/src/elderjs-testing/public/_elderjs/assets
Elder.js using rollup in production mode.

src/layouts/*.svelte, src/routes/**/*.svelte, src/components/**/*.svelte → ___ELDER___/compiled...
Browserslist: caniuse-lite is outdated. Please run:
npx browserslist@latest --update-db

Why you should do it regularly:
https://github.com/browserslist/browserslist#browsers-data-updating
(!) Plugin replace: @rollup/plugin-replace: 'preventAssignment' currently defaults to false. It is recommended to set this option to `true`, as the next major version will default this option to `true`.
(!) Plugin rollup-plugin-elder: Layout has unused export property 'settings'. If it is for external reference only, please consider using `export const settings`
src/layouts/Layout.svelte
1: <script>
2:   import style from '../../assets/style.css';
3:   export let templateHtml, settings;
                              ^
4: </script>
5: 
(!) Import of non-existent export
src/layouts/Layout.svelte
1: <script>
2:   import style from '../../assets/style.css';
            ^
3:   export let templateHtml, settings;
4: </script>
created ___ELDER___/compiled in 1.1s

src/components/**/*.svelte → public/_elderjs/svelte...
created public/_elderjs/svelte in 1.8s

> elderjs-template@1.3.4 build:html
> node ./src/build.js

[░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░] 0% | ETA: 0s | 0/19 | Errors: 0 | P/sec: 0 
Build Completed Successfully: Built 19 pages in 1.36 seconds
No SEO issues detected.

I installed using npx degit Elderjs/template elderjs-testing/ and I'm using: node v18.10.0 npm 8.19.2

eight04 commented 1 year ago
import style from '../../assets/style.css';

This thing is really frustrating and should be fixed in the template:

  1. Why do we have to import a default member from CSS file? What does it even mean?
  2. It is already frustrating enough to import a file outside of src.
  3. There is already a hook copying files from the assets folder into the dist folder. Why do we have to import it?

I suggest:

  1. Rename the style to src/layouts/global.css.
  2. Change the import statement to import './global.css';.
  3. Put some pictures in assets/ and display them on the homepage to demonstrate copyAssetsToPublic hook.