fix(aio): use locally hosted lunr library

The library is downloaded from npm but then
copied into the assets folder (and ignored by git)
as part of the postinstall step.
This commit is contained in:
Peter Bacon Darwin 2017-06-12 21:51:41 +01:00 committed by Pete Bacon Darwin
parent 0a846a2fce
commit 0f56296c24
5 changed files with 30 additions and 31 deletions

3
aio/.gitignore vendored
View File

@ -43,3 +43,6 @@ protractor-results*.txt
# System Files
.DS_Store
Thumbs.db
# copied dependencies
src/assets/js/lunr*

View File

@ -5,8 +5,7 @@
{"url": "https://fonts.gstatic.com/s/droidsansmono/v7/ns-m2xQYezAtqh7ai59hJYdJ2JT0J65PSe7wdxAnx_I.woff2"},
{"url": "https://fonts.googleapis.com/icon?family=Material+Icons"},
{"url": "https://fonts.gstatic.com/s/materialicons/v22/2fcrYFNaTjcS6g4U3t-Y5ZjZjT5FdEJ140U2DJYC3mY.woff2"},
{"url": "https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css"},
{"url": "https://unpkg.com/lunr@0.7.2/lunr.min.js"}
{"url": "https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css"}
]
},
"static.ignore": [

View File

@ -35,7 +35,7 @@
"generate-zips": "node ./tools/example-zipper/generateZips",
"sw-manifest": "ngu-sw-manifest --dist dist --in ngsw-manifest.json --out dist/ngsw-manifest.json",
"sw-copy": "cp node_modules/@angular/service-worker/bundles/worker-basic.min.js dist/",
"postinstall": "node tools/cli-patches/patch.js",
"postinstall": "node tools/cli-patches/patch.js && uglifyjs node_modules/lunr/lunr.js -c -m -o src/assets/js/lunr.min.js --source-map",
"build-ie-polyfills": "node node_modules/webpack/bin/webpack.js -p src/ie-polyfills.js src/generated/ie-polyfills.min.js"
},
"private": true,
@ -97,6 +97,7 @@
"karma-jasmine-html-reporter": "^0.2.2",
"lighthouse": "^1.6.3",
"lodash": "^4.17.4",
"lunr": "^2.1.0",
"protractor": "~5.1.0",
"rehype": "^4.0.0",
"rehype-autolink-headings": "^2.0.0",
@ -109,6 +110,7 @@
"ts-node": "~2.0.0",
"tslint": "~4.5.0",
"typescript": "2.3.2",
"uglify-js": "^3.0.15",
"unist-util-filter": "^0.2.1",
"unist-util-source": "^1.0.1",
"unist-util-visit": "^1.1.1",

View File

@ -6,7 +6,7 @@
var SEARCH_TERMS_URL = '/generated/docs/app/search-data.json';
// NOTE: This needs to be kept in sync with `ngsw-manifest.json`.
importScripts('https://unpkg.com/lunr@2.1.0/lunr.js');
importScripts('/assets/js/lunr.min.js');
var index;
var pages = {};

View File

