react-native-jsonc-asset-plugin
v0.0.1
Published
Asset plugin for compress jsonc in React Native
Downloads
4
Maintainers
Readme
react-native-jsonc-asset-plugin
Usage
Step 1: Install
yarn add -D react-native-jsonc-asset-plugin
or
npm install --save-dev react-native-jsonc-asset-plugin
Step 2: Configure metro.config.js
For example;
const {getDefaultConfig} = require('metro-config');
module.exports = (async () => {
const {resolver: {assetExts}} = await getDefaultConfig();
return {
resolver: {
assetExts: [...assetExts, 'jsonc', 'json5'],
},
transformer: {
getTransformOptions: async () => ({
transform: {
inlineRequires: true,
experimentalImportSupport: false,
},
}),
assetPlugins: ['react-native-jsonc-asset-plugin'],
jsoncAssetPlugin: {
test: /\.(jsonc|json5)$/,
tempDir: '.jsonc',
},
},
};
})();