How to use the @dcloudio/uni-cli-shared.getShadowCss 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-mp-loader / lib / plugin / generate-app.js View on Github external
process.env.NODE_ENV === 'production' &&
    process.env.UNI_PLATFORM !== 'app-plus'
  ) {
    const targetCssName = `common/main${ext}`

    if (!compilation.assets[targetCssName]) {
      compilation.assets[targetCssName] = {
        size () {
          return Buffer.byteLength(getShadowCss(), 'utf8')
        },
        source () {
          return getShadowCss()
        }
      }
    } else {
      const source = compilation.assets[targetCssName].source() + getShadowCss()
      compilation.assets[targetCssName] = {
        size () {
          return Buffer.byteLength(source, 'utf8')
        },
        source () {
          return source
        }
      }
    }
  }

  if (compilation.assets[`common/main${ext}`]) { // 是否存在 main.css
    importMainCss = `@import './common/main${ext}';`
  }

  if (compilation.assets[`common/vendor${ext}`]) { // 是否存在 vendor.css
github dcloudio / uni-app / packages / webpack-uni-mp-loader / lib / plugin / generate-app.js View on Github external
size () {
          return Buffer.byteLength(getShadowCss(), 'utf8')
        },
        source () {