But if you're forced to have to wait 1.4 seconds on every Ctrl-S when Webpack or whatever tooling you have starts up sass it might become very painful. If you're only doing it once, who cares about a couple of hundred milliseconds. The speed difference may or may not matter. Who even has Python 2.7 installed anymore? Being able to avoid node-gyp seems like a win for sass. I don't know about you but I'm very skeptical that node-gyp ever works. Whereas /tmp/just-node-sass/node_modules directory is 3,658 files and folders weighing a total of 15.2MB. The /tmp/just-sass/node_modules directory is only 113 files and folders weighing a total of 4.1MB. Ĭonsidering that sass is just a JavaScript compilation of a Dart program, all you get is basically a 3.6MB node_modules/sass/ file. Mkdir just-node-sass & cd just-node-sass & yarn init -y & time yarn add node-sass & cd. Mkdir just-sass & cd just-sass & yarn init -y & time yarn add sass & cd. But you minify both outputs and the pretty print them (with prettier) you get the following difference: The unminified CSS difference primarily in the indentation. Sass took 1467ms result 176kb 139kb Output Versus sass took 1423ms result 176kb 139kb node_modules/bootstrap/scss/bootstrap.scss (version 5.0.0-alpha1) and the results are after 5 runs: node-sass took 269ms result 176kb 139kb In another example, I ran sass and node-sass on. Here's my ugly benchmark test which I run about 10 times like this: node-sass took 101ms result 180kb 92kbĪnd here's the same thing for sass: sass took 751ms result 173kb 92kb Transformed into CSS it becomes a ~180KB blob of CSS (92KB when optimized with csso). I took all the SCSS files behind the current MDN Web Docs which is fairly large. node-sass on the other hand is a wrapper on LibSass which is written in C++. sass is a JavaScript compilation of Dart Sass which is supposedly "the primary implementation of Sass" which is a pretty powerful statement. sass) in Node you have the choice between sass and node-sass.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |