test: add systemjs+umd integration test (#14196)
This test ensures the `__esModule` is set on UMD bundles, thus making them compatible with SystemJS@^0.22.3. Followup from https://github.com/frankwallis/plugin-typescript/issues/185. PR Close #14196
This commit is contained in:

committed by
Miško Hevery

parent
f8c075ae27
commit
f634c62cb3
11
integration/hello_world__systemjs_umd/src/app/app.ts
Normal file
11
integration/hello_world__systemjs_umd/src/app/app.ts
Normal file
@ -0,0 +1,11 @@
|
||||
import {HelloWorldComponent} from './hello-world.component';
|
||||
|
||||
import {NgModule} from '@angular/core';
|
||||
import {BrowserModule} from '@angular/platform-browser';
|
||||
|
||||
@NgModule({
|
||||
declarations: [HelloWorldComponent],
|
||||
bootstrap: [HelloWorldComponent],
|
||||
imports: [BrowserModule],
|
||||
})
|
||||
export class AppModule {}
|
@ -0,0 +1,10 @@
|
||||
import {Component, Injectable} from '@angular/core';
|
||||
|
||||
@Component({
|
||||
selector: 'hello-world-app',
|
||||
template: '<div>Hello {{ name }}!</div>',
|
||||
})
|
||||
@Injectable()
|
||||
export class HelloWorldComponent {
|
||||
name: string = 'world';
|
||||
}
|
21
integration/hello_world__systemjs_umd/src/index.html
Normal file
21
integration/hello_world__systemjs_umd/src/index.html
Normal file
@ -0,0 +1,21 @@
|
||||
<!doctype html>
|
||||
<html>
|
||||
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>Hello World</title>
|
||||
<base href="/">
|
||||
<script src="node_modules/core-js/client/shim.min.js"></script>
|
||||
<script src="node_modules/zone.js/dist/zone.js"></script>
|
||||
<script src="node_modules/systemjs/dist/system.src.js"></script>
|
||||
<script src="systemjs.config.js"></script>
|
||||
<script>
|
||||
System.import('main.ts').catch(function (err) { console.error(err); });
|
||||
</script>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<hello-world-app>Loading...</hello-world-app>
|
||||
</body>
|
||||
|
||||
</html>
|
4
integration/hello_world__systemjs_umd/src/main.ts
Normal file
4
integration/hello_world__systemjs_umd/src/main.ts
Normal file
@ -0,0 +1,4 @@
|
||||
import {platformBrowserDynamic} from '@angular/platform-browser-dynamic';
|
||||
import {AppModule} from './app/app';
|
||||
|
||||
platformBrowserDynamic().bootstrapModule(AppModule);
|
45
integration/hello_world__systemjs_umd/src/systemjs.config.js
Normal file
45
integration/hello_world__systemjs_umd/src/systemjs.config.js
Normal file
@ -0,0 +1,45 @@
|
||||
(function (global) {
|
||||
SystemJS.typescriptOptions = {
|
||||
"target": "es5",
|
||||
"module": "system",
|
||||
"moduleResolution": "node",
|
||||
"sourceMap": true,
|
||||
"emitDecoratorMetadata": true,
|
||||
"experimentalDecorators": true,
|
||||
"noImplicitAny": true,
|
||||
"suppressImplicitAnyIndexErrors": true
|
||||
};
|
||||
System.config({
|
||||
transpiler: 'ts',
|
||||
meta: {
|
||||
'typescript': {
|
||||
"exports": "ts"
|
||||
}
|
||||
},
|
||||
paths: {
|
||||
'npm:': 'node_modules/'
|
||||
},
|
||||
map: {
|
||||
app: 'app',
|
||||
'@angular/core': 'npm:@angular/core/bundles/core.umd.min.js',
|
||||
'@angular/common': 'npm:@angular/common/bundles/common.umd.min.js',
|
||||
'@angular/compiler': 'npm:@angular/compiler/bundles/compiler.umd.min.js',
|
||||
'@angular/platform-browser':
|
||||
'npm:@angular/platform-browser/bundles/platform-browser.umd.min.js',
|
||||
'@angular/platform-browser-dynamic':
|
||||
'npm:@angular/platform-browser-dynamic/bundles/platform-browser-dynamic.umd.min.js',
|
||||
'rxjs': 'npm:rxjs',
|
||||
'angular-in-memory-web-api': 'npm:angular-in-memory-web-api/bundles/in-memory-web-api.umd.js',
|
||||
'ts': 'npm:plugin-typescript/lib/plugin.js',
|
||||
'typescript': 'npm:typescript/lib/typescript.js',
|
||||
},
|
||||
packages: {
|
||||
app: {
|
||||
defaultExtension: 'ts'
|
||||
},
|
||||
rxjs: {
|
||||
defaultExtension: 'js'
|
||||
}
|
||||
}
|
||||
});
|
||||
})(this);
|
13
integration/hello_world__systemjs_umd/src/tsconfig.json
Normal file
13
integration/hello_world__systemjs_umd/src/tsconfig.json
Normal file
@ -0,0 +1,13 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"target": "es5",
|
||||
"module": "system",
|
||||
"moduleResolution": "node",
|
||||
"sourceMap": true,
|
||||
"emitDecoratorMetadata": true,
|
||||
"experimentalDecorators": true,
|
||||
"lib": [ "es2015", "dom" ],
|
||||
"noImplicitAny": true,
|
||||
"suppressImplicitAnyIndexErrors": true
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user