-
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: uni-use and uni-promises clash
- Loading branch information
1 parent
2100f73
commit a078f83
Showing
8 changed files
with
30 additions
and
29 deletions.
There are no files selected for viewing
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,17 @@ | ||
export default function getData({ oldData }) { | ||
const uniUsePlugin = { | ||
id: 'uniUse', | ||
const uniPromisesPlugin = { | ||
id: 'uniPromises', | ||
importer: `import 'core-js/actual/array/iterator'; | ||
import 'core-js/actual/promise'; | ||
import 'core-js/actual/object/assign'; | ||
import 'core-js/actual/promise/finally';`, | ||
} | ||
return { | ||
...oldData, | ||
plugins: oldData.plugins.flatMap(plugin => | ||
plugin.id === 'vue' ? [uniUsePlugin, plugin] : plugin, | ||
), | ||
plugins: oldData.plugins.some(item => item.id === 'uniUse') | ||
? oldData.plugins | ||
: oldData.plugins.flatMap(plugin => | ||
plugin.id === 'vue' ? [plugin, uniPromisesPlugin] : plugin, | ||
), | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,16 @@ | ||
export default function getData({ oldData }) { | ||
const promisesextraConfig = { | ||
id: 'uniPromises', | ||
extraConfig: `build: { | ||
target: 'es6', | ||
cssTarget: 'chrome61', // https://cn.vitejs.dev/config/build-options.html#build-csstarget | ||
}, | ||
optimizeDeps: { | ||
exclude: ['vue-demi'], | ||
}`, | ||
data: `build: { | ||
target: 'es6', | ||
cssTarget: 'chrome61', // https://cn.vitejs.dev/config/build-options.html#build-csstarget | ||
}, | ||
optimizeDeps: { | ||
exclude: ['vue-demi'], | ||
}`, | ||
} | ||
return { | ||
...oldData, | ||
extraConfig: oldData.extraConfig.flatMap(config => | ||
config.id === 'uniUse' ? [...config, ...promisesextraConfig] : config, | ||
), | ||
extraConfig: oldData?.extraConfig?.id === 'uniUse' ? oldData.extraConfig : promisesextraConfig, | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,16 @@ | ||
export default function getData({ oldData }) { | ||
const uniUseextraConfig = { | ||
id: 'uniUse', | ||
extraConfig: `build: { | ||
target: 'es6', | ||
cssTarget: 'chrome61', // https://cn.vitejs.dev/config/build-options.html#build-csstarget | ||
}, | ||
optimizeDeps: { | ||
exclude: ['vue-demi'], | ||
}`, | ||
data: `build: { | ||
target: 'es6', | ||
cssTarget: 'chrome61', // https://cn.vitejs.dev/config/build-options.html#build-csstarget | ||
}, | ||
optimizeDeps: { | ||
exclude: ['vue-demi'], | ||
}`, | ||
} | ||
return { | ||
...oldData, | ||
extraConfig: oldData.extraConfig.flatMap(config => | ||
config.id === 'uniPromises' ? [...config, ...uniUseextraConfig] : config, | ||
), | ||
extraConfig: uniUseextraConfig, | ||
} | ||
} |