Last active
January 15, 2023 07:39
-
-
Save gpsarkar/a86ad83d73c7306caeacda3e85e082c5 to your computer and use it in GitHub Desktop.
init frontend project
This file contains hidden or 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
yarn init -y | |
yarn add normalize-scss | |
yarn add --dev stylelint stylelint-config-sass-guidelines stylelint-config-prettier stylelint-prettier prettier | |
yarn add --dev husky lint-staged | |
.stylelintrc.json | |
{ | |
"plugins": [ | |
"stylelint-prettier" | |
], | |
"extends": [ | |
"stylelint-config-sass-guidelines", | |
"stylelint-config-prettier", | |
"stylelint-prettier/recommended" | |
] | |
} | |
package.json | |
"scripts": { | |
"lint": "stylelint \"**/*.scss\" --config .stylelintrc.json", | |
"lint:fix": "yarn lint --fix" | |
}, | |
"lint-staged": { | |
"*.scss": "yarn lint:fix" | |
} | |
------------------- | |
HUSKY > v4 | |
npx husky-init | |
yarn | |
npx husky add .husky/pre-commit 'npx lint-staged' | |
---------------------------------- | |
yarn add --dev sass | |
build.js | |
const Fs = require('fs'); | |
const Path = require('path'); | |
const Sass = require('sass'); | |
const result = Sass.renderSync({ | |
data: Fs.readFileSync( | |
Path.resolve('src/global.scss') | |
).toString(), | |
outputStyle: 'expanded', | |
outFile: 'global.css', | |
includePaths: [Path.resolve('src')] | |
}) | |
console.log(result.css.toString()); | |
yarn add --dev react @types/react typescript | |
yarn add ---dev rollup rollup-plugin-typescript2 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment