-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move sass compilation to webpack and remove sass tasks from grunt
- Loading branch information
1 parent
712483d
commit 493ec66
Showing
6 changed files
with
719 additions
and
407 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
493ec66
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cool, any specific reason for this? I was looking for my good old sass compiler and couldn't find it 😆
493ec66
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Haha, sorry. RIP good old sass compiler. Mostly for cleanup. I was looking into removing grunt altogether and just using webpack instead. Instead of having 2 tools do similar things. But was running into some problems with pug (there is a webpack plugin, but I couldn't get it to work yet with the fillViewModel). Might get back to that tomorrow
493ec66
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah... moving
pug
over could proof difficult. I'm happy with leaving that in grunt. It isn't webpack's specialty, lets keep it for bundling and some transpiling.The css output doesn't seem to be minimized yet. I just ran
grunt build
, that should do it right?493ec66
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In theory, yes. I've added the minimize parameter to
css-loader
but that doesn't seem to do anything when I try it493ec66
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, i'll open an issue 🐛
493ec66
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The only problem I ran into with the pug files was that the grunt plugin
data
parameter accepts a function ((dest) => ...
) which is used for filling the viewmodel. Thehtml-pug-loader
plugin I tried doesn't seem to have that functionality for giving a function.493ec66
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, I can take a look. Sounds to be doable and one build system is better than 2. Could you create an issue with the info?
493ec66
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@nicojs. I'm working on
" I've added the minimize parameter to css-loader but that doesn't seem to do anything when I try it"
493ec66
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And done.
@hugo-vrijswijk install
cssnano
andpostcss-loader
webpack.config.js
postcss.config.js (in root folder)
493ec66
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@kmdrGroch 💐 thanks for your help! I've added it and it works like a charm. However, now it also does minification during normal builds, but that's fine for tonight. I will close this PR so I can publish the website. Fingers crossed.
493ec66
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@nicojs you can try making some
--dev
--prod
webpack configs. I think it is supported by webpack itself so no pain at all.All you need is to remove
postcss-loader
from--dev
and should be good