1
1
mirror of https://github.com/c8r/x0.git synced 2024-09-11 13:45:52 +03:00

Merge pull request #67 from c8r/whc-require-resolve

Use require.resolve to determine path to whc
This commit is contained in:
John Otander 2018-06-13 18:45:36 -06:00 committed by GitHub
commit 5341e26996
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -36,10 +36,12 @@ module.exports = async (opts) => {
path.join(opts.dirname, 'node_modules')
)
if (config.resolve.alias) {
const whcAlias = config.resolve.alias['webpack-hot-client/client']
if (!fs.existsSync(whcAlias)) {
const whcPath = 'node_modules/webpack-hot-client/client'
config.resolve.alias['webpack-hot-client/client'] = path.join(process.cwd(), whcPath)
const whcPath = path.dirname(require.resolve('webpack-hot-client/client'))
config.resolve.alias['webpack-hot-client/client'] = whcPath
}
}
config.plugins.push(