import { Resolver } from './resolver';
import cssvars from './salesforceCssvars';
import user from './salesforceUser';
import i18n from './salesforcei18n';
import client from './salesforceClient';

const salesforceResolver = new Resolver([
    ...(process.env.LWC_TARGET === 'es5' ? [cssvars] : []),
    user,
    i18n,
    client,
]);

/**
 * Resolves '@salesforce' resources.
 */
export default {
    scope: '@salesforce',

    resolve(resource) {
        return salesforceResolver.resolve(resource);
    },
};
