Ensure that brave-ui and brave-core use the same styled-components modules (and same context singletons)

This commit is contained in:
Pete Miller
2021-03-11 21:31:02 +13:00
parent 4659f9487c
commit 698addf2a3
2 changed files with 8 additions and 2 deletions
+4 -1
View File
@@ -19,7 +19,10 @@ module.exports = async ({ config, mode }) => {
})
config.resolve.alias = {
...config.resolve.alias,
'brave-ui': path.resolve(__dirname, '../node_modules/brave-ui/src')
'brave-ui': path.resolve(__dirname, '../node_modules/brave-ui/src'),
// Force same styled-components module for brave-core and brave-ui
// which ensure both repos code use the same singletons, e.g. ThemeContext.
'styled-components': path.resolve(__dirname, '../node_modules/styled-components'),
}
config.resolve.extensions.push('.ts', '.tsx')
return config
+4 -1
View File
@@ -16,7 +16,10 @@ module.exports = (env, argv) => ({
resolve: {
extensions: ['.js', '.tsx', '.ts', '.json'],
alias: {
'brave-ui': path.resolve(__dirname, '../../node_modules/brave-ui/src')
'brave-ui': path.resolve(__dirname, '../../node_modules/brave-ui/src'),
// Force same styled-components module for brave-core and brave-ui
// which ensure both repos code use the same singletons, e.g. ThemeContext.
'styled-components': path.resolve(__dirname, '../../node_modules/styled-components'),
},
// For explanation of "chromeapp", see:
// https://github.com/brave/brave-browser/issues/5587