Skip to content

Import * as Transport/Utils, then export#33

Closed
jackbmccarthy wants to merge 1 commit into
appy-one:masterfrom
jackbmccarthy:patch-1
Closed

Import * as Transport/Utils, then export#33
jackbmccarthy wants to merge 1 commit into
appy-one:masterfrom
jackbmccarthy:patch-1

Conversation

@jackbmccarthy
Copy link
Copy Markdown

This is a minor change, I am using Acebase in an Expo project, but the bundler doesn't support the "export * as NAME from './file'" syntax. This change would make it so that Expo would be able to use acebase-client, without needing to change the node_modules folder manually.

This is a minor change, I am using Acebase in an Expo project, but the bundler doesn't support the "export * as NAME from './file'" syntax. This change would make it so that Expo would be able to use acebase-client, without needing to change the node_modules folder manually.
@appy-one
Copy link
Copy Markdown
Owner

@jackbmccarthy Although this is a small change, have you considered bringing this to the attention of the bundler's team? Sounds like something they should fix instead of the authors of all possible packages you might be bundling!

@appy-one
Copy link
Copy Markdown
Owner

appy-one commented Feb 13, 2023

Just came across this again, maybe you are using an older TypeScript version than 3.8?

See https://www.typescriptlang.org/docs/handbook/modules.html#export-all-as-x ("With TypeScript 3.8, you can use export * as ns as a shorthand for re-exporting another module with a name")

@jackbmccarthy
Copy link
Copy Markdown
Author

The issue is that the Babel Presets used for Expo doesn't support that syntax.
I was able to get it to work by importing the plugin for this. @babel/plugin-proposal-export-namespace-from

module.exports = function(api) {
  api.cache(true);
  return {
    presets: ['babel-preset-expo'],
    plugins: ["@babel/plugin-proposal-export-namespace-from",]
  };
};

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants