0

Is there any work around to use SCSS/SASS file directly rather giving compiled .css file in index.html using link tag. Actually when we deal with sass we compile them into css and we will give the .css file in index.html. Instead can we compile SCSS file to css and give the final file in link tag inside Index.html on fly.

Thanks In advance.

Dinesh Sundaraneedi
  • 402
  • 1
  • 5
  • 18

2 Answers2

0

You can look at using a task runner such as Gulp or Grunt to achieve what you'd want to do. You can automate your tasks to compile sass to css on the fly.

There is a good read here on Stackoverflow

Community
  • 1
  • 1
Stephen C
  • 843
  • 2
  • 14
  • 28
  • Here we will give the dst file path in index.html(which is a .css file) but my scenario is to use .scss file in index.html instead of giving .css – Dinesh Sundaraneedi Oct 18 '16 at 13:37
  • You cannot load SCSS directly to a page without compiling to css first. But you can use the task runners to automate the process to feel like you've included it directly. Something along the lines of https://www.browsersync.io/docs/gulp – Stephen C Oct 18 '16 at 13:42
0

We can do it using a bundler like webpack where you use plugins to convert scss to css and automatically give it in link tag inside index.html on fly.

Dinesh Sundaraneedi
  • 402
  • 1
  • 5
  • 18