Skip to content
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

不支持babel插件babel-plugin-transform-export-default #959

Closed
twchn opened this issue Oct 29, 2018 · 2 comments
Closed

不支持babel插件babel-plugin-transform-export-default #959

twchn opened this issue Oct 29, 2018 · 2 comments
Assignees
Labels
enhancement New feature or request

Comments

@twchn
Copy link
Contributor

twchn commented Oct 29, 2018

问题描述
为了支持export v from 'mod'这种语法,手动引入babel-plugin-transform-export-default这个插件,发现仍旧编译失败

复现步骤

  1. 添加babel-plugin-transform-export-default依赖
  2. config/index.js里的plugins->babel->plugins字段中加入transform-export-default
  3. 编译报错

报错信息

错误  编译失败  src/store/index.js
{ SyntaxError: unknown: Unexpected token, expected { (1:7)
> 1 | export configureStore from './configureStore';
    |        ^

系统信息

  • 操作系统: mac OS Mojave
  • Taro 版本 [1.0.7]
  • Node.js 版本 [8.12.0]
  • 报错平台 [weapp]
@luckyadam luckyadam self-assigned this Oct 31, 2018
@luckyadam luckyadam added the enhancement New feature or request label Oct 31, 2018
@johanazhu
Copy link

解决了吗,同样的问题

@luckyadam
Copy link
Member

还没有

@luckyadam luckyadam assigned luckyadam and yuche and unassigned luckyadam Nov 18, 2018
@yuche yuche closed this as completed in c7f9f24 Apr 9, 2019
leidenglai added a commit to leidenglai/taro that referenced this issue Apr 10, 2019
* upstream/master: (166 commits)
  docs: fix doc error as issue NervJS#2543 (NervJS#2714)
  feat(components): 完善 Input, Button, Textarea, WebView, Swiper 组件的类型定义 (NervJS#2713)
  feat(taro-components): 更新 Video 组件的类型定义
  chore(taro-components): CommonEventFunction 支持传入 e.detail 的类型
  refactor(transformer): 测试环境也需要提醒无法使用 index 作为 key
  test(transformer): 增加使用 index 作为 key 的测试用例,  NervJS#2706
  feat(transformer): 支持 export * from * 语法, close NervJS#959 export v from 'mod' 会转换为两行代码: import v from 'mod' export {  v }
  feat(transformer): 支持 do expression,close NervJS#2589
  refactor(cli): 在 ts 模板中更换 eslint parser, close NervJS#2268
  fix(taro-cli): 更新微信小程序插件模板
  fix(transformer): 只有 props 为 key 时才进行 key 不得为 index 的警告 (NervJS#2705)
  chore(components): ci问题修复
  refactor(transformer): 对头条小程序的循环 ref 进行特殊处理
  chore(webpack-runner): 固定webpack-runner的依赖版本
  feat(h5): h5支持PullDownRefresh系列api
  feat(components): h5内置PullDownRefresh组件
  fix(taro-cli): 修复 taro init 插件模板
  test(transformer): 增加 typescript 测试用例,  NervJS#2699
  refactor(transformer):  只有 .tsx 才保留 JSX 声明,NervJS#2699
  fix(taro-tt): 修复字节跳动小程序循环 ref
  ...

# Conflicts:
#	packages/taro-cli/templates/mobx/globaldts
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants