Dan503 / gulp-auto-imports

Auto generate import-only files for any file type. SCSS, JS, TS, Pug, whatever you want.
MIT License
1 stars 0 forks source link

Add support for absolute paths #6

Open Dan503 opened 6 years ago

Dan503 commented 6 years ago

Some tasks require relative paths and some tasks require absolute paths.

Absolute paths aren't really necessary for the purpose I built the plugin for. It's feasible that someone might want to use this plugin for generating things like batch files which require absolute paths.

Dan503 commented 6 years ago

Ok this is going to be a little bit trickier than I thought. When I saw that path.resolve() turns a relative path into an absolute path, I thought "sweet, just put the relative path in and an absolute path comes out".

The absolute path would follow the relative path based on the Current Working Directory (CWD) though, not the destination folder.

To get the absolute path to point to the right folder I think I need to do this sort of thing path.resolve(opt.dest, file_relative_path)

Dan503 commented 6 years ago

I've ran into a bit of an issue where backslashes and absolute paths are not compatible with order retention.