mirror of
https://gitee.com/dcloud/uni-preset-vue
synced 2025-04-25 06:20:13 +08:00
add babel-plugin-console
This commit is contained in:
parent
35d8fd5537
commit
42419694f4
@ -35,7 +35,7 @@ module.exports = (api, options, rootOptions) => {
|
||||
api.extendPackage(pkg => {
|
||||
return {
|
||||
dependencies: {
|
||||
'regenerator-runtime':'^0.12.1'//锁定版本,避免高版本在小程序中出错
|
||||
'regenerator-runtime': '^0.12.1'// 锁定版本,避免高版本在小程序中出错
|
||||
}
|
||||
}
|
||||
})
|
||||
|
@ -1,4 +1,29 @@
|
||||
const plugins = []
|
||||
const plugins = []
|
||||
|
||||
if (process.env.UNI_PLATFORM === 'app-plus') {
|
||||
const path = require('path')
|
||||
|
||||
const isWin = /^win/.test(process.platform)
|
||||
|
||||
const normalizePath = path => (isWin ? path.replace(/\\/g, '/') : path)
|
||||
|
||||
const input = normalizePath(process.env.UNI_INPUT_DIR)
|
||||
try {
|
||||
plugins.push([
|
||||
require('@dcloudio/vue-cli-plugin-hbuilderx/packages/babel-plugin-console'),
|
||||
{
|
||||
file (file) {
|
||||
file = normalizePath(file)
|
||||
if (file.indexOf(input) === 0) {
|
||||
return path.relative(input, file)
|
||||
}
|
||||
return false
|
||||
}
|
||||
}
|
||||
])
|
||||
} catch (e) {}
|
||||
}
|
||||
|
||||
process.UNI_LIBRARIES = process.UNI_LIBRARIES || ['@dcloudio/uni-ui']
|
||||
process.UNI_LIBRARIES.forEach(libraryName => {
|
||||
plugins.push([
|
||||
|
Loading…
x
Reference in New Issue
Block a user