diff --git a/aio/.gitignore b/aio/.gitignore index 4790f4f2f7..901c8f7359 100644 --- a/aio/.gitignore +++ b/aio/.gitignore @@ -44,6 +44,3 @@ protractor-results*.txt # System Files .DS_Store Thumbs.db - -# copied dependencies -src/assets/js/lunr* diff --git a/aio/README.md b/aio/README.md index a6fef940cd..18af4b96aa 100644 --- a/aio/README.md +++ b/aio/README.md @@ -41,8 +41,6 @@ Here are the most important tasks you might need to use: - `yarn example-e2e --filter=foo` - limit e2e tests to those containing the word "foo" - `yarn example-e2e --setup --local` - run e2e tests with the local version of Angular contained in the "dist" folder -* `yarn build-ie-polyfills` - generates a js file of polyfills that can be loaded in Internet Explorer. - ## Developing on Windows The `packages/` directory may contain Linux-specific symlinks, which are not recognized by Windows. These unresolved links cause the docs generation process to fail because it cannot locate certain files. @@ -50,7 +48,7 @@ These unresolved links cause the docs generation process to fail because it cann > Hint: The following steps require administration rights or [Windows Developer Mode](https://docs.microsoft.com/en-us/windows/uwp/get-started/enable-your-device-for-development) enabled! To fix this problem, run `scripts/windows/create-symlinks.sh`. This command creates temporary files where the symlinks used to be. Make sure not to commit those files with your documentation changes. -When you are done making and testing your documentation changes, you can restore the original symlinks and delete the temporary files by running `scripts/windows/remove-symlinks.sh`. +When you are done making and testing your documentation changes, you can restore the original symlinks and delete the temporary files by running `scripts/windows/remove-symlinks.sh`. It's necessary to remove the temporary files, because otherwise they're displayed as local changes in your git working copy and certain operations are blocked. diff --git a/aio/ngsw-config.json b/aio/ngsw-config.json index 8472b21b21..90b0ad2d04 100644 --- a/aio/ngsw-config.json +++ b/aio/ngsw-config.json @@ -12,6 +12,7 @@ "/app/search/search-worker.js", "/assets/images/favicons/favicon.ico", "/assets/js/*.js", + "/generated/lunr.min.js", "/*.css", "/*.js" ], diff --git a/aio/package.json b/aio/package.json index 69c51c1196..63a509b464 100644 --- a/aio/package.json +++ b/aio/package.json @@ -7,7 +7,7 @@ "license": "MIT", "scripts": { "preinstall": "node ../tools/yarn/check-yarn.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", + "postinstall": "node tools/cli-patches/patch.js", "aio-use-local": "node tools/ng-packages-installer overwrite . --debug", "aio-use-npm": "node tools/ng-packages-installer restore .", "aio-check-local": "node tools/ng-packages-installer check .", @@ -25,7 +25,7 @@ "e2e": "ng e2e --no-webdriver-update", "presetup": "yarn --cwd .. install && yarn install --frozen-lockfile && yarn ~~check-env && yarn ~~clean-generated && yarn boilerplate:remove", "setup": "yarn aio-use-npm && yarn example-use-npm", - "postsetup": "yarn boilerplate:add && yarn build-ie-polyfills && yarn extract-cli-command-docs && yarn docs", + "postsetup": "yarn ~~build-ie-polyfills && yarn ~~minify-lunr && yarn boilerplate:add && yarn extract-cli-command-docs && yarn docs", "presetup-local": "yarn presetup", "setup-local": "yarn aio-use-local && yarn example-use-local", "postsetup-local": "yarn postsetup", @@ -61,13 +61,14 @@ "generate-stackblitz": "node ./tools/stackblitz-builder/generateStackblitz", "generate-zips": "node ./tools/example-zipper/generateZips", "build-404-page": "node scripts/build-404-page", - "build-ie-polyfills": "yarn webpack-cli src/ie-polyfills.js -o src/generated/ie-polyfills.min.js --mode production", "update-webdriver": "webdriver-manager update --standalone false --gecko false $CHROMEDRIVER_VERSION_ARG", "~~check-env": "node scripts/check-environment", "~~clean-generated": "node --eval \"require('shelljs').rm('-rf', 'src/generated')\"", "~~build": "ng build", "post~~build": "yarn build-404-page", - "~~http-server": "http-server" + "~~build-ie-polyfills": "webpack-cli src/ie-polyfills.js -o src/generated/ie-polyfills.min.js --mode production", + "~~http-server": "http-server", + "~~minify-lunr": "uglifyjs node_modules/lunr/lunr.js -c -m -o src/generated/lunr.min.js --source-map" }, "engines": { "node": ">=10.9.0 <11.0.0", diff --git a/aio/src/app/search/search-worker.js b/aio/src/app/search/search-worker.js index 77859b7c66..c47dabd82d 100644 --- a/aio/src/app/search/search-worker.js +++ b/aio/src/app/search/search-worker.js @@ -6,7 +6,7 @@ var SEARCH_TERMS_URL = '/generated/docs/app/search-data.json'; // NOTE: This needs to be kept in sync with `ngsw-config.json`. -importScripts('/assets/js/lunr.min.js'); +importScripts('/generated/lunr.min.js'); var index; var pages /* : SearchInfo */ = {};