-
-
Save serhii-havrylenko/5a45a374110520f5665808a714715736 to your computer and use it in GitHub Desktop.
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
const path = require('path'); | |
const { lstatSync, readdirSync } = require('fs'); | |
const basePath = path.resolve(__dirname, '../', 'packages'); | |
const packages = readdirSync(basePath).filter((name) => | |
lstatSync(path.join(basePath, name)).isDirectory(), | |
); | |
module.exports = (baseConfig, env, config) => { | |
config.module.rules.push({ | |
test: /\.(ts|tsx)$/, | |
loader: require.resolve('awesome-typescript-loader'), | |
}); | |
config.resolve.extensions.push('.ts', '.tsx'); | |
Object.assign(config.resolve.alias, { | |
...packages.reduce( | |
(acc, name) => ({ | |
...acc, | |
[`@taxi/${name}`]: path.join(basePath, name, 'src'), | |
}), | |
{}, | |
), | |
}); | |
return config; | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment