Lines Matching refs:plugin
2 title: 'Tutorial: Create a module with a config plugin'
3 sidebar_title: Create a module with a config plugin
4 description: A tutorial on creating a native module with a config plugin using Expo modules API.
11 …new config plugin from scratch and show you how to read custom values injected into **AndroidManif…
115 We should see a screen with a text saying `API key: api-key`. Now let's develop the plugin to injec…
117 ## 4. Creating a new config plugin
119 …plugin. Plugins are synchronous functions that accept an `ExpoConfig` and return a modified `ExpoC…
121 Here is an example of how a basic config plugin function looks:
136 …plugin development easier — it provides a recommended default configuration for TypeScript and Jes…
138 …plugin with this minimal boilerplate. This will create a **plugin** folder where we will write the…
140 1. Create a **plugin/tsconfig.json** file:
142 ```json plugin/tsconfig.json
144 "extends": "expo-module-scripts/tsconfig.plugin",
154 2. Create a **plugin/src/index.ts** file for our plugin:
156 ```typescript plugin/src/index.ts
160 console.log('my custom plugin');
167 3. Finally, create an **app.plugin.js** file in the root directory. That will configure the entry f…
169 ```javascript app.plugin.js
170 module.exports = require('./plugin/build');
173 …m run build plugin` to start the TypeScript compiler in watch mode. The only thing left to configu…
179 "plugins": ["../app.plugin.js"]
184 …xpo prebuild` inside our **example** folder we should see our 'my custom plugin’ console.log state…
222 We can create our custom plugin by merging everything into a single function:
224 ```typescript plugin/src/index.ts
255 Now with the plugin ready to be used, let's update the example app to pass our API key to the plugi…
261 "plugins": [["../app.plugin.js", { "apiKey": "custom_secret_api" }]]
266 …at the plugin is working correctly by running the command `npx expo prebuild --clean` inside the *…
318 '# execute our plugin and update native files',
329 Congratulations, you have created a simple yet non-trivial config plugin that interacts with an Exp…
331 …to challenge yourself and make the plugin more versatile we leave this exercise open to you. Try m…