Merge pull request #115 from MoOx/feature/minify

Add a minified version of Pjax to NPM
This commit was merged in pull request #115.
This commit is contained in:
BehindTheMath
2018-01-24 08:48:23 -05:00
committed by GitHub
4 changed files with 21 additions and 12 deletions

1
.gitignore vendored
View File

@@ -3,3 +3,4 @@ node_modules/
tests/scripts/index.html
pjax.js
.nyc_output/
pjax.min.js

View File

@@ -1,7 +1,8 @@
{
"excludeFiles": [
"node_modules/**",
"pjax.js"
"pjax.js",
"pjax.min.js"
],
"fileExtensions": [
".js"

View File

@@ -21,15 +21,19 @@ Especially for user that have low bandwidth connection._
## Installation
You can install pjax from **npm**
- You can install pjax from **npm**:
```shell
$ npm install pjax
npm install pjax
```
Pjax can obviously be downloaded directly.
[https://unpkg.com/pjax/pjax.js](https://unpkg.com/pjax/pjax.js)
- You can also link directly to the [bundle](https://cdn.jsdelivr.net/npm/pjax/pjax.js):
```html
<script src="https://cdn.jsdelivr.net/npm/pjax@VERSION/pjax.js"></script>
```
Or the [minified bundle](https://cdn.jsdelivr.net/npm/pjax/pjax.min.js):
```html
<script src="https://cdn.jsdelivr.net/npm/pjax@VERSION/pjax.min.js"></script>
```
## No dependencies

View File

@@ -18,7 +18,8 @@
"files": [
"index.js",
"lib",
"pjax.js"
"pjax.js",
"pjax.min.js"
],
"devDependencies": {
"browserify": "^15.0.0",
@@ -32,18 +33,20 @@
"serve": "^6.4.4",
"tap-nyc": "^1.0.3",
"tap-spec": "^4.1.1",
"tape": "^4.8.0"
"tape": "^4.8.0",
"uglify-js": "^3.3.8"
},
"scripts": {
"lint": "jscs . && jshint . --exclude-path .gitignore",
"standalone": "browserify index.js --standalone Pjax > pjax.js",
"build": "npm run standalone && uglifyjs pjax.js -o pjax.min.js",
"build-debug": "browserify index.js --debug --standalone Pjax > pjax.js",
"tests": "tape -r ./tests/setup.js \"./tests/**/*.js\"",
"test": "npm run lint && npm run tests | tap-spec",
"coverage-tests": "npm run tests | tap-nyc",
"coverage": "nyc -x \"tests/**\" npm run coverage-tests",
"example": "opn http://localhost:3000/example/ && serve -p 3000 .",
"prepublish": "npm run standalone",
"prepublish": "npm run build",
"release": "npmpub"
}
}