Skip to content
This repository was archived by the owner on May 26, 2023. It is now read-only.

Commit 1fc5af5

Browse files
Portugal, Marcelomportuga
authored andcommitted
fix(baseCSSPath): baseCSSPath support for local CSS files.
Add missing support for local CSS files as well as remote.
1 parent 7466fa2 commit 1fc5af5

File tree

2 files changed

+12
-8
lines changed

2 files changed

+12
-8
lines changed
File renamed without changes.

tasks/uidocs-generator.js

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -110,23 +110,27 @@ module.exports = (grunt) => {
110110
options.image = gruntStylesFolder + '/' + options.image;
111111
}
112112

113+
function loadCSSFile(file) {
114+
if (linked.test(file)) {
115+
return file;
116+
}
117+
const filename = file.split('/').pop();
118+
grunt.file.copy(file, path.join(options.dest, 'css', filename));
119+
return `css/${filename}`;
120+
}
121+
113122
if (options.baseCSSPath === 'bootstrap') {
114123
grunt.file.copy(
115124
`${options.thirdpartyPath}/bootstrap/dist/css/bootstrap.min.css`,
116125
path.join(options.dest, 'css', 'bootstrap.min.css')
117126
);
118127

119128
options.baseCSSPath = 'css/bootstrap.min.css';
129+
} else {
130+
options.baseCSSPath = loadCSSFile(options.baseCSSPath);
120131
}
121132

122-
options.styles = options.styles.map(function(file) {
123-
if (linked.test(file)) {
124-
return file;
125-
}
126-
var filename = file.split('/').pop();
127-
grunt.file.copy(file, path.join(options.dest, 'css', filename));
128-
return 'css/' + filename;
129-
});
133+
options.styles = options.styles.map(loadCSSFile);
130134

131135
setup = prepareSetup(section, options);
132136

0 commit comments

Comments
 (0)