How to use the @dcloudio/uni-cli-shared.getPlatforms function in @dcloudio/uni-cli-shared

To help you get started, we’ve selected a few @dcloudio/uni-cli-shared examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github dcloudio / uni-app / packages / webpack-uni-pages-loader / lib / platforms / h5.js View on Github external
const fs = require('fs')
const path = require('path')

const {
  getPlatforms,
  getH5Options,
  getFlexDirection,
  getNetworkTimeout
} = require('@dcloudio/uni-cli-shared')

const PLATFORMS = getPlatforms()

const isWin = /^win/.test(process.platform)
const normalizePath = path => (isWin ? path.replace(/\\/g, '/') : path)

const removePlatformStyle = function (style) {
  Object.keys(style).forEach(name => {
    if (PLATFORMS.includes(name)) {
      delete style[name]
    }
  })
}

const getPageComponents = function (inputDir, pagesJson) {
  const firstPagePath = pagesJson.pages[0].path
  const pages = pagesJson.pages
github dcloudio / uni-app / packages / webpack-uni-pages-loader / lib / util.js View on Github external
const path = require('path')

const {
  getPlatforms,
  normalizePath
} = require('@dcloudio/uni-cli-shared')

const PLATFORMS = getPlatforms()

const alipayWindowMap = {
  'defaultTitle': 'navigationBarTitleText',
  'pullRefresh': 'enablePullDownRefresh',
  'allowsBounceVertical': 'allowsBounceVertical',
  'titleBarColor': 'navigationBarBackgroundColor',
  'optionMenu': 'optionMenu',
  'backgroundColor': 'backgroundColor',
  'usingComponents': 'usingComponents',
  'navigationBarShadow': 'navigationBarShadow',
  'titleImage': 'titleImage',
  'transparentTitle': 'transparentTitle',
  'titlePenetrate': 'titlePenetrate'
}

const alipayTabBarMap = {