mirror of
https://github.com/c8r/x0.git
synced 2024-09-11 13:45:52 +03:00
Use require.resolve to determine path to whc
This commit is contained in:
parent
4d62a17aba
commit
955c564738
12
lib/dev.js
12
lib/dev.js
@ -25,7 +25,7 @@ module.exports = async (opts) => {
|
|||||||
config.mode = 'development'
|
config.mode = 'development'
|
||||||
config.context = opts.dirname
|
config.context = opts.dirname
|
||||||
config.entry = opts.entry || path.join(__dirname, './entry')
|
config.entry = opts.entry || path.join(__dirname, './entry')
|
||||||
config.output= {
|
config.output = {
|
||||||
path: path.join(process.cwd(), 'dev'),
|
path: path.join(process.cwd(), 'dev'),
|
||||||
filename: 'dev.js',
|
filename: 'dev.js',
|
||||||
publicPath: '/'
|
publicPath: '/'
|
||||||
@ -36,10 +36,12 @@ module.exports = async (opts) => {
|
|||||||
path.join(opts.dirname, 'node_modules')
|
path.join(opts.dirname, 'node_modules')
|
||||||
)
|
)
|
||||||
|
|
||||||
const whcAlias = config.resolve.alias['webpack-hot-client/client']
|
if (config.resolve.alias) {
|
||||||
if (!fs.existsSync(whcAlias)) {
|
const whcAlias = config.resolve.alias['webpack-hot-client/client']
|
||||||
const whcPath = 'node_modules/webpack-hot-client/client'
|
if (!fs.existsSync(whcAlias)) {
|
||||||
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(
|
config.plugins.push(
|
||||||
|
Loading…
Reference in New Issue
Block a user