Closed klined closed 6 years ago
Although this probably is not the most elegant solution, I inserted these lines into the css section of the minify function in MinifyClass to change to the directory of the css file being minified:
... else: cwd = os.getcwd(); inpdir = re.sub(r'(\\[^\\]+)$', r'', inpfile, 1) os.chdir(inpdir+'\\') cmd = self.fixStr(self.get_setting('cleancss_command') or 'cleancss').split() ...
I also put this at the top of the minify function: def minify(self): inpfile = self.view.file_name() cwd = False ...
I also put this at the bottom of the minify function to switch back to the original directory: ... if cmd: print('Minify: Minifying file:' + str(inpfile)) self.run_cmd(cmd, outfile) if cwd: os.chdir(cwd)
This prevented the absolute path from being added to the entries in the sources object. I'm still hoping that there's some option that I missed.
Hello. I love this plugin. You've done awesome work!
I am having a small problem though. When I minify my CSS files, my source map's sources object looks like this: {"version":3,"sources":["L:\\path\\to\\file\\file.css"],"names":[],"mappings":"..."}
I need the sources object to not contain the path. Am I missing an option to prevent this from happening somewhere?