Skip to content

Commit

Permalink
Seperate entrypoint for ExpoSQLiteAdapter
Browse files Browse the repository at this point in the history
  • Loading branch information
chintannp committed Mar 7, 2022
1 parent 07f16c0 commit 26bed3c
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 3 deletions.
7 changes: 7 additions & 0 deletions packages/datastore-storage-adapter/ExpoSQLiteAdapter.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
'use strict';

if (process.env.NODE_ENV === 'production') {
module.exports = require('./dist/aws-amplify-datastore-storage-adapter-expo.min.js');
} else {
module.exports = require('./dist/aws-amplify-datastore-storage-adapter-expo.js');
}
4 changes: 1 addition & 3 deletions packages/datastore-storage-adapter/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@
import ExpoSQLiteAdapter from './ExpoSQLiteAdapter/ExpoSQLiteAdapter';
import SQLiteAdapter from './SQLiteAdapter/SQLiteAdapter';
export { SQLiteAdapter, ExpoSQLiteAdapter };
export { default as SQLiteAdapter } from './SQLiteAdapter/SQLiteAdapter';
2 changes: 2 additions & 0 deletions packages/datastore-storage-adapter/webpack.config.dev.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,7 @@ var config = require('./webpack.config.js');

var entry = {
'aws-amplify-datastore-storage-adapter': './lib-esm/index.js',
'aws-amplify-datastore-storage-adapter-expo':
'./lib-esm/ExpoSQLiteAdapter/ExpoSQLiteAdapter.js',
};
module.exports = Object.assign(config, { entry, mode: 'development' });
2 changes: 2 additions & 0 deletions packages/datastore-storage-adapter/webpack.config.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
module.exports = {
entry: {
'aws-amplify-datastore-storage-adapter.min': './lib-esm/index.js',
'aws-amplify-datastore-storage-adapter-expo.min':
'./lib-esm/ExpoSQLiteAdapter/ExpoSQLiteAdapter.js',
},
externals: [
'@aws-amplify/datastore',
Expand Down

0 comments on commit 26bed3c

Please sign in to comment.