Skip to content

Commit

Permalink
feat: 增加js demo
Browse files Browse the repository at this point in the history
  • Loading branch information
xuasir committed Mar 17, 2021
1 parent 3b4df33 commit d567058
Show file tree
Hide file tree
Showing 7 changed files with 56 additions and 0 deletions.
3 changes: 3 additions & 0 deletions packages/playground/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# `playground`

`demo`工厂
9 changes: 9 additions & 0 deletions packages/playground/js/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"name": "playground-js",
"version": "10.0.0",
"description": "",
"scripts": {
"build": "npx xus lib-build"
},
"license": "MIT"
}
1 change: 1 addition & 0 deletions packages/playground/js/src/di.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export const dires = 23
9 changes: 9 additions & 0 deletions packages/playground/js/src/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
// es6+
export const trim = ' 123'.trimStart()
export const arrFalt = [['1', '2'], 3].falt()

// dynamic import
export const di = async () => {
await Promise.resolve(3)
await import('./di')
}
10 changes: 10 additions & 0 deletions packages/playground/js/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', 'cjs'],
sourcemap: false,
minify: false
}
})
16 changes: 16 additions & 0 deletions packages/playground/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"private": true,
"description": "xus cli playground",
"author": "guo.xu <xuguo@outlook.it>",
"homepage": "https://github.com/xus-code/bundle-tools/tree/master/packages/cli#readme",
"license": "MIT",
"repository": {
"type": "git",
"url": "git+https://github.com/xus-code/bundle-tools.git"
},
"dependencies": {
"@xus/cli": "^0.2.0",
"@xus/plugin-lib-legacy": "^0.2.0",
"@xus/plugin-lib-vue-jsx": "^0.2.0"
}
}
8 changes: 8 additions & 0 deletions packages/playground/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"compilerOptions": {
"outDir": "./dist"
},
"extends": "../../tsconfig.json",
"include": ["./src/**/*"],
"exclude": ["./src/js/**/*"]
}

0 comments on commit d567058

Please sign in to comment.