chore: HMRRuntime injection (wip)

This commit is contained in:
Igor Randjelovic
2021-03-24 17:27:35 +01:00
parent 3a28f9eef6
commit 8855ca4373
13 changed files with 384 additions and 41 deletions

View File

@ -3,6 +3,7 @@ import { merge } from 'webpack-merge';
import Config from 'webpack-chain';
import fs from 'fs';
import { hasDependency } from "../helpers/dependencies";
import { getPlatformName } from '../helpers/platform';
import { env as _env, IWebpackEnv } from '../index';
import { error } from "../helpers/log";
@ -46,18 +47,20 @@ export default function (config: Config, env: IWebpackEnv = _env): Config {
});
});
config.plugin('ForkTsCheckerWebpackPlugin').tap((args) => {
args[0] = merge(args[0], {
typescript: {
extensions: {
vue: {
enabled: true,
compiler: 'nativescript-vue-template-compiler',
config.when(hasDependency('typescript'), (config) => {
config.plugin('ForkTsCheckerWebpackPlugin').tap((args) => {
args[0] = merge(args[0], {
typescript: {
extensions: {
vue: {
enabled: true,
compiler: 'nativescript-vue-template-compiler',
},
},
},
},
});
return args;
});
return args;
});
// add VueLoaderPlugin as the first plugin