Certain node packages depend on native bindings which cannot be bundled, with this fix we add a way to exclude these from being processed by the bundler.
Closes: #16348
A target of es2015 was previously assumed when using differential loading. This could result in erroneously downleveling an es2016+ output file instead of generating a new es5 output file.
Avoid copying directly directories, also which this change we cache `fs.existsSync` to optimize copying when a lot of file are being copied to the same destination.
Closes: #15816
In applications that make heavy use of lazy routes and ES2015 libraries, this option can improve bundle sizes. It might also break your bundles in ways we don't understand fully, so please test and report any problems you find.
NOTE: the following are known problems with experimentalRollupPass
- vendorChunk, commonChunk, namedChunks: these won't work, because by the time webpack sees the chunks, the context of where they came from is lost.
- webWorkerTsConfig: workers must be imported via a root relative path (e.g.`app/search/search.worker`) instead of a relative path (`/search.worker`) because of the same reason as above.
- loadChildren string syntax: doesn't work because rollup cannot follow the imports.
* feat(@angular-devkit/core): update schema to support new i18n options
"projects": {
"my-app": {
"projectType": "application",
"schematics": {},
"root": "",
"i18n": {
"sourceLocale": "en-US",
"locales": {
"fr": "src/locale/messages.fr.xlf"
}
},
"sourceRoot": "src",
...
}
}
* feat(@angular-devkit/build-angular): add new i18n options to browser and server builders
With this change we add `translateLocales` as new options for i18n in browser and server builders.
We also deprecate the following options;
* i18nLocale
* i18nFormat
* i18nFile
* feat(@angular-devkit/build-angular): deprecate `i18nFormat` and `i18nLocale` options of `extract-i18n` builder
Option `i18nFormat` has been deprecated in favor of `format` and `i18nLocale` option has been deprecated in favor of the `sourceLocale` sub option of the `i18n` project level option.
* feat(@angular/cli): add alias of `i18n-extract` for `x18n` command
* refactor: rename `translateLocales` to `localize`
* test: update ng-packagr builder tests to work on Windows
* build: add ng packagr test large for ivy
* test: fix web-worker test in ivy
Previously, we were not testing web workers under Ivy as we were overriding tsconfig.app.json entirely without including enableIvy.
When enabling Ivy we are getting warning of files that are part of the compilation which causing a warning to show and break the test.
* build: update ng-packagr to `^5.4.0`
* test: display ivy mode message once
`namespace` is always empty which is breaking sourcemaps since when sources start with `/` vscode will not be able to resolve them unless users configure `sourceMapPathOverrides`.
Fixes#15116
It’s very easy to inadvertently import toplevel css in component styles. Since component css is standalone and self-contained, it will never be shared between components and remains as a single large bundle for each component. This in turn adds a large amount of code that must be processed and increases bundle size.
Related to: TOOL-949
At the moment child compilation warnings and errors are being lost as they are not passed to the root compilation. This means that any errors that are being set by clean-css for component styles are being lost.
When a tsconfig without `includes` or `files` all files under the `rootDir` will be included in the compilation. This results in redundant files to inserted as part of the ts compilation which in some cases might reduce the compilation drastically.
Related to: TOOL-949
The package is quite large at 33MB (46MB on disk). The package is also only used in one test that is already covered by an E2E test. The E2E test does not require the package to be present for development as the test installs it within a generated project during execution. This also has the benefit of testing the icons package in a more real world use case; as well as allowing the test to serve as a guide for a user to add the package to their own application.
* test: update tests to work with new stricter tsconfig file inclusions
* fix(@schematics/angular): exclusively list the files in tsconfigs
With the omission of `includes` or `files` in tsconfig files tsc will pick up all the files under the rootDir and make them as part of the compilation. In certain cases, redundant files will be picked up which will cause a slower compilations.
Related to: TOOL-949
This change synchronizes the behavior of classic scripts and module scripts (`type="module"`). Module scripts are deferred by default. Also, certain injected scripts are not considered module scripts even in a ES2015+ build due to the strict mode behavior of module scripts. Deferring such scripts also ensures consistent execution in those scenarios.
This allows the output path of an application's index HTML file to be controlled independently of the input file. The output path for the file will be considered relative to the application's configured output path. This allows an application to contain multiple input index files for different configurations and allow the output file to remain constant. This also enables the placement of the index file in a subdirectory within the output path or change the name of the output index file neither of which was previously possible.