France is working with Germany and other partners to plug loopholes that have allowed U.S. tech giants like Alphabet Inc.’s Google, Apple Inc., Facebook Inc. and Amazon.com Inc. to minimize taxes and grab market share in Europe at the expense of the continent’s own companies.