Skip to content

Commit 98bd889

Browse files
author
vvo
committed
fix: expose main dist/ instead of index.js
This is necessary as we are releasing a builded package that should work with browserify/webpack/es5 environment
1 parent b10276a commit 98bd889

File tree

3 files changed

+21
-10
lines changed

3 files changed

+21
-10
lines changed

README.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,23 @@ API is unstable. We welcome any idea.
2828

2929
<!-- END doctoc generated TOC please keep comment here to allow auto update -->
3030

31+
## Setup
32+
33+
### npm
34+
35+
```sh
36+
npm install instantsearch.js --save-dev
37+
```
38+
39+
### `<script>`
40+
41+
instantsearch.js is available on [jsDelivr](http://www.jsdelivr.com/):
42+
43+
```html
44+
<script src="//cdn.jsdelivr.net/instantsearch/0/instantsearch.min.js"></script>
45+
```
46+
47+
3148
## Usage
3249

3350
```js

example/app.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
var instantsearch = require('../');
1+
// force using index because package 'main' is dist/
2+
var instantsearch = require('../index');
23

34
var search = instantsearch({
45
appId: 'latency',

package.json

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,25 +2,18 @@
22
"name": "instantsearch.js",
33
"version": "0.0.0",
44
"description": "Instant search kit for Algolia search",
5-
"main": "index.js",
5+
"main": "dist/instantsearch.js",
66
"author": "Algolia <[email protected]>",
77
"scripts": {
88
"lint": "./scripts/lint.sh",
99
"build": "./scripts/build.sh",
10+
"watch": "webpack --watch",
1011
"dev": "./scripts/dev.sh",
1112
"test": "./scripts/test.sh && npm run lint",
1213
"test:watch": "nodemon -i node_modules/ -i coverage/ -i .git/ -i dist/ -q --exec './scripts/test.sh | tap-spec'",
1314
"release": "./scripts/release.sh",
1415
"doctoc": "doctoc --maxlevel 3 README.md"
1516
},
16-
"browserify": {
17-
"transform": [
18-
"babelify"
19-
]
20-
},
21-
"browser": {
22-
"lodash": "lodash-compat"
23-
},
2417
"repository": "algolia/intantsearch.js",
2518
"devDependencies": {
2619
"babel": "5.8.23",

0 commit comments

Comments
 (0)