Skip to content
This repository has been archived by the owner on Dec 31, 2020. It is now read-only.

Commit

Permalink
chore(build): Use TSDX for bundling (#257)
Browse files Browse the repository at this point in the history
  • Loading branch information
FredyC authored Feb 16, 2020
1 parent 8e60bea commit 3037564
Show file tree
Hide file tree
Showing 7 changed files with 2,485 additions and 176 deletions.
3 changes: 3 additions & 0 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"presets": [["@babel/preset-env", { "targets": { "ie": "11" } }]]
}
6 changes: 6 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,11 @@ root = true

[*]
indent_size = 4
indent_style = space
charset = utf-8
end_of_line = lf
trim_trailing_whitespace = true

[package.json]
indent_style = space
indent_size = 2
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
dist/
coverage/

.rpt2_cache
.DS_Store

npm-debug.log*
Expand Down
10 changes: 8 additions & 2 deletions .size-limit.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
[
{
"path": "dist/index.js",
"limit": "4 KB",
"path": "dist/mobxreactlite.umd.production.min.js",
"limit": "1.7 KB",
"webpack": false,
"running": false
},
{
"path": "dist/mobxreactlite.cjs.production.min.js",
"limit": "1.7 KB",
"webpack": false,
"running": false
}
Expand Down
27 changes: 14 additions & 13 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,13 @@
"version": "1.5.2",
"description": "Lightweight React bindings for MobX based on React 16.8 and Hooks",
"main": "dist/index.js",
"jsnext:main": "dist/index.module.js",
"module": "dist/index.module.js",
"react-native": "dist/native.js",
"typings": "dist/index.d.ts",
"types": "dist/index.d.ts",
"jsnext:main": "dist/mobxreactlite.esm.js",
"module": "dist/mobxreactlite.esm.js",
"unpkg": "dist/mobxreactlite.umd.production.min.js",
"react-native": "dist/mobxreactlite.esm.js",
"sideEffects": false,
"repository": {
"type": "git",
"url": "https://github.com/mobxjs/mobx-react-lite.git"
Expand All @@ -21,8 +23,11 @@
"size": "size-limit",
"coverage": "jest --coverage",
"prebuild": "rimraf dist",
"build": "node build-rollup.js",
"prepublishOnly": "yarn build"
"build": "yarn bundle",
"postbuild": "shx cp dist/mobxreactlite.umd.production.min.js dist/index.min.js",
"bundle": "tsdx build --name mobxReactLite --format=cjs,esm,umd --tsconfig tsconfig.build.json",
"prepublishOnly": "yarn build",
"dedup": "npx yarn-deduplicate -s fewer yarn.lock"
},
"author": "Daniel K.",
"license": "MIT",
Expand All @@ -35,6 +40,8 @@
"react": "^16.8.0"
},
"devDependencies": {
"@babel/core": "7.8.4",
"@babel/preset-env": "7.8.4",
"@size-limit/preset-small-lib": "2.1.6",
"@size-limit/time": "2.1.6",
"@testing-library/jest-dom": "4.1.2",
Expand All @@ -56,16 +63,10 @@
"react-dom": "16.10.2",
"react-test-renderer": "16.10.2",
"rimraf": "3.0.0",
"rollup": "1.23.1",
"rollup-plugin-alias": "1.5.2",
"rollup-plugin-commonjs": "10.1.0",
"rollup-plugin-filesize": "6.2.0",
"rollup-plugin-node-resolve": "5.2.0",
"rollup-plugin-replace": "2.2.0",
"rollup-plugin-terser": "5.1.2",
"rollup-plugin-typescript2": "0.24.3",
"size-limit": "2.1.6",
"shx": "0.3.2",
"ts-jest": "24.1.0",
"tsdx": "0.12.3",
"tslint": "5.20.0",
"tslint-config-prettier": "1.18.0",
"typescript": "3.6.4"
Expand Down
14 changes: 14 additions & 0 deletions tsdx.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
module.exports = {
rollup(config, options) {
return {
...config,
output: {
...config.output,
globals: {
react: "React",
mobx: "mobx"
}
}
}
}
}
Loading

0 comments on commit 3037564

Please sign in to comment.