Skip to content

Commit 3d6bcad

Browse files
committed
chore(proxy-state-tree): create release build and test for bundle size similar to overmind
Similar to overmind build testing bundle size and removed dev warnings from build
1 parent 33a91ad commit 3d6bcad

File tree

2 files changed

+84
-36
lines changed

2 files changed

+84
-36
lines changed
Lines changed: 49 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,53 @@
11
{
2-
"name": "proxy-state-tree",
3-
"version": "1.0.0-beta4",
4-
"description": "An implementation of the Mobx/Vue state tracking approach, for library authors",
5-
"main": "lib/index.js",
6-
"module": "es/index.js",
7-
"types": "lib/index.d.ts",
8-
"scripts": {
9-
"build": "npm run build:lib & npm run build:es",
10-
"build:lib": "tsc --outDir lib --module commonjs",
11-
"build:es": "tsc --outDir es --module es2015",
12-
"clean": "rimraf es lib coverage",
13-
"typecheck": "tsc --noEmit",
14-
"test": "jest --runInBand",
2+
"name": "proxy-state-tree",
3+
"version": "1.0.0-beta4",
4+
"description": "An implementation of the Mobx/Vue state tracking approach, for library authors",
5+
"main": "lib/index.js",
6+
"module": "es/index.js",
7+
"types": "lib/index.d.ts",
8+
"scripts": {
9+
"build": "(npm run build:lib & npm run build:es) && npm run build:dist",
10+
"build:lib": "tsc --outDir lib --module commonjs",
11+
"build:es": "tsc --outDir es --module es2015",
12+
"build:dist": "webpack --config webpack.config.js",
13+
"clean": "rimraf es lib coverage",
14+
"typecheck": "tsc --noEmit",
15+
"test": "jest --runInBand && npm run test:size",
1516
"test:watch": "jest --watch --updateSnapshot --coverage false",
16-
"prebuild": "npm run clean",
17-
"postbuild": "rimraf {lib,es}/**/__tests__",
17+
"test:size": "bundlesize",
18+
"prebuild": "npm run clean",
19+
"postbuild": "rimraf {lib,es}/**/__tests__",
1820
"posttest": "npm run typecheck"
19-
},
20-
"repository": {
21-
"type": "git",
22-
"url": "git+https://github.com/christianalfoni/proxy-state-tree.git"
23-
},
24-
"keywords": [
25-
"state",
26-
"proxy",
27-
"mobx",
28-
"vue",
29-
"store"
30-
],
31-
"author": "Christian Alfoni",
32-
"license": "MIT",
33-
"bugs": {
34-
"url": "https://github.com/christianalfoni/proxy-state-tree/issues"
35-
},
36-
"homepage": "https://github.com/christianalfoni/proxy-state-tree#readme",
37-
"dependencies": {
38-
"is-plain-obj": "^1.1.0"
39-
}
21+
},
22+
"repository": {
23+
"type": "git",
24+
"url": "git+https://github.com/christianalfoni/proxy-state-tree.git"
25+
},
26+
"keywords": [
27+
"state",
28+
"proxy",
29+
"mobx",
30+
"vue",
31+
"store"
32+
],
33+
"author": "Christian Alfoni",
34+
"license": "MIT",
35+
"bugs": {
36+
"url": "https://github.com/christianalfoni/proxy-state-tree/issues"
37+
},
38+
"homepage": "https://github.com/christianalfoni/proxy-state-tree#readme",
39+
"dependencies": {
40+
"is-plain-obj": "^1.1.0"
41+
},
42+
"devDependencies": {
43+
"bundlesize": "^0.17.2",
44+
"terser-webpack-plugin": "^1.3.0",
45+
"webpack": "^4.35.0"
46+
},
47+
"bundlesize": [
48+
{
49+
"path": "./dist/proxy-state-tree.min.js",
50+
"maxSize": "3 kB"
51+
}
52+
]
4053
}
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
const path = require('path')
2+
const TerserPlugin = require('terser-webpack-plugin')
3+
4+
module.exports = {
5+
mode: 'production',
6+
entry: path.resolve('./es/index.js'),
7+
output: {
8+
path: path.resolve('dist'),
9+
filename: 'proxy-state-tree.min.js',
10+
},
11+
optimization: {
12+
minimizer: [
13+
new TerserPlugin({
14+
test: /\.js(\?.*)?$/i,
15+
parallel: true,
16+
sourceMap: true,
17+
terserOptions: {
18+
module: true,
19+
},
20+
}),
21+
],
22+
},
23+
module: {
24+
rules: [
25+
{
26+
test: /\.js$/,
27+
loader: 'babel-loader',
28+
include: path.resolve('src'),
29+
options: {
30+
presets: ['@babel/preset-env'],
31+
},
32+
},
33+
],
34+
},
35+
}

0 commit comments

Comments
 (0)