Skip to content
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

Gulp watch Error with RTL #5762

Open
alijoudeh opened this issue Sep 10, 2017 · 2 comments
Open

Gulp watch Error with RTL #5762

alijoudeh opened this issue Sep 10, 2017 · 2 comments

Comments

@alijoudeh
Copy link

running gulp watch the following error throws with the RTL support build watch script

screen shot 2017-09-10 at 9 15 22 am

Comparing the code in the RTL watch script with standard watch.js build, the code differs like follow:

tasks/watch.js

        console.log('Change detected in site theme');
        lessPath = util.replaceExtension(file.path, '.less');
        lessPath = lessPath.replace(source.site, source.definitions);

While in the RTL watch script (tasks/rtl/watch.js), it looks like this:

        console.log('Change detected in site theme');
        lessPath = lessPath.replace(source.site, source.definitions);
        lessPath = util.replaceExtension(file.path, '.less');

I worked out this issue by moving the util.replaceExtension above the replace call in my Project

@motameni
Copy link

motameni commented May 13, 2018

In rtl/watch.js you should swap line 1 with line 2 and line 3 with line 4:

else if(isPackagedTheme) {
        console.log('Change detected in packaged theme');
        lessPath = util.replaceExtension(file.path, '.less'); #line1
        lessPath = lessPath.replace(tasks.regExp.theme, source.definitions); #line2
}
else if(isSiteTheme) {
        console.log('Change detected in site theme');
        lessPath = util.replaceExtension(file.path, '.less'); #line3
        lessPath = lessPath.replace(source.site, source.definitions); #line4
}

@MohammadYounes if you can, please check it ;-)

@MohammadYounes
Copy link
Member

@motameni Yes, .replaceExtension must come first as in default watch.js

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants