From 285f65cbd2e55f6267a7df071719eccf76fe92fd Mon Sep 17 00:00:00 2001 From: Khaled Garbaya Date: Mon, 7 May 2018 22:23:19 +0200 Subject: [PATCH 1/2] docs: Add instruction about Angular 6 --- README.md | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/README.md b/README.md index ccaa82013..d377362e6 100644 --- a/README.md +++ b/README.md @@ -82,6 +82,40 @@ The Contentful Delivery SDK will be accessible via the `contentful` global varia Check the [releases](https://github.com/contentful/contentful.js/releases) page to know which versions are available. +### Angular 6: +For some unknow reason,for now, Angular 6 fail to compile with the SDK because it tries to pick the node disribution instead of the browser one, to fix that Make sure to add the following in your `tsconfig.json` file +```js +"paths":{ + "contentful": ["./node_modules/contentful/dist/contentful.browser.js"] + } +``` +your `tsconfig.json` should look like this + +```js +{ + "compileOnSave": false, + "compilerOptions": { + "baseUrl": "./", + "outDir": "./dist/out-tsc", + "sourceMap": true, + "declaration": false, + "moduleResolution": "node", + "emitDecoratorMetadata": true, + "experimentalDecorators": true, + "target": "es5", + "paths":{ + "contentful": ["./node_modules/contentful/dist/contentful.browser.js"] // add this + }, + "typeRoots": [ + "node_modules/@types" + ], + "lib": [ + "es2017", + "dom" + ] + } +} +``` ### Legacy browsers: This library also comes with a legacy version to support Internet Explorer 11 and other older browsers. It already contains a polyfill for Promises. From a021072d4fb37736f2e87251802cf3f3831f185e Mon Sep 17 00:00:00 2001 From: Khaled Garbaya Date: Tue, 8 May 2018 10:22:25 +0200 Subject: [PATCH 2/2] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index d377362e6..0144d6801 100644 --- a/README.md +++ b/README.md @@ -83,7 +83,7 @@ The Contentful Delivery SDK will be accessible via the `contentful` global varia Check the [releases](https://github.com/contentful/contentful.js/releases) page to know which versions are available. ### Angular 6: -For some unknow reason,for now, Angular 6 fail to compile with the SDK because it tries to pick the node disribution instead of the browser one, to fix that Make sure to add the following in your `tsconfig.json` file +Currently Angular 6 fail to compile with the SDK because it tries to pick the node disribution instead of the browser one, to fix that Make sure to add the following in your `tsconfig.json` file ```js "paths":{ "contentful": ["./node_modules/contentful/dist/contentful.browser.js"]