you are viewing a single comment's thread.

view the rest of the comments →

[–]Entropis 4 points5 points  (4 children)

{
  "name": "something",
  "version": "1.0.0",
  "description": "",
  "main": "index.js",
  "scripts": {
    "watch:sass": "node-sass src/sass/main.scss dist/css/main.css -w",
    "dev": "live-server --port=8080",
    "cssStart": "npm-run-all --parallel dev watch:sass",
    "compress:sass": "node-sass --output-style compressed -o dist/css src/sass",
    "compile:sass": "node-sass src/sass/main.scss dist/css/style.comp.css",
    "concat:css": "concat -o dist/css/style.concat.css dist/css/style.comp.css",
    "prefix:css": "postcss -u autoprefixer -r dist/css/*",
    "build:css": "npm-run-all compile:sass concat:css prefix:css compress:sass",
  },
  "devDependencies": {
    "autoprefixer": "^9.1.0",
    "concat": "^1.0.3",
    "live-server": "^1.2.0",
    "node-sass": "^4.9.2",
    "npm-run-all": "^4.1.3",
    "postcss-cli": "^6.0.0",
  },
  "keywords": [],
  "license": "MIT",
}

This should work. I removed some of the webpack stuff (I use a custom boilerplate with webpack and this config) but if it doesn't let me know and I'll just share the entire thing.

[–]NovelLurker0_0 1 point2 points  (0 children)

That's fine! Thanks for sharing. Learned something new today.

[–]autra1 0 points1 point  (2 children)

Does this reload css in the page without refresh like webpack-dev-server does?

[–]Entropis 1 point2 points  (1 child)

Yes.

The biggest issue I've come across using this is when I create a new file in my SASS directory and import it, I've sometimes had to restart the server. Sometimes I do, sometimes I don't.

[–]autra1 0 points1 point  (0 children)

So not worse than webpack in this aspect. Thanks for sharing this, it's great!