Skip to content

Commit

Permalink
feat(cli): 添加第三方包browser入口支持
Browse files Browse the repository at this point in the history
  • Loading branch information
WingGao committed Sep 5, 2019
1 parent 94a6e19 commit 72fce03
Show file tree
Hide file tree
Showing 3 changed files with 154 additions and 86 deletions.
4 changes: 2 additions & 2 deletions packages/taro-cli/src/mini/compileStyle.ts
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ async function processStyleWithPostCSS (styleObj: IStyleObj): Promise<string> {
if (!isNpmPkg(pluginName)) { // local plugin
pluginName = path.join(appPath, pluginName)
}
processors.push(require(resolveNpmPkgMainPath(pluginName, isProduction, npmConfig, buildAdapter, appPath))(pluginConf.config || {}))
processors.push(require(resolveNpmPkgMainPath(pluginName, isProduction, npmConfig, buildAdapter, appPath).main)(pluginConf.config || {}))
}
}
})
Expand Down Expand Up @@ -297,7 +297,7 @@ export function compileDepStyles (outputFilePath: string, styleFiles: string[])
resContent = transformStyle
}
}

fs.ensureDirSync(path.dirname(outputFilePath))
fs.writeFileSync(outputFilePath, resContent)
})
Expand Down
2 changes: 1 addition & 1 deletion packages/taro-cli/src/mini/helper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ export function getRealComponentsPathList (
}
if (isNpmPkg(componentPath as string)) {
try {
componentPath = resolveNpmPkgMainPath(componentPath as string, isProduction, npmConfig, buildAdapter, appPath)
componentPath = resolveNpmPkgMainPath(componentPath as string, isProduction, npmConfig, buildAdapter, appPath).main
} catch (err) {
console.log(err)
}
Expand Down
Loading

0 comments on commit 72fce03

Please sign in to comment.