编译成百度小程序,分包无法访问
-
@htf123 问:
跟直接用百度小程序分包生成的文件一样,用百度小程序生成的文件可以访问。taro编译成的百度小程序pages主包可以访问,分包编译的时候都没有编译,访问不了。
app.js
import '@tarojs/async-await' import Taro, { Component } from '@tarojs/taro' import { Provider } from '@tarojs/redux' import Index from './pages/index/index' import configStore from './store' import './app.scss' // 如果需要在 h5 环境中开启 React Devtools // 取消以下注释: // if (process.env.NODE_ENV !== 'production' && process.env.TARO_ENV === 'h5') { // require('nerv-devtools') // } const store = configStore() class App extends Component { config = { pages: [ 'pages/index/index', 'pages/other/other' ], subpackages: [ { root: 'subpackage', pages: [ 'demo/demo', ] } ], window: { backgroundTextStyle: 'light', navigationBarBackgroundColor: '#fff', navigationBarTitleText: 'WeChat', navigationBarTextStyle: 'black' } } componentDidMount () {} componentDidShow () {} componentDidHide () {} componentCatchError () {} componentDidCatchError () {} // 在 App 类中的 render() 函数没有实际作用 // 请勿修改此函数 render () { return ( ) } } Taro.render(, document.getElementById('app'))
@隔壁老李答:
字段用 subPackages 试试
@htf123 答:
可以了大神,蟹蟹。可是为什么微信的文档写的是subpackage,小写的,代码里写大写,编译成大写的也好使。之前跟着微信的来,复制粘贴的。
@隔壁老李答:
微信是大小写都行,但是百度只能大写,就统一写大写吧