Skip to content

Commit

Permalink
chore: use package.json data
Browse files Browse the repository at this point in the history
  • Loading branch information
mzaien committed Mar 2, 2024
1 parent 6408828 commit 98d165c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
3 changes: 2 additions & 1 deletion build/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
const config_plugins_1 = require("@expo/config-plugins");
const fs_extra_1 = require("fs-extra");
const path = __importStar(require("path"));
const metaData = (0, fs_extra_1.readJsonSync)('./package.json');
function withCustomAssetsAndroid(config, props) {
// Specify the source directory of your assets
const assetSourceDir = props.assetsPath;
Expand Down Expand Up @@ -122,4 +123,4 @@ const withCustomAssets = (config, props) => {
config = withCustomAssetsAndroid(config, props);
return config;
};
exports.default = (0, config_plugins_1.createRunOncePlugin)(withCustomAssets, "expo-custom-assets", "1.2.1");
exports.default = (0, config_plugins_1.createRunOncePlugin)(withCustomAssets, metaData.name, metaData.version);
6 changes: 4 additions & 2 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,10 @@ import {
existsSync,
readFile,
writeFile,
readJsonSync
} from "fs-extra";
import * as path from "path";
const metaData = readJsonSync('./package.json');
function withCustomAssetsAndroid(
config: ExpoConfig,
props: { assetsPath: string }
Expand Down Expand Up @@ -152,6 +154,6 @@ const withCustomAssets: ConfigPlugin<{ assetsPath: string }> = (

export default createRunOncePlugin(
withCustomAssets,
"expo-custom-assets",
"1.2.1",
metaData.name,
metaData.version,
);

0 comments on commit 98d165c

Please sign in to comment.