Skip to content

Commit 980054b

Browse files
Update transpilation example to Babel 6 and remove system.js
1 parent 908bc6a commit 980054b

File tree

6 files changed

+9
-14
lines changed

6 files changed

+9
-14
lines changed
Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
Hello
22

33
@section scripts {
4-
<script src="lib/system.js"></script>
5-
<script>System.import('js/main.js');</script>
4+
<script src='js/main.js'></script>
65
}

samples/misc/ES2015Transpilation/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
"name": "ES2015Example",
33
"version": "0.0.0",
44
"dependencies": {
5-
"babel-core": "^5.8.29"
5+
"babel-core": "^6.7.4",
6+
"babel-preset-es2015": "^6.6.0"
67
}
78
}

samples/misc/ES2015Transpilation/transpilation.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ var babelCore = require('babel-core');
44
module.exports = function(cb, physicalPath, requestPath) {
55
var originalContents = fs.readFileSync(physicalPath);
66
var result = babelCore.transform(originalContents, {
7+
presets: ['es2015'],
78
sourceMaps: 'inline',
89
sourceFileName: '/sourcemapped' + requestPath
910
});

samples/misc/ES2015Transpilation/wwwroot/js/greeting.js

Lines changed: 0 additions & 5 deletions
This file was deleted.
Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1-
import Greeting from './greeting.js';
1+
class Greeting {
2+
getMessage() {
3+
return 'Hello from the ES2015 class';
4+
}
5+
}
26

37
console.log(new Greeting().getMessage());

samples/misc/ES2015Transpilation/wwwroot/lib/system.js

Lines changed: 0 additions & 5 deletions
This file was deleted.

0 commit comments

Comments
 (0)