Skip to content
This repository has been archived by the owner on Apr 13, 2023. It is now read-only.

Minify umd and ensure umd name consistency #1469

Merged
merged 4 commits into from
Dec 27, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ first three params (`TChildProps` can be derived). [#1402](https://github.com/ap
- Remove copied `shallowEqual` code and delegate to `fbjs` [#1465](https://github.com/apollographql/react-apollo/pull/1465)
- Update rollup configurations, refine package exports [#1467](https://github.com/apollographql/react-apollo/pull/1467)
- Removed unused gzip script [#1468](https://github.com/apollographql/react-apollo/pull/1468)
- Minify umd and ensure umd name consistency [#1469](https://github.com/apollographql/react-apollo/pull/1469)

### 2.0.4
- rolled back on the lodash-es changes from
Expand Down
11 changes: 3 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,6 @@
"name": "react-apollo",
"version": "2.0.4",
"description": "React data container for Apollo Client",
"main": "lib/react-apollo.umd.js",
"module": "./lib/index.js",
"jsnext:main": "./lib/index.js",
"browser": "lib/react-apollo.browser.umd.js",
"typings": "lib/index.d.ts",
"scripts": {
"danger": "danger run --verbose",
"deploy": "./scripts/prepare-package.sh && cd npm && npm publish",
Expand All @@ -19,8 +14,7 @@
"precompile": "rimraf lib && rimraf npm",
"compile":
"tsc --project tsconfig.json && rimraf lib/test && mv lib/src/* lib/. && rimraf lib/src",
"postcompile": "npm run bundle",
"bundle":
"postcompile":
"rollup -c rollup.config.js && rollup -c rollup.test-utils.config.js",
"watch": "tsc -w",
"lint": "tslint --project tsconfig.json --config tslint.json",
Expand All @@ -32,7 +26,7 @@
},
"bundlesize": [
{
"path": "./lib/umd/react-apollo.umd.js",
"path": "./lib/umd/react-apollo.js",
"threshold": "1 Kb"
}
],
Expand Down Expand Up @@ -118,6 +112,7 @@
"recompose": "0.26.0",
"rimraf": "2.6.2",
"rollup": "0.53.0",
"rollup-plugin-babel-minify": "^3.1.2",
"source-map-support": "0.5.0",
"ts-jest": "22.0.0",
"tslint": "5.8.0",
Expand Down
5 changes: 4 additions & 1 deletion rollup.config.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
const minify = require('rollup-plugin-babel-minify');

export default {
input: 'lib/index.js',
output: {
file: 'lib/umd/react-apollo.umd.js',
file: 'lib/umd/react-apollo.js',
format: 'umd',
name: 'react-apollo',
sourcemap: true,
},
plugins: [minify()],
onwarn,
};

Expand Down
3 changes: 3 additions & 0 deletions rollup.test-utils.config.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
const minify = require('rollup-plugin-babel-minify');

export default {
input: 'lib/test-utils.js',
output: {
Expand All @@ -6,6 +8,7 @@ export default {
name: 'react-apollo',
sourcemap: true,
},
plugins: [minify()],
onwarn,
};

Expand Down
4 changes: 2 additions & 2 deletions scripts/prepare-package.sh
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ node -e "var package = require('./package.json'); \
delete package[\"pre-commit\"]; \
delete package.scripts; \
delete package.options; \
package.main = 'umd/react-apollo.umd.js'; \
package.main = 'umd/react-apollo.js'; \
package.module = 'index.js'; \
package['jsnext:main'] = 'index.js'; \
package.typings = 'index.d.ts'; \
Expand All @@ -47,5 +47,5 @@ cp README.md npm/
cp LICENSE npm/
cp src/index.js.flow npm/
# please keep this in sync with the filename used in package.main
cp src/index.js.flow npm/react-apollo.umd.js.flow
cp src/index.js.flow npm/umd/react-apollo.js.flow