npm i pug
npm install -g pug-cli
pug -w ./ -o ./html -P
This code is hard to remember, so I recommend adding the "pug": "pug -w ./ -o ./html -P"
command between the script tag in the package.json
file.
"scripts": {
"pug": "pug -w ./ -o ./html -P"
},
npm run pug
npm i sass
mkdir scss
mkdir css
sass --watch scss:css
This code is hard to remember, so I recommend adding the "sass -w sass/"
command between the script tag in the package.json
file.
"scripts": {
"sass": "sass --watch scss:css"
},
npm run sass
npm i bootstrap
If you want to download the version of bootstrap you want, you can see in the example below, here is the code for bootstrap version 5.3.3
npm install bootstrap@5.3.3
npm i bootstrap-icons
<link rel="stylesheet" href="/node_modules/bootstrap-icons/font/bootstrap-icons.css">
npm install --save-dev parcel
npx parcel ./index.html
http://localhost:1234/
This code is hard to remember, so I recommend adding the "prc": "npx parcel ./index.html"
command between the script tag in the package.json
file.
"scripts": {
"prc": "npx parcel ./index.html"
},
npm run prc
npm install --save-dev parcel
npm install css-minify -g
css-minify -f filename
css-minify --file filename
||
css-minify -d sourcedir -o distdir
css-minify --dir sourcedir --output distdir
This code is hard to remember, so I recommend adding the "min": "css-minify -f ./css/style.css"
command between the script tag in the package.json
file.
"scripts": {
"min": "css-minify -f ./css/style.css"
},
npm run min
npm install tailwindcss
npx tailwindcss init
npx tailwindcss init --full
/** @type {import('tailwindcss').Config} */
module.exports = {
content: ["./**/*.{html,js}"],
theme: {
extend: {},
},
plugins: [],
}
Add the Tailwind directives to your CSS, Add the @tailwind directives for each of Tailwind’s layers to your main CSS file.
@tailwind base;
@tailwind components;
@tailwind utilities;
npx tailwindcss -i ./src/input.css -o ./src/output.css --watch
This code is hard to remember, so I recommend adding the "twind": "npx tailwindcss ... --watch"
command between the script tag in the package.json
file.
"scripts": {
"twind": "npx tailwindcss -i ./src/input.css -o ./src/output.css --watch"
},
<link href="./src/output.css" rel="stylesheet">
npm run twind
npm install -g live-server
live-server
"scripts": {
"go": "live-server"
},
npm run live