Skip to content

Commit

Permalink
feat: 增加 react demo
Browse files Browse the repository at this point in the history
  • Loading branch information
xuasir committed Mar 17, 2021
1 parent d0a517a commit ca10be3
Show file tree
Hide file tree
Showing 6 changed files with 62 additions and 1 deletion.
11 changes: 11 additions & 0 deletions packages/playground/react/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"name": "playground-react",
"version": "0.0.0",
"scripts": {
"build": "npx xus lib-build"
},
"license": "MIT",
"dependencies": {
"react": "^17.0.1"
}
}
10 changes: 10 additions & 0 deletions packages/playground/react/src/app.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import React, { useState } from 'react'

export const App = () => {
const [d] = useState(0)
return (
<>
<div>{d}</div>
</>
)
}
1 change: 1 addition & 0 deletions packages/playground/react/src/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from './app'
10 changes: 10 additions & 0 deletions packages/playground/react/xus.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import { defineConfig } from '@xus/cli'

export default defineConfig({
libBuild: {
target: ['es2015'],
formats: ['esm'],
sourcemap: false,
minify: false
}
})
28 changes: 28 additions & 0 deletions packages/playground/react/yarn.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
# yarn lockfile v1


"js-tokens@^3.0.0 || ^4.0.0":
version "4.0.0"
resolved "https://registry.npm.taobao.org/js-tokens/download/js-tokens-4.0.0.tgz#19203fb59991df98e3a287050d4647cdeaf32499"
integrity sha1-GSA/tZmR35jjoocFDUZHzerzJJk=

loose-envify@^1.1.0:
version "1.4.0"
resolved "https://registry.npm.taobao.org/loose-envify/download/loose-envify-1.4.0.tgz#71ee51fa7be4caec1a63839f7e682d8132d30caf"
integrity sha1-ce5R+nvkyuwaY4OffmgtgTLTDK8=
dependencies:
js-tokens "^3.0.0 || ^4.0.0"

object-assign@^4.1.1:
version "4.1.1"
resolved "https://registry.npm.taobao.org/object-assign/download/object-assign-4.1.1.tgz#2109adc7965887cfc05cbbd442cac8bfbb360863"
integrity sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=

react@^17.0.1:
version "17.0.1"
resolved "https://registry.npm.taobao.org/react/download/react-17.0.1.tgz#6e0600416bd57574e3f86d92edba3d9008726127"
integrity sha1-bgYAQWvVdXTj+G2S7bo9kAhyYSc=
dependencies:
loose-envify "^1.1.0"
object-assign "^4.1.1"
3 changes: 2 additions & 1 deletion packages/playground/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
{
"compilerOptions": {
"outDir": "./dist",
"lib": ["ESNext"]
"lib": ["ESNext"],
"jsx": "preserve"
},
"extends": "../../tsconfig.json",
"include": ["./src/**/*"],
Expand Down

0 comments on commit ca10be3

Please sign in to comment.