def METHOD_NAME(source, target, env):
    #add filetypes (extensions only) to be gzipped before uploading. Everything else will be copied directly
    filetypes_to_gzip = ['js', 'html', 'css']
    #filetypes_to_gzip = []
    project_dir = env.get('PROJECT_DIR')
    platform = env.get('PIOPLATFORM', '')
    if platform == 'espressif8266':
        data_src_dir = os.path.join(project_dir,
            "utils", "ESP8266SerialToWebsocket", "html")
    else:
        data_src_dir = os.path.join(project_dir,
            "src", "esp32", "html")
    print(' ***** Packing html files *****')
    data_dir = env.get('PROJECTDATA_DIR')
    if not os.path.exists(data_src_dir):
        print('    HTML source "%s" does not found.' % data_src_dir)
        return
    if os.path.exists(data_dir):
        print('    RM data dir: ' + data_dir)
        shutil.rmtree(data_dir)
    print('    MK data dir: ' + data_dir)
    os.mkdir(data_dir)
    files_to_gzip = []
    for extension in filetypes_to_gzip:
        files_to_gzip.extend(glob.glob(os.path.join(data_src_dir, '*.' + extension)))
    #print('    => files to gzip: ' + str(files_to_gzip))
    all_files = glob.glob(os.path.join(data_src_dir, '*.*'))
    files_to_copy = list(set(all_files) - set(files_to_gzip))
    for f_name in files_to_copy:
        print('    Copy: ' + os.path.basename(f_name))
        shutil.copy(f_name, data_dir)
    for f_name in files_to_gzip:
        print('    GZip: ' + os.path.basename(f_name))
        with open(f_name, 'rb') as f_in:
            out_file = os.path.join(data_dir, os.path.basename(f_name) + '.gz')
            with gzip.open(out_file, 'wb') as f_out:
                shutil.copyfileobj(f_in, f_out)
    print('   packing done!')