Skip to content

Commit

Permalink
corrected TypeORM version with webpack change
Browse files Browse the repository at this point in the history
  • Loading branch information
daniel-lang committed Dec 1, 2017
1 parent 8be1b22 commit 4821ce5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
You can use TypeORM in connection with the `cordova-sqlite-storage` plugin in your Ionic app.
This project demonstrates how that would work.

## TypeORM >= 0.1.8
## TypeORM >= 0.1.7
To support webpack builds outside of Ionic we had to remove the automatic selection of the correct TypeORM version (the `typeorm` package comes with a Node and a browser version). In order to keep using TypeORM with Ionic you have to create a custom `webpack.config.js` file. This example contains one that is identical to the one Ionic uses when no config file is specified but adds the `NormalModuleReplacementPlugin` to select the correct version.
If you already have a custom webpack config file you have to add these lines to your plugins (for both development and production):
```js
Expand Down Expand Up @@ -33,7 +33,7 @@ If you don't use a custom wepack config, copy the one from this example and add
2. Install TypeORM: `npm install typeorm --save`
3. Install node.js-Types: `npm install @types/node --save-dev`
4. Add `"typeRoots": ["node_modules/@types"]` to your `tsconfig.json` under `compilerOptions`
5. Create a custom webpack config file like the one [included in this project](config/webpack.config.js) to use the correct TypeORM version and add the config file to your [`package.json`](package.json#L12-14) (Required with TypeORM >= 0.1.8)
5. Create a custom webpack config file like the one [included in this project](config/webpack.config.js) to use the correct TypeORM version and add the config file to your [`package.json`](package.json#L12-14) (Required with TypeORM >= 0.1.7)

### Limitations to TypeORM when using production builds
Since Ionic make a lot of optimizations when building for productions, the following limitations occur
Expand Down

0 comments on commit 4821ce5

Please sign in to comment.