Skip to content

Commit

Permalink
chore: add tailwind case
Browse files Browse the repository at this point in the history
  • Loading branch information
xuhongbin committed Jun 8, 2023
1 parent 4410dbc commit 7196fa1
Show file tree
Hide file tree
Showing 9 changed files with 732 additions and 19 deletions.
686 changes: 667 additions & 19 deletions pnpm-lock.yaml

Large diffs are not rendered by default.

8 changes: 8 additions & 0 deletions projects/tailwind-react/emp-config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
const {defineConfig} = require('@efox/emp')
module.exports = defineConfig(() => {
return {
webpackChain(wpChain) {
wpChain.plugin('tailwind').use(require('tailwind'), [])
},
}
})
28 changes: 28 additions & 0 deletions projects/tailwind-react/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{
"name": "tailwind-react",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"dev": "emp dev",
"build": "emp build --env prod",
"start": "emp serve",
"stat": "emp build --analyze",
"emp": "emp",
"lint": "eslint ./src --ext js,ts,tsx"
},
"author": "",
"license": "ISC",
"devDependencies": {
"@efox/emp": "workspace:^*",
"@types/react": "18",
"@types/react-dom": "18",
"@types/react-router-dom": "^5.1.5",
"tailwind": "^4.0.0"
},
"dependencies": {
"react": "^18.1.0",
"react-dom": "^18.1.0",
"react-router-dom": "5"
}
}
2 changes: 2 additions & 0 deletions projects/tailwind-react/src/App.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
const App = () => <h1 className="text-3xl font-bold underline">Hello world!</h1>
export default App
5 changes: 5 additions & 0 deletions projects/tailwind-react/src/bootstrap.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import {render} from 'react-dom'
import App from './App'
import './index.css'

render(<App />, document.getElementById('emp-root'))
3 changes: 3 additions & 0 deletions projects/tailwind-react/src/index.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
@tailwind base;
@tailwind components;
@tailwind utilities;
1 change: 1 addition & 0 deletions projects/tailwind-react/src/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
import('./bootstrap')
8 changes: 8 additions & 0 deletions projects/tailwind-react/tailwind.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
/** @type {import('tailwindcss').Config} */
module.exports = {
content: ['./src/**/*.{js,jsx,ts,tsx}'],
theme: {
extend: {},
},
plugins: [],
}
10 changes: 10 additions & 0 deletions projects/tailwind-react/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"extends": "@efox/emp/emp-tsconfig.json",
"compilerOptions": {
"types": ["@efox/emp/client"],
"baseUrl": ".",
},
"include": [
"src",
]
}

0 comments on commit 7196fa1

Please sign in to comment.