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

Closed
Phoscur opened this Issue Jul 8, 2012 · 5 comments

Comments

Projects
None yet
4 participants
@Phoscur

Phoscur commented Jul 8, 2012

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

This comment has been minimized.

Show comment
Hide comment
@sokra

sokra Jul 8, 2012

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"
  }
}
Member

sokra commented Jul 8, 2012

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

This comment has been minimized.

Show comment
Hide comment
@Phoscur

Phoscur Jul 10, 2012

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.

Phoscur commented Jul 10, 2012

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

This comment has been minimized.

Show comment
Hide comment
@sokra

sokra Jul 10, 2012

Member

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

Member

sokra commented Jul 10, 2012

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

@alexwasner

This comment has been minimized.

Show comment
Hide comment
@alexwasner

alexwasner Feb 9, 2016

This is still open. Is there a good solution for this?

This is still open. Is there a good solution for this?

@danez danez closed this Dec 12, 2016

@danez danez added the question label Dec 12, 2016

@Phoscur

This comment has been minimized.

Show comment
Hide comment
@Phoscur

Phoscur Dec 12, 2016

@sokra provided a solution. Thanks for that!
And sorry for not closing this earlier.

Phoscur commented Dec 12, 2016

@sokra provided a solution. Thanks for that!
And sorry for not closing this earlier.

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