Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -404,6 +404,9 @@ export function getCommonConfig(wco: WebpackConfigOptions): Configuration {
safari10: true,
output: {
ecma: terserEcma,
// For differential loading, this is handled in the bundle processing.
// This should also work with just true but the experimental rollup support breaks without this check.
ascii_only: !differentialLoadingMode,
// default behavior (undefined value) is to keep only important comments (licenses, etc.)
comments: !buildOptions.extractLicenses && undefined,
webkit: true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,4 +79,17 @@ describe('Browser Builder optimization level', () => {
expect(await files['main.js']).toContain('color: white');
expect(await files['styles.css']).toContain('color: white');
});

it('outputs ASCII only content', async () => {
const overrides = { aot: true, optimization: true };

host.writeMultipleFiles({
'src/app/app.component.html': `<p>€€€</p>`,
});

const { files } = await browserBuild(architect, host, target, overrides);
expect(await files['main.js']).not.toContain('ɵ');
expect(await files['main.js']).not.toContain('€€€');
expect(await files['main.js']).toContain('\\u20ac\\u20ac\\u20ac');
});
});
2 changes: 1 addition & 1 deletion tests/legacy-cli/e2e/tests/basic/ivy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ export default async function() {
const mainUrl = mainUrlMatch && mainUrlMatch[1];
const main = await request('http://localhost:4200/' + mainUrl);

if (!main.match(/ɵcmp\s*=/)) {
if (!main.match(/ɵcmp\s*=/) && !main.match(/\\u0275cmp\s*=/)) {
throw new Error('Ivy could not be found.');
}
if (main.match(/ngDevMode/)) {
Expand Down