fix: icons package
This commit is contained in:
@@ -6,13 +6,24 @@
|
||||
* https://stackoverflow.com/a/65231261/2504429
|
||||
* @format
|
||||
*/
|
||||
const { getDefaultConfig } = require('metro-config');
|
||||
const path = require('path')
|
||||
const { getDefaultConfig } = require('metro-config')
|
||||
|
||||
const extraNodeModules = {
|
||||
common: path.resolve(__dirname + '../..'),
|
||||
}
|
||||
|
||||
module.exports = (async () => {
|
||||
const {
|
||||
resolver: { sourceExts, assetExts },
|
||||
} = await getDefaultConfig();
|
||||
} = await getDefaultConfig()
|
||||
|
||||
return {
|
||||
watchFolders: [
|
||||
__dirname,
|
||||
path.resolve(__dirname, '../icons'),
|
||||
path.resolve(__dirname, '../styles'),
|
||||
],
|
||||
transformer: {
|
||||
getTransformOptions: async () => ({
|
||||
transform: {
|
||||
@@ -25,6 +36,12 @@ module.exports = (async () => {
|
||||
resolver: {
|
||||
assetExts: assetExts.filter(ext => ext !== 'svg'),
|
||||
sourceExts: [...sourceExts, 'svg'],
|
||||
extraNodeModules: new Proxy(extraNodeModules, {
|
||||
get: (target, name) => {
|
||||
const result = name in target ? target[name] : path.join(process.cwd(), `node_modules/${name}`)
|
||||
return result
|
||||
},
|
||||
}),
|
||||
},
|
||||
};
|
||||
})();
|
||||
}
|
||||
})()
|
||||
|
||||
Reference in New Issue
Block a user