emit file using relative path to context
do not use relative if using an absolute public path