Skip to content

Best way to include template theme in Webpack Encore ? #953

@Cartman34

Description

@Cartman34

Hello,

I bought several template themes and both are coming with their dependencies & images...
Some of theme even include a package.json file.

So now, what is the best way to include them in my project ?

Here are my known choices

  1. Include their CSS/JS directly in my twig template. But what about dependencies ? Should I use a separate webpack entry to insert before the theme ressources ?
  2. Put it in my known sources in a sub folder named vendor, install manually dependencies with yarn add pacakage and import the dependencies & theme.
  3. Put it outside assets folder and yarn add the theme folder yarn add file:local/packages/theme/

In all case, template only handle a color variable, I have to override css properties in my own sources.
For cases 2 & 3, I am getting issues with images in CSS URL() & first yarn watch is very long. Should I use a separate webpack entry for theme ?
For case 1, handling dependencies is really hard.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions