Skip to content

Commit

Permalink
chore: 修改项目打包方式 (#7)
Browse files Browse the repository at this point in the history
  • Loading branch information
lvisei authored Jun 2, 2022
1 parent 34cb804 commit e653c35
Show file tree
Hide file tree
Showing 24 changed files with 34 additions and 36 deletions.
2 changes: 2 additions & 0 deletions .browserslistrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
IE 11
last 2 versions
2 changes: 2 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,7 @@
node_modules
# don't lint build output (make sure it's set to your correct build folder name)
dist
es
lib
# don't lint nyc coverage output
coverage
15 changes: 9 additions & 6 deletions .fatherrc.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
export default {
entry: 'src/index.ts',
umd: {
file: 'umd/larkmap',
name: 'LarkMap',
minFile: true,
sourcemap: true,
},
esm: 'babel',
cjs: 'babel',
// https://github.com/umijs/father#umd
// umd: {
// file: 'larkmap',
// name: 'LarkMap',
// minFile: true,
// sourcemap: true,
// },
};
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/----bug-report.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ assignees: ''

### 🐛 Bug description [Please make everyone to understand it]

> Please provide a link by forking these links [LarkMap](https://codesandbox.io/s/l7plot-issue-template-ckpvq?file=/src/index.ts) or GitHub repo, a minimal reproduction.
> Please provide a link by forking these links [LarkMap](https://codesandbox.io/s/larkmap-issue-template-c9m1hr) or GitHub repo, a minimal reproduction.
- _Required_ **Link to minimal reproduction**:

Expand Down
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/---ask-for-question.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ assignees: ''

### 💻 Link to minimal reproduction

Please provide a link by forking these links [LarkMap](https://codesandbox.io/s/l7plot-issue-template-ckpvq?file=/src/index.ts) or GitHub repo. What is a minimal reproduction, and why is it required?
Please provide a link by forking these links [LarkMap](https://codesandbox.io/s/larkmap-issue-template-c9m1hr) or GitHub repo. What is a minimal reproduction, and why is it required?

### 🏞 Expected result

Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ lerna-debug.log*
node_modules/

# Build
lib
es
dist
docs-dist

Expand Down
18 changes: 8 additions & 10 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
{
"name": "@antv/larkmap",
"version": "0.0.1-alpha.1",
"version": "0.0.1-alpha.2",
"description": "A React toolkit for geospatial visualization based on L7",
"license": "MIT",
"main": "dist/lib/index.js",
"module": "dist/esm/index.js",
"types": "dist/lib/index.d.ts",
"main": "lib/index.js",
"module": "es/index.js",
"types": "es/index.d.ts",
"files": [
"dist"
"lib",
"es"
],
"scripts": {
"prepare": "husky install",
Expand All @@ -21,10 +22,7 @@
"test-cover": "jest --coverage",
"clean": "rimraf dist",
"size": "limit-size",
"build:cjs": "tsc -p tsconfig.build.json --module commonjs --outDir dist/lib",
"build:esm": "tsc -p tsconfig.build.json --module ESNext --outDir dist/esm",
"build:umd": "father-build --clean=false && npm run size",
"build": "npm run clean && run-p build:cjs build:esm",
"build": "father-build",
"docs:build": "dumi build",
"docs:build-analyze": "ANALYZE=1 dumi build",
"docs:deploy": "gh-pages -d docs-dist",
Expand Down Expand Up @@ -76,7 +74,7 @@
},
"limit-size": [
{
"path": "dist/umd/larkmap.min.js",
"path": "dist/larkmap.min.js",
"limit": "100 Kb"
}
],
Expand Down
2 changes: 1 addition & 1 deletion src/components/CustomControl/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,6 @@ nav:

### 默认示例

<code src="./demo/default.tsx" defaultShowCode></code>
<code src="./demos/default.tsx" defaultShowCode></code>

<API></API>
File renamed without changes.
2 changes: 1 addition & 1 deletion src/components/LarkMap/hooks/use-layer/use-layer.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ group:

### 默认示例

<code src="./demo/default.tsx" defaultShowCode></code>
<code src="./demos/default.tsx" defaultShowCode></code>

### API

Expand Down
2 changes: 1 addition & 1 deletion src/components/LarkMap/hooks/use-scene/use-scene.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ group:

### 默认示例

<code src="./demo/default.tsx" defaultShowCode></code>
<code src="./demos/default.tsx" defaultShowCode></code>

### API

Expand Down
4 changes: 2 additions & 2 deletions src/components/LarkMap/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@ LarkMap 是地图容器组件,相关地图组件与 Hooks 需放到容器组

### 通过配置项生成

<code src="./demo/default.tsx" defaultShowCode></code>
<code src="./demos/default.tsx" defaultShowCode></code>

### 通过实例生成

<code src="./demo/mapbox-instance.tsx" defaultShowCode></code>
<code src="./demos/mapbox-instance.tsx" defaultShowCode></code>

## API

Expand Down
2 changes: 1 addition & 1 deletion src/components/Layers/BubbleLayer/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ BubbleLayer 用于点数据展示,支持文本标注。

### 默认示例

<code src="./demo/default.tsx"></code>
<code src="./demos/default.tsx"></code>

## API

Expand Down
2 changes: 1 addition & 1 deletion src/components/Layers/ChoroplethLayer/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ ChoroplethLayer 用于面数据展示,支持文本标注。

### 默认示例

<code src="./demo/default.tsx"></code>
<code src="./demos/default.tsx"></code>

## API

Expand Down
2 changes: 1 addition & 1 deletion src/version.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export default '0.0.1-alpha.1';
export default '0.0.1-alpha.2';
8 changes: 0 additions & 8 deletions tsconfig.build.json

This file was deleted.

3 changes: 1 addition & 2 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,9 @@
"pretty": true,
"lib": ["dom", "esnext"],
"skipLibCheck": true,
"sourceRoot": "src",
"baseUrl": "src",
"outDir": "dist"
},
"include": ["src/**/*", "__tests__/*", "typings.d.ts"],
"exclude": ["node_modules", "dist", "src/.umi/*"]
"exclude": ["node_modules", "es", "lib", "dist", "src/.umi/*"]
}

0 comments on commit e653c35

Please sign in to comment.