Add a minified version of Pjax to NPM #115

Merged
BehindTheMath merged 2 commits from feature/minify into master 2018-01-24 08:48:24 -05:00
4 changed files with 21 additions and 12 deletions

1
.gitignore vendored
View File

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

View File

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

View File

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

View File

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