Skip to content
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

Warnings on fresh install #253

Open
altano opened this issue Sep 30, 2022 · 1 comment
Open

Warnings on fresh install #253

altano opened this issue Sep 30, 2022 · 1 comment
Labels
documentation Improvements or additions to documentation

Comments

@altano
Copy link

altano commented Sep 30, 2022

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
Copy link
Contributor

eight04 commented Nov 4, 2022

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.

@eight04 eight04 added the documentation Improvements or additions to documentation label Nov 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

2 participants