mirror of
https://github.com/gregberge/loadable-components.git
synced 2026-01-25 15:24:15 +00:00
BREAKING CHANGE: - SSR has been rewritten from scratch, if you use it, please follow the new guide. - Prefetch component and prefetch functions have been removed, please use `webpackPrefetch` instead.
13 lines
378 B
JavaScript
13 lines
378 B
JavaScript
export const clearModuleCache = key => delete require.cache[key]
|
|
|
|
export const smartRequire = modulePath => {
|
|
if (process.env.NODE_ENV !== 'production') {
|
|
clearModuleCache(modulePath)
|
|
}
|
|
|
|
// eslint-disable-next-line global-require, import/no-dynamic-require
|
|
return require(modulePath)
|
|
}
|
|
|
|
export const joinURLPath = (...paths) => paths.join('/').replace(/\/\//g, '/')
|