mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-11-05 13:26:48 +08:00
chore: cleanup imports
This commit is contained in:
@@ -1,13 +1,13 @@
|
|||||||
import Config from 'webpack-chain';
|
import Config from 'webpack-chain';
|
||||||
|
import { resolve } from 'path'
|
||||||
|
|
||||||
|
import { additionalCopyRules } from '../../src/helpers/copyRules'
|
||||||
import {
|
import {
|
||||||
default as angular,
|
default as angular,
|
||||||
getFileReplacementsFromWorkspaceConfig,
|
getFileReplacementsFromWorkspaceConfig,
|
||||||
applyFileReplacements
|
applyFileReplacements
|
||||||
} from '../../src/configuration/angular';
|
} from '../../src/configuration/angular';
|
||||||
import { init } from '../../src';
|
import { init } from '../../src';
|
||||||
import { additionalCopyRules } from '../../src/helpers/copyRules'
|
|
||||||
|
|
||||||
import { resolve } from 'path'
|
|
||||||
|
|
||||||
jest.mock(
|
jest.mock(
|
||||||
'@ngtools/webpack',
|
'@ngtools/webpack',
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
import Config from 'webpack-chain';
|
import Config from 'webpack-chain';
|
||||||
import fs from 'fs';
|
import fs from 'fs';
|
||||||
|
|
||||||
import base from '../../src/configuration/base';
|
import base from '../../src/configuration/base';
|
||||||
import { init } from '../../src';
|
import { init } from '../../src';
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
import Config from 'webpack-chain';
|
import Config from 'webpack-chain';
|
||||||
|
|
||||||
import javascript from '../../src/configuration/javascript';
|
import javascript from '../../src/configuration/javascript';
|
||||||
import { init } from '../../src';
|
import { init } from '../../src';
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
import Config from 'webpack-chain';
|
import Config from 'webpack-chain';
|
||||||
|
|
||||||
import react from '../../src/configuration/react';
|
import react from '../../src/configuration/react';
|
||||||
import { init } from '../../src';
|
import { init } from '../../src';
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
import Config from 'webpack-chain';
|
import Config from 'webpack-chain';
|
||||||
|
|
||||||
import svelte from '../../src/configuration/svelte';
|
import svelte from '../../src/configuration/svelte';
|
||||||
import { init } from '../../src';
|
import { init } from '../../src';
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
import Config from 'webpack-chain';
|
import Config from 'webpack-chain';
|
||||||
|
|
||||||
import typescript from '../../src/configuration/typescript';
|
import typescript from '../../src/configuration/typescript';
|
||||||
import { init } from '../../src';
|
import { init } from '../../src';
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
import Config from 'webpack-chain';
|
import Config from 'webpack-chain';
|
||||||
|
|
||||||
import vue from '../../src/configuration/vue';
|
import vue from '../../src/configuration/vue';
|
||||||
import { init } from '../../src';
|
import { init } from '../../src';
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
import xmlNsLoader from '../../src/loaders/xml-namespace-loader';
|
|
||||||
import dedent from 'ts-dedent';
|
import dedent from 'ts-dedent';
|
||||||
|
|
||||||
|
import xmlNsLoader from '../../src/loaders/xml-namespace-loader';
|
||||||
|
|
||||||
const CODE_FILE = dedent`
|
const CODE_FILE = dedent`
|
||||||
<Page xmlns="http://www.nativescript.org/tns.xsd">
|
<Page xmlns="http://www.nativescript.org/tns.xsd">
|
||||||
<StackLayout>
|
<StackLayout>
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ import dedent from 'ts-dedent';
|
|||||||
import webpack from 'webpack';
|
import webpack from 'webpack';
|
||||||
import path from 'path';
|
import path from 'path';
|
||||||
import fs from 'fs';
|
import fs from 'fs';
|
||||||
|
|
||||||
import { parseEnvFlags } from '../cli/parseEnvFlags';
|
import { parseEnvFlags } from '../cli/parseEnvFlags';
|
||||||
|
|
||||||
const defaultConfig = path.resolve(
|
const defaultConfig = path.resolve(
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { IWebpackEnv } from '@nativescript/webpack';
|
import type { IWebpackEnv } from '@nativescript/webpack';
|
||||||
|
|
||||||
const ENV_FLAG_RE = /--env\.(\w+)(?:=(.+))?/;
|
const ENV_FLAG_RE = /--env\.(\w+)(?:=(.+))?/;
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import Config from 'webpack-chain';
|
|
||||||
import { resolve, dirname } from 'path';
|
import { resolve, dirname } from 'path';
|
||||||
|
import Config from 'webpack-chain';
|
||||||
import { existsSync } from 'fs';
|
import { existsSync } from 'fs';
|
||||||
import get from 'lodash.get'
|
import get from 'lodash.get'
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
import { DefinePlugin, HotModuleReplacementPlugin } from 'webpack';
|
import { DefinePlugin, HotModuleReplacementPlugin } from 'webpack';
|
||||||
import Config from 'webpack-chain';
|
import Config from 'webpack-chain';
|
||||||
import { resolve } from 'path';
|
import { resolve } from 'path';
|
||||||
|
import os from 'os';
|
||||||
|
|
||||||
import ForkTsCheckerWebpackPlugin from 'fork-ts-checker-webpack-plugin';
|
import ForkTsCheckerWebpackPlugin from 'fork-ts-checker-webpack-plugin';
|
||||||
import FilterWarningsPlugin from 'webpack-filter-warnings-plugin';
|
import FilterWarningsPlugin from 'webpack-filter-warnings-plugin';
|
||||||
@@ -22,7 +23,6 @@ import {
|
|||||||
getEntryDirPath,
|
getEntryDirPath,
|
||||||
getEntryPath,
|
getEntryPath,
|
||||||
} from '../helpers/platform';
|
} from '../helpers/platform';
|
||||||
import os from 'os';
|
|
||||||
|
|
||||||
export default function (config: Config, env: IWebpackEnv = _env): Config {
|
export default function (config: Config, env: IWebpackEnv = _env): Config {
|
||||||
const entryPath = getEntryPath();
|
const entryPath = getEntryPath();
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
import { getPackageJson, getProjectRootPath } from './project';
|
|
||||||
import path from 'path';
|
import path from 'path';
|
||||||
|
|
||||||
|
import { getPackageJson, getProjectRootPath } from './project';
|
||||||
|
|
||||||
// todo: memoize
|
// todo: memoize
|
||||||
/**
|
/**
|
||||||
* Utility to get all dependencies from the project package.json.
|
* Utility to get all dependencies from the project package.json.
|
||||||
|
|||||||
Reference in New Issue
Block a user