Package Exports
- react-native-jsonc-asset-plugin
- react-native-jsonc-asset-plugin/index.js
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (react-native-jsonc-asset-plugin) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
react-native-jsonc-asset-plugin
Usage
Step 1: Install
yarn add -D react-native-jsonc-asset-pluginor
npm install --save-dev react-native-jsonc-asset-pluginStep 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',
},
},
};
})();