terpiljenya / import-glob

ES6 import with glob patterns (preloader for Webpack)
57 stars 28 forks source link

Add `excludeExt` option #13

Open ethanresnick opened 6 years ago

ethanresnick commented 6 years ago

This PR adds an option to have each generated import statement exclude the file extension of the matched file. I.e., instead of generating import x from "./test.js" it generates import x from "./test".

I needed this because I was using import-glob with Typescript, and the Typescript compiler complains if import statements contain file extensions. Maybe others will find it useful too.