Last active
August 15, 2023 02:56
-
-
Save 5t3ph/077d788501508ea9f2eefda90c1473e0 to your computer and use it in GitHub Desktop.
SASS compile|autoprefix|minimize and browser-sync server for static HTML
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
/* | |
Project Structure: | |
src/ | |
- sass/ | |
- - style.scss | |
- index.html | |
npm start - copies src files to dist/ and starts Browsersync server at localhost:3000 | |
npm run build - copies files to dist/ and autoprefixes/minifies css | |
*/ | |
{ | |
"name": "project", | |
"version": "0.2.0", | |
"description": "SASS compile|autoprefix|minimize and live-reload dev server using Browsersync for static HTML", | |
"main": "public/index.html", | |
"author": "5t3ph", | |
"scripts": { | |
"build:sass": "sass --no-source-map src/sass:public/css", | |
"copy:html": "copyfiles -u 1 ./src/*.html public", | |
"copy": "npm-run-all --parallel copy:*", | |
"watch:html": "onchange 'src/*.html' -- npm run copy:html", | |
"watch:sass": "sass --no-source-map --watch src/sass:public/css", | |
"watch": "npm-run-all --parallel watch:*", | |
"serve": "browser-sync start --server public --files public", | |
"start": "npm-run-all copy --parallel watch serve", | |
"build": "npm-run-all copy:html build:*", | |
"postbuild": "postcss public/css/*.css -u autoprefixer cssnano -r --no-map" | |
}, | |
"dependencies": { | |
"autoprefixer": "^10.3.4", | |
"browser-sync": "^2.27.5", | |
"copyfiles": "^2.4.1", | |
"cssnano": "^5.0.8", | |
"npm-run-all": "^4.1.5", | |
"onchange": "^7.1.0", | |
"postcss-cli": "^8.3.1", | |
"sass": "^1.39.0" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment