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

Commit 7578b9a

Browse files
author
黄俊亮
committed
refactor(schematics): rename downgradeLess
`less` should be added to devDependencies instead of dependencies in most cases.
1 parent 6b68d4a commit 7578b9a

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

schematics/ng-add/index.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ const ADD_CONFIG = {
3434
export default function (options: Schema): Rule {
3535
return chain([
3636
options && options.skipPackageJson ? noop() : addZorroToPackageJson(),
37-
options && options.theme ? downgradeLess() : noop(),
37+
options && options.theme ? installLess() : noop(),
3838
setBootstrapPage(),
3939
addThemeToAppStyles(options),
4040
addModulesToAppModule(options),
@@ -152,10 +152,10 @@ function registerLocaleData(moduleSource: ts.SourceFile, modulePath: string, loc
152152
: new ReplaceChange(modulePath, registerLocaleDataFun[ 0 ].getStart(), registerLocaleDataFun[ 0 ].getText(), `registerLocaleData(${locale});`);
153153
}
154154

155-
/** 降级 less */
156-
function downgradeLess(): (host: Tree) => Tree {
155+
/** install less */
156+
function installLess(): (host: Tree) => Tree {
157157
return (host: Tree) => {
158-
addPackageToPackageJson(host, 'dependencies', 'less', ADD_CONFIG.LESS_VERSION);
158+
addPackageToPackageJson(host, 'devDependencies', 'less', ADD_CONFIG.LESS_VERSION);
159159
return host;
160160
};
161161
}

0 commit comments

Comments
 (0)