-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support for re-exporting ES6 modules #11
Comments
Would be cool to support named exports tooSource code: https://unpkg.com/[email protected]/lib/index.js IN example: var ReactRelayContext = require("./ReactRelayContext");
var ReactRelayFragmentContainer = require("./ReactRelayFragmentContainer");
var ReactRelayPaginationContainer = require("./ReactRelayPaginationContainer");
var ReactRelayQueryRenderer = require("./ReactRelayQueryRenderer");
var ReactRelayRefetchContainer = require("./ReactRelayRefetchContainer");
var RelayRuntime = require("relay-runtime");
module.exports = {
QueryRenderer: ReactRelayQueryRenderer,
MutationTypes: RelayRuntime.MutationTypes,
RangeOperations: RelayRuntime.RangeOperations,
ReactRelayContext: ReactRelayContext,
applyOptimisticMutation: RelayRuntime.applyOptimisticMutation,
commitLocalUpdate: RelayRuntime.commitLocalUpdate,
commitMutation: RelayRuntime.commitMutation,
createFragmentContainer: ReactRelayFragmentContainer.createContainer,
createPaginationContainer: ReactRelayPaginationContainer.createContainer,
createRefetchContainer: ReactRelayRefetchContainer.createContainer,
fetchQuery: RelayRuntime.fetchQuery,
graphql: RelayRuntime.graphql,
requestSubscription: RelayRuntime.requestSubscription
}; OUT actual: import _relayRuntime from "relay-runtime";
import _ReactRelayRefetchContainer from "./ReactRelayRefetchContainer";
import _ReactRelayQueryRenderer from "./ReactRelayQueryRenderer";
import _ReactRelayPaginationContainer from "./ReactRelayPaginationContainer";
import _ReactRelayFragmentContainer from "./ReactRelayFragmentContainer";
import _ReactRelayContext from "./ReactRelayContext";
var module = {
exports: {}
};
var exports = module.exports;
var ReactRelayContext = _ReactRelayContext;
var ReactRelayFragmentContainer = _ReactRelayFragmentContainer;
var ReactRelayPaginationContainer = _ReactRelayPaginationContainer;
var ReactRelayQueryRenderer = _ReactRelayQueryRenderer;
var ReactRelayRefetchContainer = _ReactRelayRefetchContainer;
var RelayRuntime = _relayRuntime;
module.exports = {
QueryRenderer: ReactRelayQueryRenderer,
MutationTypes: RelayRuntime.MutationTypes,
RangeOperations: RelayRuntime.RangeOperations,
ReactRelayContext: ReactRelayContext,
applyOptimisticMutation: RelayRuntime.applyOptimisticMutation,
commitLocalUpdate: RelayRuntime.commitLocalUpdate,
commitMutation: RelayRuntime.commitMutation,
createFragmentContainer: ReactRelayFragmentContainer.createContainer,
createPaginationContainer: ReactRelayPaginationContainer.createContainer,
createRefetchContainer: ReactRelayRefetchContainer.createContainer,
fetchQuery: RelayRuntime.fetchQuery,
graphql: RelayRuntime.graphql,
requestSubscription: RelayRuntime.requestSubscription
};
export default module.exports; OUT expected: import _relayRuntime from "relay-runtime";
import _ReactRelayRefetchContainer from "./ReactRelayRefetchContainer";
import _ReactRelayQueryRenderer from "./ReactRelayQueryRenderer";
import _ReactRelayPaginationContainer from "./ReactRelayPaginationContainer";
import _ReactRelayFragmentContainer from "./ReactRelayFragmentContainer";
import _ReactRelayContext from "./ReactRelayContext";
var module = {
exports: {}
};
var exports = module.exports;
var ReactRelayContext = _ReactRelayContext;
var ReactRelayFragmentContainer = _ReactRelayFragmentContainer;
var ReactRelayPaginationContainer = _ReactRelayPaginationContainer;
var ReactRelayQueryRenderer = _ReactRelayQueryRenderer;
var ReactRelayRefetchContainer = _ReactRelayRefetchContainer;
var RelayRuntime = _relayRuntime;
module.exports = {
QueryRenderer: ReactRelayQueryRenderer,
MutationTypes: RelayRuntime.MutationTypes,
RangeOperations: RelayRuntime.RangeOperations,
ReactRelayContext: ReactRelayContext,
applyOptimisticMutation: RelayRuntime.applyOptimisticMutation,
commitLocalUpdate: RelayRuntime.commitLocalUpdate,
commitMutation: RelayRuntime.commitMutation,
createFragmentContainer: ReactRelayFragmentContainer.createContainer,
createPaginationContainer: ReactRelayPaginationContainer.createContainer,
createRefetchContainer: ReactRelayRefetchContainer.createContainer,
fetchQuery: RelayRuntime.fetchQuery,
graphql: RelayRuntime.graphql,
requestSubscription: RelayRuntime.requestSubscription
};
export const { // <====== NAMED EXPORTS ADDED
QueryRenderer,
MutationTypes,
RangeOperations,
ReactRelayContext,
applyOptimisticMutation,
commitLocalUpdate,
commitMutation,
createFragmentContainer,
createPaginationContainer,
createRefetchContainer,
fetchQuery,
graphql,
requestSubscription,
} = module.exports;
export default module.exports; Is it possible/doable? See also rollup-plugin-commonjs and its |
Any progress so far? |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
IN example:
OUT actual:
OUT expected:
Source Code: https://unpkg.com/[email protected]/index.js
The text was updated successfully, but these errors were encountered: