Skip to content

Commit 71cc3e9

Browse files
committed
Adding the basec npm script when the user chooses to add support for base component
1 parent 01ff21c commit 71cc3e9

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

generator/index.js

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,15 @@ module.exports = (api, options) => {
1212
global.createdFiles = [];
1313
api.render("./template");
1414

15-
if (options.scaffold) optionals.addBaseComponents(api);
1615
if (options.prettier) optionals.addPrettierConfig(api);
16+
if (options.scaffold) {
17+
optionals.addBaseComponents(api);
18+
api.extendPackage({
19+
scripts: {
20+
basec: 'vue-cli-service basec'
21+
}
22+
});
23+
}
1724

1825
function emptyDirs(directories, exception) {
1926
for (let i = 0; i < directories.length; i++) {
@@ -31,12 +38,7 @@ module.exports = (api, options) => {
3138
}
3239

3340
function showLogs() {
34-
const colors = {
35-
GREEN: "\x1b[32m%s\x1b[0m",
36-
RED: "\x1b[31m%s\x1b[0m",
37-
YELLOW: "\x1b[33m%s\x1b[0m",
38-
};
39-
41+
const colors = require("./../utils/colors");
4042
log("\n");
4143
for (const file of deletedFiles) log(colors.RED, "Deleted file: ", file);
4244
for (const file of modifiedFiles) log(colors.YELLOW, "Modified file: ", file);

0 commit comments

Comments
 (0)