Skip to content

Commit

Permalink
fix(rn): 生成的 index 入口的 entryFileName 带文件后缀导致 ts 模版启动异常
Browse files Browse the repository at this point in the history
  • Loading branch information
Pines-Cheng committed Mar 22, 2019
1 parent ea113a9 commit 7791edb
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/taro-cli/src/rn.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ const tempDir = '.rn_temp'
const tempPath = path.join(appPath, tempDir)
const entryFilePath = Util.resolveScriptPath(path.join(sourceDir, CONFIG.ENTRY))
const entryFileName = path.basename(entryFilePath)
const entryBaseName = path.basename(entryFilePath, path.extname(entryFileName))
const pluginsConfig = projectConfig.plugins || {}

const pkgPath = path.join(__dirname, './rn/pkg')
Expand Down Expand Up @@ -101,7 +102,7 @@ function initProjectFile () {

const indexJsStr = `
import {AppRegistry} from 'react-native';
import App from './${entryFileName}';
import App from './${entryBaseName}';
import {name as appName} from './app.json';
AppRegistry.registerComponent(appName, () => App);`
Expand Down

0 comments on commit 7791edb

Please sign in to comment.