To make sure that the npm is well installed the npm -v should output something like: 5.7.1, for Grunt grunt -version should output something like: grunt-cli v1.2.0 Install Grunt CLI : npm install -g grunt-cli We have to install npm node.js on your machine : sudo apt-get install npm Important : be sure that you are in developer mode, in root project location when you execute the command bellow. less files, and especially the watch that observes the changes of the files and which it is indispensable for the our liveReload It is very useful for Magento 2 because by its configuration, it allows us to removes the theme related static files in the pub/static and var directories, set up the. Grunt is a JavaScript Task Runner, a tool that allows you to create automated tasks in JavaScript, I find this beautiful because for a developer Magento when it is in full development or integration he is obliged to refresh the page manually to see the result, then he goes back on his code he update, he saves, he clean the cache, then he returns to the browser, he refresh the browser and so on, while with the liveReload it's over all that, it is just enough to save the update and 'Hoop' magically the content that you have changed instantaneously appear without refreshing the browser and without cleaning the cache, deploying the static-content either but for the cache, you also need Grunt but I explain in detail how to put this. As soon as you save a file, it is preprocessed as needed, and the browser is refreshed.Įven cooler, when you change a CSS file or an image, the browser is updated instantly without reloading the page. So I decided to publish the complete solution, the installation of Grunt and then Livereload and how to configure both together because I found that they are very useful tools for Magento2 and even more for the frontend developersįor those who don't know what is LiveReload, LiveReload monitors changes in the file system. It's been two days since the post is open and no one has found the answer to my question, and working hard on this topic I finally found the solution. LiveReload 2.3 (or later) or another compatible server is running. I also wanted to mention that the liveReload browser extension is well installed but does not work, ie when I press on a logo, it shows me an error message:Ĭould not connect to LiveReload server.Completed in 0.001s at Wed 16:08:58 GMT+0100īut he doesn't refresh the page,(when i refresh it manually, i see well my changes) is there a configuration to do in grunt or in the server ? I have grunt installed and it works fine i can clean, exec, etc but, when i enter: grunt watch he watch well the changes, example: if i change mycustom.css, he display :įile "pub/static/frontend/Package/theme/fr_FR/css/mycustom.css" changed. I have some problem, i don't know why but the liveReload dont refresh th content changed automatically. I think that when looking for something, the first reflex is to search if there was already the same question as mine that was asked before, and I saw this post and it does not answer my problem! and even more there is not a reliable answer or accepted !ĭoes anyone ever work or still work with the liveReload via grunt ? I would like to mention that this answer does not answer my question, if someone sees that it is the same thing, I invite him to answer me instead of saying that he is duplicated and we will see if it solves my problem.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |