Comments (3)
Thinking you have to add import statements. This might help https://github.com/tongueroo/jets-example-crud-html/blob/master/app/javascript/packs/application.js
from jets.
Hmm... am not sure what you mean. I tried adding more directories to the webpacker.yml file for it to compile but it didnt work.
The reference at http://rubyonjets.com/docs/assets-serving/ states that I should put images into the app/javascript/images folder, but this does not work.
If I put all images into app/javascript/packs, then it does get compiled, but then it converts all my images into .js extensions.....
These paths in webpacker.yml:
source_path: app/javascript
source_entry_path: packs
public_output_path: packs
cache_path: tmp/cache/webpacker
I tried the below and it still didn't work
source_entry_path: [packs, images]
source_entry_path: ['packs', 'images']
source_entry_path: %w[packs images]
I tried importing as you suggested but it looks odd and also didn't work.
import '../images/'
What am I doing wrong?
from jets.
Made some webpacker fixes in the latest release, so first upgrade. Then to import images you actually have to import them explicitly. So this that code won't work π
import '../images/'
Something like this will work:
import '../images/path/to/full/image.png'
Itβs not great to have to import a large number of image explicitly though. Googled around and it looks like what folks are doing with webpacker is using ERB to loop and import a bunch of files dynamically. Started taking a look at getting webpacker with ERB working but afraid donβt have the time right now. Would be awesome if someone takes a stab at this and would happily take this PR. IMHO, itβs a great way to learn if you want to have a stab at it also. No sweat either way though π
Closing this out.
from jets.
Related Issues (20)
- `jets deploy` fails on a newly created project which uses VPC HOT 1
- NoMethodError: undefined method `host' for nil:NilClass when sending mail locally HOT 2
- Add `--css tailwind` flag to jets cli HOT 5
- routes resources doesnt add param HOT 2
- Changing lambda.layers from serverless gems breaks BasePathMapping HOT 1
- Afterburner mode with Ruby 3.2.0 HOT 7
- PATCH in form being translated to POST in api gateway HOT 1
- Error Deploying 5.0.0 Without sprockets-jets Gem HOT 5
- Shared SQS Queue Deploy Failure Due to IAM Permission Issues HOT 11
- Jets 5.0.2 cannot deploy when project completely empty HOT 2
- Fresh install of jets 5.0.8 cannot load such file authorizer HOT 2
- Missing API Methods leads to 500 errors HOT 2
- Deploy of s3_event job fails on Custom::S3BucketConfiguration if not already deployed HOT 1
- Dotenv >=3 Breaks Jets Environment Variables HOT 8
- Need to update supported ruby version on docs.
- v5.0.11 --> ERROR: Template error: instance of Fn::GetAtt references undefined resource JetsInfoController HOT 1
- Generated test environment config prevents classes from being partially doubled in tests HOT 2
- undefined method `read' for nil:NilClass when calling any endpoint HOT 1
- Jets 6 Jobs not being created HOT 6
- Jets Deploy is not successful. HOT 7
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from jets.