Avatar

Correct answer by
Employee

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. 

 

View solution in original post