Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@dcloudio/uni-cli-shared

Package Overview
Dependencies
Maintainers
6
Versions
1745
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@dcloudio/uni-cli-shared - npm Package Compare versions

Comparing version 0.2.965 to 0.2.966

6

lib/index.js

@@ -32,4 +32,3 @@ const tags = require('./tags')

getComponentName,
convertStaticStyle,
devtoolModuleFilenameTemplate
convertStaticStyle
} = require('./util')

@@ -58,3 +57,4 @@

nvueJsPreprocessOptions,
nvueHtmlPreprocessOptions
nvueHtmlPreprocessOptions,
devtoolModuleFilenameTemplate
} = require('./platform')

@@ -61,0 +61,0 @@

const fs = require('fs')
const path = require('path')
const {
normalizePath
} = require('./util')
const uniRuntime = '@dcloudio/vue-cli-plugin-uni/packages/mp-vue'

@@ -174,2 +178,56 @@ const mpvueRuntime = '@dcloudio/vue-cli-plugin-uni/packages/mpvue'

}
let sourceRoot = false
function devtoolModuleFilenameTemplate (info) {
if (!sourceRoot) {
if (isInHBuilderX) {
sourceRoot = normalizePath(process.env.UNI_INPUT_DIR)
} else {
sourceRoot = normalizePath(process.env.UNI_CLI_CONTEXT)
}
}
let filePath = false
const absoluteResourcePath = normalizePath(info.absoluteResourcePath)
if (
absoluteResourcePath.indexOf(sourceRoot) !== -1 &&
(
absoluteResourcePath.endsWith('.js') ||
absoluteResourcePath.endsWith('.ts')
)
) {
filePath = normalizePath(path.relative(sourceRoot, absoluteResourcePath))
if (
filePath.indexOf('node_modules/@dcloudio') === 0 ||
filePath.indexOf('node_modules/vue-loader') === 0 ||
filePath.indexOf('node_modules/webpack') === 0
) {
filePath = false
}
} else if (
!info.moduleId &&
(
absoluteResourcePath.endsWith('.vue') ||
absoluteResourcePath.endsWith('.nvue')
)
) {
if (
absoluteResourcePath.indexOf('src') !== 0 &&
absoluteResourcePath.indexOf('node-modules') !== 0
) {
filePath = normalizePath(path.relative(sourceRoot, absoluteResourcePath))
} else {
filePath = absoluteResourcePath
}
}
if (
filePath &&
filePath !== 'main.js' &&
filePath !== 'main.ts' &&
filePath !== 'src/main.js' &&
filePath !== 'src/main.ts'
) {
return `uni-app:///${filePath}`
}
}
module.exports = {

@@ -179,2 +237,3 @@ isInHBuilderX,

runByHBuilderX: isInHBuilderX || !!process.env.UNI_HBUILDERX_PLUGINS,
devtoolModuleFilenameTemplate,
jsPreprocessOptions: {

@@ -181,0 +240,0 @@ type: 'js',

@@ -90,4 +90,2 @@ const path = require('path')

let sourceRoot = false
module.exports = {

@@ -121,29 +119,3 @@ md5,

return str
}),
devtoolModuleFilenameTemplate (info) {
if (!sourceRoot) {
sourceRoot = normalizePath(process.env.UNI_INPUT_DIR)
}
let needSourceMap = false
const absoluteResourcePath = normalizePath(info.absoluteResourcePath)
if (absoluteResourcePath.indexOf(sourceRoot) !== -1) {
if (absoluteResourcePath.endsWith('.js')) {
needSourceMap = true
} else if (
!info.moduleId &&
(
absoluteResourcePath.endsWith('.vue') ||
absoluteResourcePath.endsWith('.nvue')
)
) {
needSourceMap = true
}
}
if (needSourceMap) {
const filePath = normalizePath(path.relative(sourceRoot, absoluteResourcePath))
if (filePath !== 'main.js') {
return `uni-app:///${filePath}`
}
}
}
})
}
{
"name": "@dcloudio/uni-cli-shared",
"version": "0.2.965",
"version": "0.2.966",
"description": "uni-cli-shared",

@@ -5,0 +5,0 @@ "main": "lib/index.js",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc