Skip to content
This repository has been archived by the owner on Jul 19, 2021. It is now read-only.

Clarify how the src/assets folder works and how it's used in a theme #410

Closed
t-kelly opened this issue Feb 22, 2018 · 6 comments
Closed

Comments

@t-kelly
Copy link
Contributor

t-kelly commented Feb 22, 2018

Problem

As described in my response in issue #407, there is a lot of logic behind what's going on the src/assets folder. Let's get some better documentation about how things are currently setup, that way people can form educated opinions about it and propose improvements!

Related: #408

@weotch
Copy link

weotch commented Feb 22, 2018

What about adding the asset directories to Webpack resolve modules? https://webpack.js.org/configuration/resolve/#resolve-modules

@jonathanmoore
Copy link
Contributor

Right now working with static JS files does feel a bit clumsy. The other thing to note about the scenario above is that it seems like you would have to name the file modernizr.js.liquid so that it uploaded with slate-tools. Otherwise yarn start will assume that the file is being served locally from /dist.

Personally I would like to have a way to work with dependancies that are completely separate from bundled files. An example of this would be using a package like lazysizes. LazySizes needs to load as soon as possible with async, so including it in theme.js would not make sense with the files being deferred (#437).

Would it be realistic to have a build process that could do the following?

  • Load a file like lazysizes.js from vendor/static
  • lazysizes.js includes the various required plugins
  • Inject a script tag with lazysizes.js as async

@numediaweb
Copy link

any updates on this: same issue with vendor js assets

@sebbean
Copy link

sebbean commented Sep 14, 2018

been battling this all month

@t-kelly
Copy link
Contributor Author

t-kelly commented Oct 25, 2018

@t-kelly t-kelly closed this as completed Oct 25, 2018
@lock
Copy link

lock bot commented Nov 24, 2018

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked as resolved and limited conversation to collaborators Nov 24, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

5 participants