@ -1290,7 +1290,7 @@ commander@2.6.0:
version "2.6.0"
resolved "https://registry.yarnpkg.com/commander/-/commander-2.6.0.tgz#9df7e52fb2a0cb0fb89058ee80c3104225f37e1d"
commander@2.9.x, commander@^2.8.1:
commander@2.9.x, commander@^2.8.1, commander@~2.9.0:
version "2.9.0"
resolved "https://registry.yarnpkg.com/commander/-/commander-2.9.0.tgz#9c99094176e12240cb22d6c5146098400fe0f7d4"
dependencies:
@ -1784,13 +1784,7 @@ date-now@^0.1.4:
version "0.1.4"
resolved "https://registry.yarnpkg.com/date-now/-/date-now-0.1.4.tgz#eaf439fd4d4848ad74e5cc7dbef200672b9e345b"
debug@*, debug@^2.1.1, debug@^2.1.3, debug@^2.2.0:
version "2.6.6"
resolved "https://registry.yarnpkg.com/debug/-/debug-2.6.6.tgz#a9fa6fbe9ca43cf1e79f73b75c0189cbb7d6db5a"
dependencies:
ms "0.7.3"
debug@2, debug@2.6.7, debug@^2.6.3:
debug@*, debug@2, debug@2.6.7, debug@^2.1.3, debug@^2.2.0, debug@^2.6.3:
version "2.6.7"
resolved "https://registry.yarnpkg.com/debug/-/debug-2.6.7.tgz#92bad1f6d05bbb6bba22cca88bcd0ec894c2861e"
dependencies:
@ -1820,6 +1814,12 @@ debug@2.6.3:
dependencies:
ms "0.7.2"
debug@^2.1.1:
version "2.6.6"
resolved "https://registry.yarnpkg.com/debug/-/debug-2.6.6.tgz#a9fa6fbe9ca43cf1e79f73b75c0189cbb7d6db5a"
dependencies:
ms "0.7.3"
decamelize@^1.0.0, decamelize@^1.1.1, decamelize@^1.1.2:
version "1.2.0"
resolved "https://registry.yarnpkg.com/decamelize/-/decamelize-1.2.0.tgz#f6534d15148269b20352e7bee26f501f9a191290"
@ -3813,7 +3813,7 @@ istanbul-instrumenter-loader@^2.0.0:
loader-utils "^0.2.16"
object-assign "^4.1.0"
istanbul-lib-coverage@^1.1.0, istanbul-lib-coverage@^1.1.1:
istanbul-lib-coverage@^1.1.1:
version "1.1.1"
resolved "https://registry.yarnpkg.com/istanbul-lib-coverage/-/istanbul-lib-coverage-1.1.1.tgz#73bfb998885299415c93d38a3e9adf784a77a9da"
@ -3823,19 +3823,7 @@ istanbul-lib-hook@^1.0.7:
dependencies:
append-transform "^0.4.0"
istanbul-lib-instrument@^1.1.3:
version "1.7.1"
resolved "https://registry.yarnpkg.com/istanbul-lib-instrument/-/istanbul-lib-instrument-1.7.1.tgz#169e31bc62c778851a99439dd99c3cc12184d360"
dependencies:
babel-generator "^6.18.0"
babel-template "^6.16.0"
babel-traverse "^6.18.0"
babel-types "^6.18.0"
babylon "^6.13.0"
istanbul-lib-coverage "^1.1.0"
semver "^5.3.0"
istanbul-lib-instrument@^1.7.2:
istanbul-lib-instrument@^1.1.3, istanbul-lib-instrument@^1.7.2:
version "1.7.2"
resolved "https://registry.yarnpkg.com/istanbul-lib-instrument/-/istanbul-lib-instrument-1.7.2.tgz#6014b03d3470fb77638d5802508c255c06312e56"
dependencies:
@ -3872,14 +3860,10 @@ istanbul-reports@^1.1.1:
dependencies:
handlebars "^4.0.3"
jasmine-core@^2.6.3:
jasmine-core@^2.6.3, jasmine-core@~2.6.0:
version "2.6.3"
resolved "https://registry.yarnpkg.com/jasmine-core/-/jasmine-core-2.6.3.tgz#45072950e4a42b1e322fe55c001100a465d77815"
jasmine-core@~2.6.0:
version "2.6.1"
resolved "https://registry.yarnpkg.com/jasmine-core/-/jasmine-core-2.6.1.tgz#66a61cddb699958e3613edef346c996f6311fc3b"
jasmine-spec-reporter@^4.1.0:
version "4.1.0"
resolved "https://registry.yarnpkg.com/jasmine-spec-reporter/-/jasmine-spec-reporter-4.1.0.tgz#b8aa7584df58e4dab61acdbefb76d096aa38663f"
@ -4437,6 +4421,10 @@ lru-cache@^4.0.0, lru-cache@^4.0.1:
pseudomap "^1.0.1"
yallist "^2.0.0"
lunr@^2.1.0:
version "2.1.0"
resolved "https://registry.yarnpkg.com/lunr/-/lunr-2.1.0.tgz#5e0308137de2c720a1653f28fedd4edc14d2a9a5"
macaddress@^0.2.8:
version "0.2.8"
resolved "https://registry.yarnpkg.com/macaddress/-/macaddress-0.2.8.tgz#5904dc537c39ec6dbefeae902327135fa8511f12"
@ -7218,6 +7206,13 @@ uglify-js@^2.6, uglify-js@^2.8.27, uglify-js@~2.8.22:
optionalDependencies:
uglify-to-browserify "~1.0.0"
uglify-js@^3.0.15:
version "3.0.15"
resolved "https://registry.yarnpkg.com/uglify-js/-/uglify-js-3.0.15.tgz#aacb323a846b234602270dead8a32441a8806f42"
dependencies:
commander "~2.9.0"
source-map "~0.5.1"
uglify-js@~2.3:
version "2.3.6"
resolved "https://registry.yarnpkg.com/uglify-js/-/uglify-js-2.3.6.tgz#fa0984770b428b7a9b2a8058f46355d14fef211a"