mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-20 12:29:55 +08:00
fix(): change e2e.prod so that it copies the core files.
This commit is contained in:
@ -120,6 +120,8 @@ function buildTest(filePath: string) {
|
|||||||
|
|
||||||
const relativePathFromComponents = relative(dirname(SRC_COMPONENTS_ROOT), srcTestRoot);
|
const relativePathFromComponents = relative(dirname(SRC_COMPONENTS_ROOT), srcTestRoot);
|
||||||
const distTestRoot = join(process.cwd(), 'dist', 'e2e', relativePathFromComponents);
|
const distTestRoot = join(process.cwd(), 'dist', 'e2e', relativePathFromComponents);
|
||||||
|
const coreCompilerFilePath = join(PROJECT_ROOT, '..', 'ionic-core', 'dist', 'compiler');
|
||||||
|
const coreDir = join(PROJECT_ROOT, '..', 'ionic-core', 'dist', 'compiled-ionic-angular');
|
||||||
|
|
||||||
const includeGlob = [ join(ionicAngularDir, '**', '*.ts')];
|
const includeGlob = [ join(ionicAngularDir, '**', '*.ts')];
|
||||||
const pathToWriteFile = join(distTestRoot, 'tsconfig.json');
|
const pathToWriteFile = join(distTestRoot, 'tsconfig.json');
|
||||||
@ -133,7 +135,7 @@ function buildTest(filePath: string) {
|
|||||||
const appNgModulePath = join(dirname(appEntryPoint), 'app.module.ts');
|
const appNgModulePath = join(dirname(appEntryPoint), 'app.module.ts');
|
||||||
const distDir = join(distTestRoot, 'www');
|
const distDir = join(distTestRoot, 'www');
|
||||||
|
|
||||||
return runAppScriptsBuild(appEntryPoint, appNgModulePath, ionicAngularDir, distDir, pathToWriteFile, ionicAngularDir, sassConfigPath, copyConfigPath, argv.dev).then(() => {
|
return runAppScriptsBuild(appEntryPoint, appNgModulePath, ionicAngularDir, distDir, pathToWriteFile, ionicAngularDir, coreCompilerFilePath, coreDir, sassConfigPath, copyConfigPath, argv.dev).then(() => {
|
||||||
const end = Date.now();
|
const end = Date.now();
|
||||||
console.log(`${filePath} took a total of ${(end - start) / 1000} seconds to build`);
|
console.log(`${filePath} took a total of ${(end - start) / 1000} seconds to build`);
|
||||||
}).catch((err) => {
|
}).catch((err) => {
|
||||||
|
@ -249,10 +249,10 @@ export function runAppScriptsServe(testOrDemoName: string, appEntryPoint: string
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
export function runAppScriptsBuild(appEntryPoint: string, appNgModulePath: string, srcDir: string, distDir: string, tsConfig: string, ionicAngularDir: string, sassConfigPath: string, copyConfigPath: string, isDev: boolean = false) {
|
export function runAppScriptsBuild(appEntryPoint: string, appNgModulePath: string, srcDir: string, distDir: string, tsConfig: string, ionicAngularDir: string, coreCompilerFilePath: string, coreDir: string, sassConfigPath: string, copyConfigPath: string, isDev: boolean = false) {
|
||||||
const pathToAppScripts = join(NODE_MODULES_ROOT, '.bin', 'ionic-app-scripts');
|
const pathToAppScripts = join(NODE_MODULES_ROOT, '.bin', 'ionic-app-scripts');
|
||||||
const debug: boolean = argv.debug;
|
const debug: boolean = argv.debug;
|
||||||
return runWorker(pathToAppScripts, debug, appEntryPoint, appNgModulePath, srcDir, distDir, tsConfig, ionicAngularDir, sassConfigPath, copyConfigPath, isDev);
|
return runWorker(pathToAppScripts, debug, appEntryPoint, appNgModulePath, srcDir, distDir, tsConfig, ionicAngularDir, coreCompilerFilePath, coreDir, sassConfigPath, copyConfigPath, isDev);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Resolves the path for a node package executable. */
|
/** Resolves the path for a node package executable. */
|
||||||
|
@ -3,7 +3,7 @@ import { dirname, join } from 'path';
|
|||||||
|
|
||||||
import { MessageToWorker, WorkerProcess } from './interfaces';
|
import { MessageToWorker, WorkerProcess } from './interfaces';
|
||||||
|
|
||||||
export function runWorker(pathToAppScripts: string, debug: boolean, appEntryPoint: string, appNgModulePath: string, srcDir: string, distDir: string, tsConfig: string, ionicAngularDir: string, sassConfigPath: string, copyConfigPath: string, isDev: boolean) {
|
export function runWorker(pathToAppScripts: string, debug: boolean, appEntryPoint: string, appNgModulePath: string, srcDir: string, distDir: string, tsConfig: string, ionicAngularDir: string, coreCompilerFilePath: string, coreDir: string, sassConfigPath: string, copyConfigPath: string, isDev: boolean) {
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
|
|
||||||
const msgToWorker: MessageToWorker = {
|
const msgToWorker: MessageToWorker = {
|
||||||
@ -15,6 +15,8 @@ export function runWorker(pathToAppScripts: string, debug: boolean, appEntryPoin
|
|||||||
distDir: distDir,
|
distDir: distDir,
|
||||||
tsConfig: tsConfig,
|
tsConfig: tsConfig,
|
||||||
ionicAngularDir: ionicAngularDir,
|
ionicAngularDir: ionicAngularDir,
|
||||||
|
coreCompilerFilePath: coreCompilerFilePath,
|
||||||
|
coreDir: coreDir,
|
||||||
sassConfigPath: sassConfigPath,
|
sassConfigPath: sassConfigPath,
|
||||||
copyConfigPath: copyConfigPath,
|
copyConfigPath: copyConfigPath,
|
||||||
isDev: isDev
|
isDev: isDev
|
||||||
@ -70,6 +72,8 @@ export function createWorker(msg: MessageToWorker): any {
|
|||||||
'--experimentalManualTreeshaking', 'false',
|
'--experimentalManualTreeshaking', 'false',
|
||||||
'--experimentalPurgeDecorators', 'false',
|
'--experimentalPurgeDecorators', 'false',
|
||||||
'--ionicAngularDir', msg.ionicAngularDir,
|
'--ionicAngularDir', msg.ionicAngularDir,
|
||||||
|
'--coreCompilerFilePath', msg.coreCompilerFilePath,
|
||||||
|
'--coreDir', msg.coreDir,
|
||||||
'--sass', msg.sassConfigPath,
|
'--sass', msg.sassConfigPath,
|
||||||
'--copy', msg.copyConfigPath,
|
'--copy', msg.copyConfigPath,
|
||||||
'--enableLint', 'false',
|
'--enableLint', 'false',
|
||||||
|
@ -13,6 +13,8 @@ export interface MessageToWorker {
|
|||||||
distDir: string;
|
distDir: string;
|
||||||
tsConfig: string;
|
tsConfig: string;
|
||||||
ionicAngularDir: string;
|
ionicAngularDir: string;
|
||||||
|
coreCompilerFilePath: string;
|
||||||
|
coreDir: string;
|
||||||
sassConfigPath: string;
|
sassConfigPath: string;
|
||||||
copyConfigPath: string;
|
copyConfigPath: string;
|
||||||
isDev: boolean;
|
isDev: boolean;
|
||||||
|
Reference in New Issue
Block a user