feat: core-hmr handling & watch ignore

This commit is contained in:
Igor Randjelovic
2021-03-11 23:05:47 +01:00
parent 0e8336f1d9
commit 6cc0ce3d57
12 changed files with 238 additions and 2 deletions

View File

@ -1,6 +1,7 @@
import Config from 'webpack-chain';
import { addVirtualEntry } from '../helpers/virtualModules';
import { getEntryDirPath } from "../helpers/platform";
import { env as _env, IWebpackEnv } from '../index';
import base from './base';
@ -31,5 +32,18 @@ export default function (config: Config, env: IWebpackEnv = _env): Config {
.use('xml-namespace-loader')
.loader('xml-namespace-loader');
// set up core HMR
config.module
.rule('hmr-core')
.test(/\.js$/)
.exclude
.add(/node_modules/)
.end()
.use('nativescript-hot-loader')
.loader('nativescript-hot-loader')
.options({
appPath: getEntryDirPath()
})
return config;
}