Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
BedrockMission!

Learn More

View all

Sign in to view all badges

Static Files in Firefly Project

Avatar

Avatar
Validate 1
Level 1
wiki
Level 1

Likes

0 likes

Total Posts

7 posts

Correct Reply

1 solution
Top badges earned
Validate 1
Affirm 1
View profile

Avatar
Validate 1
Level 1
wiki
Level 1

Likes

0 likes

Total Posts

7 posts

Correct Reply

1 solution
Top badges earned
Validate 1
Affirm 1
View profile
wiki
Level 1

05-05-2021

Hi - I have customers-dashboard sample Firefly project. I want to add some custom HTML and PNG files in the project. I have added in "web-src/src" folder but I cannot access the file.
I tried to use different paths like xxx.adobeio-static.net/src/ws.html etc.
Is it even possible to have these extra static HTML etc. files in the project and how I can get to those (HTML) files?

Thank you!

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar
Boost 1
Employee
StephanAdobe
Employee

Like

1 like

Total Posts

4 posts

Correct Reply

2 solutions
Top badges earned
Boost 1
Affirm 1
View profile

Avatar
Boost 1
Employee
StephanAdobe
Employee

Like

1 like

Total Posts

4 posts

Correct Reply

2 solutions
Top badges earned
Boost 1
Affirm 1
View profile
StephanAdobe
Employee

05-05-2021

Images are imported automatically when referenced from the web-src/index.html file. You can also import them manually using JS e.g. from the web-src/index.js file: 

 

import myImage from '../image.png';

console.log(myImage); // returns image src path

 

Same for html files: 

 

import myHTML from '../file.html';

console.log(myHTML); // returns file.html content

 

If you want to simply copy static files to the dist folder, you can install the plugin https://www.npmjs.com/package/parcel-plugin-static-files-copy, then create a static folder at the root of your project and put all static files in there. They will be automatically copied to the dist folder. 

 

Answers (0)