mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-08-20 07:26:11 +08:00
style: run prettier on webpack5 files
This commit is contained in:
@ -14,7 +14,7 @@ export let copyRules = new Set([]);
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
export let additionalCopyRules = []
|
||||
export let additionalCopyRules = [];
|
||||
|
||||
/**
|
||||
* Utility to add new copy rules. Accepts a glob or an object. For example
|
||||
@ -30,11 +30,11 @@ export let additionalCopyRules = []
|
||||
* @param {string|object} globOrObject
|
||||
*/
|
||||
export function addCopyRule(globOrObject: string | object) {
|
||||
if(typeof globOrObject === 'string') {
|
||||
if (typeof globOrObject === 'string') {
|
||||
return copyRules.add(globOrObject);
|
||||
}
|
||||
|
||||
additionalCopyRules.push(globOrObject)
|
||||
additionalCopyRules.push(globOrObject);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -72,12 +72,14 @@ export function applyCopyRules(config: Config) {
|
||||
|
||||
config.plugin('CopyWebpackPlugin').use(CopyWebpackPlugin, [
|
||||
{
|
||||
patterns: Array.from(copyRules).map((glob) => ({
|
||||
from: glob,
|
||||
context: entryDir,
|
||||
noErrorOnMissing: true,
|
||||
globOptions,
|
||||
})).concat(additionalCopyRules),
|
||||
patterns: Array.from(copyRules)
|
||||
.map((glob) => ({
|
||||
from: glob,
|
||||
context: entryDir,
|
||||
noErrorOnMissing: true,
|
||||
globOptions,
|
||||
}))
|
||||
.concat(additionalCopyRules),
|
||||
},
|
||||
]);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user