Skip to content

Loading…

less task / grunt-webpack as grunt-less replacement #4

Open
Phoscur opened this Issue · 3 comments

2 participants

@Phoscur

Maybe it's because I don't understand/like webpack's loaders, but I'd like to keep that task seperated from the JavaScript compiling.
Still, webpack leverages that ability to compile less files, so why shouldn't it be able to replace grunt-less?

grunt.js:

   webpack: {
          style: { src: "less/style.less", dest: "static/style.css" }
   }
@sokra
webpack member

It's your choice to keep it seperated, but what's your reason? Bundling with webpack has many advantages. ;)
If you just want it as seperate file, you may take a look at the file loader (list)

We can add a task which executes (webpack) loaders and emit the result to a file.

webpackLoader: {
  style: {
    src: "less/style.less",
    loader: "less",
    dest: "static/style.css"
  }
}
@Phoscur

One task does one thing. Grunt bundles them.
I don't want to pollute my requires with !xloader stuff, and I don't want anything programmatically in my templates.
For the less compiling, I guess I will stay with grunt-less for now.

@sokra
webpack member

ok. it's optional. You don't have to use loaders and use webpack only as CommonsJs packager.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.