mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-08-16 11:42:04 +08:00
fix(webpack): typescript imports in non-ts projects (#9714)
This commit is contained in:
@ -1,12 +1,11 @@
|
||||
import { ScriptTarget } from 'typescript';
|
||||
import { extname, resolve } from 'path';
|
||||
import Config from 'webpack-chain';
|
||||
import { existsSync } from 'fs';
|
||||
|
||||
import { getTypescript, readTsConfig } from '../helpers/typescript';
|
||||
import { getDependencyPath } from '../helpers/dependencies';
|
||||
import { getProjectFilePath } from '../helpers/project';
|
||||
import { env as _env, IWebpackEnv } from '../index';
|
||||
import { readTsConfig } from '../helpers/tsconfig';
|
||||
import { warnOnce } from '../helpers/log';
|
||||
import {
|
||||
getEntryDirPath,
|
||||
@ -179,6 +178,7 @@ export default function (config: Config, env: IWebpackEnv = _env): Config {
|
||||
const buildAngularPath = getDependencyPath('@angular-devkit/build-angular');
|
||||
if (buildAngularPath) {
|
||||
const tsConfig = readTsConfig(tsConfigPath);
|
||||
const { ScriptTarget } = getTypescript();
|
||||
const scriptTarget = tsConfig.options.target ?? ScriptTarget.ESNext;
|
||||
const buildAngularOptions: any = {
|
||||
scriptTarget,
|
||||
|
Reference in New Issue
Block a user