Skip to content

Commit 98d165c

Browse files
committed
chore: use package.json data
1 parent 6408828 commit 98d165c

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

build/index.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
2626
const config_plugins_1 = require("@expo/config-plugins");
2727
const fs_extra_1 = require("fs-extra");
2828
const path = __importStar(require("path"));
29+
const metaData = (0, fs_extra_1.readJsonSync)('./package.json');
2930
function withCustomAssetsAndroid(config, props) {
3031
// Specify the source directory of your assets
3132
const assetSourceDir = props.assetsPath;
@@ -122,4 +123,4 @@ const withCustomAssets = (config, props) => {
122123
config = withCustomAssetsAndroid(config, props);
123124
return config;
124125
};
125-
exports.default = (0, config_plugins_1.createRunOncePlugin)(withCustomAssets, "expo-custom-assets", "1.2.1");
126+
exports.default = (0, config_plugins_1.createRunOncePlugin)(withCustomAssets, metaData.name, metaData.version);

src/index.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,10 @@ import {
1313
existsSync,
1414
readFile,
1515
writeFile,
16+
readJsonSync
1617
} from "fs-extra";
1718
import * as path from "path";
19+
const metaData = readJsonSync('./package.json');
1820
function withCustomAssetsAndroid(
1921
config: ExpoConfig,
2022
props: { assetsPath: string }
@@ -152,6 +154,6 @@ const withCustomAssets: ConfigPlugin<{ assetsPath: string }> = (
152154

153155
export default createRunOncePlugin(
154156
withCustomAssets,
155-
"expo-custom-assets",
156-
"1.2.1",
157+
metaData.name,
158+
metaData.version,
157159
);

0 commit comments

Comments
 (0)