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

[backend-integration] Include CSS and other assets in manifest #6595

Closed
4 tasks done
lubomirblazekcz opened this issue Jan 22, 2022 · 0 comments · Fixed by #6649
Closed
4 tasks done

[backend-integration] Include CSS and other assets in manifest #6595

lubomirblazekcz opened this issue Jan 22, 2022 · 0 comments · Fixed by #6649

Comments

@lubomirblazekcz
Copy link
Contributor

lubomirblazekcz commented Jan 22, 2022

Clear and concise description of the problem

Currently the only possible option to input files for build is .js files in blob.

rollupOptions: {
    input: FastGlob.sync(['./src/**/*.js']).map(entry => resolve(process.cwd(), entry))
}

If I add .css files into the blob, it doesn't have a expected entry in manifest.json. Which doesn't seem to be something that should be hard to fix, css files are processed correctly, only manifest entry is missing.

This is also the main reason why to use other alternatives and use Vite only as dev server and build assets with different tools, such us esbuild and gulp-esbuild etc.

Suggested solution

css files should be included in manifest.json as entry, if added in rollupOptions.input, it's also an issue here - #6477

This should be then included in the manifest

  "src/styles/main.css": {
    "file": "assets/main.9bc805c4.css",
    "src": "src/styles/main.css"
  },
  "src/assets/logo.png": {
    "file": "assets/logo.b2fe66e5.png",
    "src": "src/assets/logo.png"
  },

Alternative

The current only way to get .css file into manifest and load it as stylesheet (sources and also procecced files) is to use this dirty hack

if (typeof window[9999] !== 'undefined') {
  (async() => await import('/src/styles/main.css'))()
}

Additional context

No response

Validations

@lubomirblazekcz lubomirblazekcz changed the title Improve Backend Integration Include CSS and other assets in manifest May 28, 2022
@lubomirblazekcz lubomirblazekcz changed the title Include CSS and other assets in manifest [backend-integration] Include CSS and other assets in manifest May 28, 2022
@github-actions github-actions bot locked and limited conversation to collaborators Jul 4, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant