Skip to content
This repository was archived by the owner on Aug 7, 2021. It is now read-only.

Commit e65d008

Browse files
committed
refactor: stop reexporting transformer from index.js
This won't work for projects that don't have dependency for `@ngtools/webpack`.
1 parent c9c9252 commit e65d008

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

Diff for: index.js

-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ const {
1010

1111
Object.assign(exports, require("./plugins"));
1212
Object.assign(exports, require("./host/resolver"));
13-
Object.assign(exports, require("./transformers/ns-replace-bootstrap"));
1413

1514
exports.getAotEntryModule = function (appDirectory) {
1615
verifyEntryModuleDirectory(appDirectory);

Diff for: templates/webpack.angular.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ const { join, relative, resolve, sep } = require("path");
33
const webpack = require("webpack");
44
const nsWebpack = require("nativescript-dev-webpack");
55
const nativescriptTarget = require("nativescript-dev-webpack/nativescript-target");
6+
const { nsReplaceBootstrap } = require("nativescript-dev-webpack/transformers/ns-replace-bootstrap");
67
const CleanWebpackPlugin = require("clean-webpack-plugin");
78
const CopyWebpackPlugin = require("copy-webpack-plugin");
89
const { BundleAnalyzerPlugin } = require("webpack-bundle-analyzer");
@@ -51,7 +52,7 @@ module.exports = env => {
5152

5253
const ngCompilerPlugin = new AngularCompilerPlugin({
5354
hostReplacementPaths: nsWebpack.getResolver([platform, "tns"]),
54-
platformTransformers: aot ? [nsWebpack.nsReplaceBootstrap(() => ngCompilerPlugin)] : null,
55+
platformTransformers: aot ? [nsReplaceBootstrap(() => ngCompilerPlugin)] : null,
5556
mainPath: resolve(appPath, entryModule),
5657
tsConfigPath: join(__dirname, "tsconfig.esm.json"),
5758
skipCodeGeneration: !aot,

Diff for: transformers/ns-replace-bootstrap.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import {
77
insertStarImport,
88
ReplaceNodeOperation,
99
makeTransform
10-
} from "@ngtools/webpack/src/transformers"
10+
} from "@ngtools/webpack/src/transformers";
1111
import { workaroundResolve } from '@ngtools/webpack/src/compiler_host';
1212
import { AngularCompilerPlugin } from '@ngtools/webpack';
1313

0 commit comments

Comments
 (0)