File tree 1 file changed +5
-4
lines changed
1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -9,11 +9,13 @@ const OPTIONS_TO_BUNDLE = [
9
9
"updateChecker" ,
10
10
] ;
11
11
12
- module . exports = function ( babel ) {
12
+ module . exports = function ( babel , options ) {
13
13
const { types : t } = babel ;
14
+ const configPath =
15
+ options . configPath ?? path . resolve ( process . cwd ( ) , "codepush.config.js" ) ;
14
16
15
17
// Load config and imports from `codepush.config.js`
16
- const { config, configImports, importedIdentifiers } = loadConfig ( ) ;
18
+ const { config, configImports, importedIdentifiers } = loadConfig ( configPath ) ;
17
19
18
20
// Helper to serialize config values to AST nodes
19
21
function serializeConfigToNode ( value ) {
@@ -58,8 +60,7 @@ module.exports = function (babel) {
58
60
throw new Error ( `Unsupported config value type: ${ typeof value } ` ) ;
59
61
}
60
62
61
- function loadConfig ( ) {
62
- const configPath = path . resolve ( process . cwd ( ) , "codepush.config.js" ) ;
63
+ function loadConfig ( configPath ) {
63
64
if ( ! fs . existsSync ( configPath ) ) {
64
65
throw new Error (
65
66
"codepush.config.js not found. Please ensure it exists in the root directory."
You can’t perform that action at this time.
0 commit comments