How to use the @ngtools/webpack.PLATFORM function in @ngtools/webpack

To help you get started, we’ve selected a few @ngtools/webpack examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github fossasia / susper.com / node_modules / @angular / cli / models / webpack-configs / typescript.js View on Github external
const appRoot = path.resolve(projectRoot, appConfig.root);
        const sourcePath = appConfig.environmentSource;
        const envFile = appConfig.environments[buildOptions.environment];
        hostReplacementPaths = {
            [path.resolve(appRoot, sourcePath)]: path.resolve(appRoot, envFile)
        };
    }
    if (webpack_1.AngularCompilerPlugin.isSupported()) {
        const pluginOptions = Object.assign({}, {
            mainPath: useMain ? path.join(projectRoot, appConfig.root, appConfig.main) : undefined,
            i18nInFile: buildOptions.i18nFile,
            i18nInFormat: buildOptions.i18nFormat,
            i18nOutFile: buildOptions.i18nOutFile,
            i18nOutFormat: buildOptions.i18nOutFormat,
            locale: buildOptions.locale,
            platform: appConfig.platform === 'server' ? webpack_1.PLATFORM.Server : webpack_1.PLATFORM.Browser,
            missingTranslation: buildOptions.missingTranslation,
            hostReplacementPaths,
            sourceMap: buildOptions.sourcemaps,
        }, options);
        return new webpack_1.AngularCompilerPlugin(pluginOptions);
    }
    else {
        const pluginOptions = Object.assign({}, {
            mainPath: path.join(projectRoot, appConfig.root, appConfig.main),
            i18nFile: buildOptions.i18nFile,
            i18nFormat: buildOptions.i18nFormat,
            locale: buildOptions.locale,
            replaceExport: appConfig.platform === 'server',
            missingTranslation: buildOptions.missingTranslation,
            hostReplacementPaths,
            sourceMap: buildOptions.sourcemaps,
github johandb / svg-drawing-tool / node_modules / @angular-devkit / build-angular / src / angular-cli-files / models / webpack-configs / typescript.js View on Github external
i18nInFile: i18nInFile,
        i18nInFormat: buildOptions.i18nFormat,
    };
    const additionalLazyModules = {};
    if (buildOptions.lazyModules) {
        for (const lazyModule of buildOptions.lazyModules) {
            additionalLazyModules[lazyModule] = path.resolve(root, lazyModule);
        }
    }
    const hostReplacementPaths = {};
    if (buildOptions.fileReplacements) {
        for (const replacement of buildOptions.fileReplacements) {
            hostReplacementPaths[replacement.replace] = replacement.with;
        }
    }
    const pluginOptions = Object.assign({ mainPath: useMain ? path.join(root, buildOptions.main) : undefined }, i18nFileAndFormat, { locale: buildOptions.i18nLocale, platform: buildOptions.platform === 'server' ? webpack_1.PLATFORM.Server : webpack_1.PLATFORM.Browser, missingTranslation: buildOptions.i18nMissingTranslation, sourceMap: buildOptions.sourceMap.scripts, additionalLazyModules,
        hostReplacementPaths, nameLazyFiles: buildOptions.namedChunks, forkTypeChecker: buildOptions.forkTypeChecker, contextElementDependencyConstructor: require('webpack/lib/dependencies/ContextElementDependency'), logger: wco.logger, directTemplateLoading: true }, options);
    return new webpack_1.AngularCompilerPlugin(pluginOptions);
}
function getNonAotConfig(wco, host) {
github rxweb / rxweb / rxweb.io / node_modules / @angular-devkit / build-angular / src / angular-cli-files / models / webpack-configs / typescript.js View on Github external
i18nInFile: i18nInFile,
        i18nInFormat: buildOptions.i18nFormat,
    };
    const additionalLazyModules = {};
    if (buildOptions.lazyModules) {
        for (const lazyModule of buildOptions.lazyModules) {
            additionalLazyModules[lazyModule] = path.resolve(root, lazyModule);
        }
    }
    const hostReplacementPaths = {};
    if (buildOptions.fileReplacements) {
        for (const replacement of buildOptions.fileReplacements) {
            hostReplacementPaths[replacement.replace] = replacement.with;
        }
    }
    const pluginOptions = Object.assign({ mainPath: useMain ? path.join(root, buildOptions.main) : undefined }, i18nFileAndFormat, { locale: buildOptions.i18nLocale, platform: buildOptions.platform === 'server' ? webpack_1.PLATFORM.Server : webpack_1.PLATFORM.Browser, missingTranslation: buildOptions.i18nMissingTranslation, sourceMap: buildOptions.sourceMap, additionalLazyModules,
        hostReplacementPaths, nameLazyFiles: buildOptions.namedChunks, forkTypeChecker: buildOptions.forkTypeChecker, contextElementDependencyConstructor: require('webpack/lib/dependencies/ContextElementDependency') }, options);
    return new webpack_1.AngularCompilerPlugin(pluginOptions);
}
function getNonAotConfig(wco, host) {