-
Notifications
You must be signed in to change notification settings - Fork 91
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
minifiedFile should in then same path with mergedFile #73
Comments
You can use the option |
That's not right. Let me explain more. Assume I set jsTargetDir to "js". I config jsFinalFile to "folder/app.js", Then the app.js full path is"js/folder/app.js". But app.min.js full path is "js/app.min.js". I think it's should be "js/folder/app.min.js" |
See the following code: if (skipMerge) {
log.info("Skipping the merge step...");
String sourceBasePath = sourceDir.getAbsolutePath();
for (File mergedFile : files) {
// Create folders to preserve sub-directory structure when only minifying
String originalPath = mergedFile.getAbsolutePath();
String subPath = originalPath.substring(sourceBasePath.length(),
originalPath.lastIndexOf(File.separator));
File targetPath = new File(targetDir.getAbsolutePath() + subPath);
targetPath.mkdirs();
File minifiedFile = new File(targetPath, (nosuffix) ? mergedFile.getName()
: FileUtils.basename(mergedFile.getName()) + suffix
+ FileUtils.getExtension(mergedFile.getName()));
minify(mergedFile, minifiedFile);
}
} else if (skipMinify) {
File mergedFile = new File(targetDir, mergedFilename);
merge(mergedFile);
log.info("Skipping the minify step...");
} else {
File mergedFile = new File(targetDir, (nosuffix) ? mergedFilename + TEMP_SUFFIX : mergedFilename);
merge(mergedFile);
File minifiedFile = new File(targetDir, (nosuffix) ? mergedFilename
: FileUtils.basename(mergedFilename) + suffix + FileUtils.getExtension(mergedFilename));
minify(mergedFile, minifiedFile);
if (nosuffix) {
if (!mergedFile.delete()) {
mergedFile.deleteOnExit();
}
}
} When skipMerge, you consider the subPath, but when skipMerge is false, you just put the minifiedFile in the targetDir, no consider about the subPath. It's should be a bug. |
Yes, the minified file should be in the same folder as the merged file. |
Fixed by the commit c9ca500. |
I config jsFinalFile with "folder/app.js". I expect minifiedFile is "folder/app.min.js", but it's "app.min.js" in root dir.
The text was updated successfully, but these errors were encountered: