Skip to content

Commit 0a1841a

Browse files
authored
Add path option for compiler to enable less imports. (#103)
1 parent f895563 commit 0a1841a

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

commands/themebuider.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ const commands = {
99
BUILD_META: 'export-theme-meta'
1010
};
1111

12+
const themeBuilderPackagePath = path.join(__dirname, '..', 'node_modules', 'devextreme-themebuilder');
13+
1214
const scssCompiler = {
1315
render: (scss) => {
1416
return new Promise((resolve, reject) => {
@@ -93,8 +95,7 @@ const getMeta = (fullMeta, base, filter, baseParametersList) => {
9395
};
9496

9597
const installThemeBuilder = version => {
96-
const rootDir = path.join(__dirname, '..');
97-
const packageJsonPath = path.join(rootDir, 'node_modules', 'devextreme-themebuilder', 'package.json');
98+
const packageJsonPath = path.join(themeBuilderPackagePath, 'package.json');
9899

99100
if(fs.existsSync(packageJsonPath) && require(packageJsonPath).version === version) {
100101
return;
@@ -105,7 +106,7 @@ const installThemeBuilder = version => {
105106
'--no-save',
106107
`devextreme-themebuilder@${version}`
107108
], {
108-
cwd: rootDir,
109+
cwd: path.join(__dirname, '..'),
109110
stdio: 'ignore'
110111
});
111112
};
@@ -128,6 +129,8 @@ const runThemeBuilder = async rawOptions => {
128129

129130
options.lessCompiler.options = options.lessCompiler.options || {};
130131
options.lessCompiler.options['math'] = 'always';
132+
options.lessCompiler.options['paths'] = [ path.join(themeBuilderPackagePath, 'data', 'less', 'bundles') ];
133+
131134
if(options.assetsBasePath) {
132135
options.lessCompiler.options['rootpath'] = options.assetsBasePath;
133136
}

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "devextreme-cli",
3-
"version": "1.1.6",
3+
"version": "1.1.7",
44
"description": "DevExtreme CLI",
55
"keywords": [
66
"devexpress",

0 commit comments

Comments
 (0)