mirror of
https://gitee.com/dcloud/uni-preset-vue
synced 2025-04-11 16:23:06 +08:00
feat: support @vue/cli@5
This commit is contained in:
parent
eb921a2330
commit
e4c1624418
@ -2,13 +2,13 @@
|
||||
"useConfigFiles": false,
|
||||
"plugins": {
|
||||
"@dcloudio/vue-cli-plugin-uni": {
|
||||
"version": "^2.0.1-alpha-33020211130001"
|
||||
"version": "^2.0.1-alpha-35420220810001"
|
||||
},
|
||||
"@dcloudio/vue-cli-plugin-uni-optimize": {
|
||||
"version": "^2.0.1-alpha-33020211130001"
|
||||
"version": "^2.0.1-alpha-35420220810001"
|
||||
},
|
||||
"@dcloudio/vue-cli-plugin-hbuilderx": {
|
||||
"version": "^2.0.1-alpha-33020211130001"
|
||||
"version": "^2.0.1-alpha-35420220810001"
|
||||
},
|
||||
"@vue/cli-plugin-babel": {
|
||||
"presets": [
|
||||
|
@ -1,10 +1,11 @@
|
||||
const plugins = []
|
||||
const webpack = require('webpack')
|
||||
const plugins = []
|
||||
|
||||
if (process.env.UNI_OPT_TREESHAKINGNG) {
|
||||
plugins.push(require('@dcloudio/vue-cli-plugin-uni-optimize/packages/babel-plugin-uni-api/index.js'))
|
||||
}
|
||||
}
|
||||
|
||||
if (
|
||||
if (
|
||||
(
|
||||
process.env.UNI_PLATFORM === 'app-plus' &&
|
||||
process.env.UNI_USING_V8
|
||||
@ -12,7 +13,7 @@ if (
|
||||
(
|
||||
process.env.UNI_PLATFORM === 'h5' &&
|
||||
process.env.UNI_H5_BROWSER === 'builtin'
|
||||
)
|
||||
)
|
||||
) {
|
||||
const path = require('path')
|
||||
|
||||
@ -34,7 +35,7 @@ if (
|
||||
}
|
||||
}
|
||||
])
|
||||
} catch (e) {}
|
||||
} catch (e) { }
|
||||
}
|
||||
|
||||
process.UNI_LIBRARIES = process.UNI_LIBRARIES || ['@dcloudio/uni-ui']
|
||||
@ -55,7 +56,7 @@ const config = {
|
||||
[
|
||||
'@vue/app',
|
||||
{
|
||||
modules: 'commonjs',
|
||||
modules: webpack.version[0] > 4 ? 'auto' : 'commonjs',
|
||||
useBuiltIns: process.env.UNI_PLATFORM === 'h5' ? 'usage' : 'entry'
|
||||
}
|
||||
]
|
||||
|
@ -1,7 +1,7 @@
|
||||
const path = require('path')
|
||||
module.exports = {
|
||||
parser: require('postcss-comment'),
|
||||
plugins: [
|
||||
const path = require('path')
|
||||
const webpack = require('webpack')
|
||||
const config = {
|
||||
plugins: [
|
||||
require('postcss-import')({
|
||||
resolve (id, basedir, importOptions) {
|
||||
if (id.startsWith('~@/')) {
|
||||
@ -14,9 +14,13 @@ module.exports = {
|
||||
return id
|
||||
}
|
||||
}),
|
||||
require('autoprefixer')({
|
||||
require('autoprefixer')({
|
||||
remove: process.env.UNI_PLATFORM !== 'h5'
|
||||
}),
|
||||
require('@dcloudio/vue-cli-plugin-uni/packages/postcss')
|
||||
]
|
||||
}
|
||||
}
|
||||
if (webpack.version[0] <= 4) {
|
||||
options.parser = require('postcss-comment')
|
||||
}
|
||||
module.exports = config
|
||||
|
Loading…
x
Reference in New Issue
Block a user