Skip to content

Instantly share code, notes, and snippets.

@azmankudus
Last active January 27, 2021 01:51
Show Gist options
  • Save azmankudus/085402f61e06953685ad4940d9a97ac4 to your computer and use it in GitHub Desktop.
Save azmankudus/085402f61e06953685ad4940d9a97ac4 to your computer and use it in GitHub Desktop.
ReactJS sample
npm install -g yarn
yarn create react-app hello-react
cd hello-react
vi package.json
##################################################
"dependencies": {
"react": "^16.14.0",
"react-dom": "^16.14.0",
}
##################################################
yarn add rsuite
yarn add react-grid-layout
yarn add react-transition-group
yarn add react-chartjs-2 chart.js
npm install tailwindcss@npm:@tailwindcss/postcss7-compat @tailwindcss/postcss7-compat postcss@^7 autoprefixer@^9
yarn add @craco/craco
vi package.json
##################################################
{
"scripts": {
"start": "craco start",
"build": "craco build",
"test": "craco test",
},
}
##################################################
vi craco.config.js
##################################################
module.exports = {
style: {
postcss: {
plugins: [
require('tailwindcss'),
require('autoprefixer'),
],
},
},
}
##################################################
vi tailwind.config.js
##################################################
module.exports = {
purge: ['./src/**/*.{js,jsx,ts,tsx}', './public/index.html'],
darkMode: 'class',
theme: {
extend: {},
},
variants: {
extend: {},
},
plugins: [],
}
##################################################
vi src/index.css
##################################################
@tailwind base;
@tailwind components;
@tailwind utilities;
##################################################
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment