typeorm / ionic-example

Example project to demonstrate TypeORM in an Ionic app
67 stars 56 forks source link

[Question] Can I add module replacement plugin to the only case of ionic cordova build, not every build? #18

Closed JeongJun-Lee closed 6 years ago

JeongJun-Lee commented 6 years ago

Hello Daniel,

I wonder it's possible to add below plugin to the only case of ionic cordova build, not every build. I want to make a conditional build by some flag to distinguish between them. But I can't find it.

new webpack.NormalModuleReplacementPlugin(/typeorm$/, function (result) { result.request = result.request.replace(/typeorm/, "typeorm/browser"); })

Thanks, JJ

daniel-lang commented 6 years ago

As far as I know, you can't differentiate between builds for a device or "normal" builds. The only option would be to change the config depending on development vs. production build as defined in webpack.config.js.