Skip to content

Commit 7d9fad5

Browse files
committed
feat: using webpack to replace rollup & update eslint config
1 parent 4697602 commit 7d9fad5

19 files changed

+4426
-2614
lines changed

.babelrc

Lines changed: 0 additions & 13 deletions
This file was deleted.

.eslintignore

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,5 @@
11
dist/
2-
demo/dist
2+
demo/dist
3+
webpack/
4+
jest.config.js
5+
.eslintrc.js

.eslintrc

Lines changed: 0 additions & 75 deletions
This file was deleted.

.eslintrc.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
module.exports = {
2+
root: true,
3+
parser: '@typescript-eslint/parser',
4+
plugins: [
5+
'@typescript-eslint',
6+
],
7+
extends: [
8+
'eslint:recommended',
9+
"plugin:react/recommended",
10+
'plugin:@typescript-eslint/recommended',
11+
],
12+
};

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,6 @@ coverage
1313
node_modules/
1414

1515
dist/
16+
demo/dist/
1617

1718
report.*.json

.npmignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,5 @@ README.md
2525
rollup.config.js
2626
jest.config.js
2727
tsconfig.json
28-
.github/
28+
.github/
29+
webpack/

Makefile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ lint-fix:
99
@npx eslint --fix .
1010
dev:
1111
@echo "Start server..."
12-
@NODE_ENV=development npx rollup -c ./demo/rollup.config.js -w
12+
@NODE_ENV=development npx webpack-dev-server --config ./webpack/demo.js --progress
1313
.PHONY: lint lint-fix dev
1414

1515
# Test
@@ -22,13 +22,13 @@ test: lint-fix
2222
build:
2323
@echo "Building lib..."
2424
@rm -rf ./dist
25-
@npx rollup -c rollup.config.js
25+
@npx webpack --config ./webpack/production.js --progress --bail
2626
@echo "Copy type into dist..."
2727
@cp src/types.ts dist/index.d.ts
2828
build-demo:
2929
@echo "Building demo..."
3030
@rm -rf ./demo/dist
31-
@NODE_ENV=production npx rollup -c ./demo/rollup.config.js
31+
@NODE_ENV=production npx webpack --config ./webpack/demo.js --progress --bail
3232
release:
3333
@echo "Release $(level)"
3434
@echo "Adding tag and modify the CHANGELOG"

demo/index.html renamed to demo/app.template.html

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,6 @@
2727
/>
2828
<meta property="twitter:image" content="/static/react-nice-avatar.png" />
2929

30-
<link href="/dist/index.css" type="text/css" rel="stylesheet" />
31-
3230
<link rel="apple-touch-icon" sizes="180x180" href="/static/apple-touch-icon.png" />
3331
<link rel="icon" type="image/png" sizes="32x32" href="/static/favicon-32x32.png" />
3432
<link rel="icon" type="image/png" sizes="16x16" href="/static/favicon-16x16.png" />
@@ -38,6 +36,5 @@
3836
</head>
3937
<body>
4038
<div id="app"></div>
41-
<script src="/dist/index.js"></script>
4239
</body>
4340
</html>

demo/rollup.config.js

Lines changed: 0 additions & 49 deletions
This file was deleted.

0 commit comments

Comments
 (0)