DekodeInteraktiv / project-base

Dekode Project Base
https://packagist.org/packages/dekode/project-base
MIT License
7 stars 1 forks source link

Turbo build builds every file on each save #542

Open dekode-kevin opened 3 days ago

dekode-kevin commented 3 days ago

When saving while running npm run start, instead of just building wherever you are, turbo is building everything. This is okay in itself but on bigger projects with more assets, the build starts getting very slow.

Example project: Wiersholm

stian-overasen commented 3 days ago

Is this related to the image problem you had before @dekode-kevin? Turbo only refreshes the package that is changed, also on npm start. I just tested and verified this. Maybe your config is setup differently?;

{
    "$schema": "https://turbo.build/schema.json",
    "tasks": {
        "build": {
            "dependsOn": ["^build"]
        },
        "start": {
            "cache": false,
            "persistent": true
        },
        "clean": {
            "cache": false
        }
    }
}
stian-overasen commented 3 days ago

By "everything", do you mean all packages, or is this related to a single package? Is the watch process faster if you navigate into the package and run npm start locally?

dekode-kevin commented 3 days ago

Sorry, will try to be more specific.

Point is, it doesn't rebuild all packages, but it rebuilds all the files in the package. It is related to the heavy svg on wiersholm. Build folder looks like this:

image

Changing for example something in view.css or in a block css, will trigger a rebuild of the entire build folder, which makes the build slow.

This is because of one heavy svg, but I do think there must be a way of optimizing this somehow, so when we get other projects that might be bigger in size it shouldn't slow down the development process.

stian-overasen commented 3 days ago

In that case your beef is with postcss-url, not Turbo.