mirror of
https://gitee.com/dcloud/uni-preset-vue
synced 2025-04-20 04:06:23 +08:00
feat: support @vue/cli@5
This commit is contained in:
parent
eb921a2330
commit
e4c1624418
@ -2,13 +2,13 @@
|
|||||||
"useConfigFiles": false,
|
"useConfigFiles": false,
|
||||||
"plugins": {
|
"plugins": {
|
||||||
"@dcloudio/vue-cli-plugin-uni": {
|
"@dcloudio/vue-cli-plugin-uni": {
|
||||||
"version": "^2.0.1-alpha-33020211130001"
|
"version": "^2.0.1-alpha-35420220810001"
|
||||||
},
|
},
|
||||||
"@dcloudio/vue-cli-plugin-uni-optimize": {
|
"@dcloudio/vue-cli-plugin-uni-optimize": {
|
||||||
"version": "^2.0.1-alpha-33020211130001"
|
"version": "^2.0.1-alpha-35420220810001"
|
||||||
},
|
},
|
||||||
"@dcloudio/vue-cli-plugin-hbuilderx": {
|
"@dcloudio/vue-cli-plugin-hbuilderx": {
|
||||||
"version": "^2.0.1-alpha-33020211130001"
|
"version": "^2.0.1-alpha-35420220810001"
|
||||||
},
|
},
|
||||||
"@vue/cli-plugin-babel": {
|
"@vue/cli-plugin-babel": {
|
||||||
"presets": [
|
"presets": [
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
const webpack = require('webpack')
|
||||||
const plugins = []
|
const plugins = []
|
||||||
|
|
||||||
if (process.env.UNI_OPT_TREESHAKINGNG) {
|
if (process.env.UNI_OPT_TREESHAKINGNG) {
|
||||||
@ -55,7 +56,7 @@ const config = {
|
|||||||
[
|
[
|
||||||
'@vue/app',
|
'@vue/app',
|
||||||
{
|
{
|
||||||
modules: 'commonjs',
|
modules: webpack.version[0] > 4 ? 'auto' : 'commonjs',
|
||||||
useBuiltIns: process.env.UNI_PLATFORM === 'h5' ? 'usage' : 'entry'
|
useBuiltIns: process.env.UNI_PLATFORM === 'h5' ? 'usage' : 'entry'
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
const path = require('path')
|
const path = require('path')
|
||||||
module.exports = {
|
const webpack = require('webpack')
|
||||||
parser: require('postcss-comment'),
|
const config = {
|
||||||
plugins: [
|
plugins: [
|
||||||
require('postcss-import')({
|
require('postcss-import')({
|
||||||
resolve (id, basedir, importOptions) {
|
resolve (id, basedir, importOptions) {
|
||||||
@ -20,3 +20,7 @@ module.exports = {
|
|||||||
require('@dcloudio/vue-cli-plugin-uni/packages/postcss')
|
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