Skip to content

Commit f206e7c

Browse files
Merge pull request microsoft#67 from johnnyreilly/master
Upgraded to Babel 6
2 parents 3de61cb + e37089f commit f206e7c

File tree

8 files changed

+32
-21
lines changed

8 files changed

+32
-21
lines changed

es6-babel-react-flux-karma/karma.conf.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ module.exports = function(config) {
99
browsers: [ 'PhantomJS' ],
1010

1111
files: [
12-
'src/dependencies.ts', // This ensures we have the es6 shims in place from babel
12+
'test/import-babel-polyfill.js', // This ensures we have the es6 shims in place from babel
1313
'test/**/*.tests.ts',
1414
'test/**/*.tests.tsx'
1515
],
@@ -21,6 +21,7 @@ module.exports = function(config) {
2121
logLevel: config.LOG_INFO, //config.LOG_DEBUG
2222

2323
preprocessors: {
24+
'test/import-babel-polyfill.js': [ 'webpack', 'sourcemap' ],
2425
'src/**/*.{ts,tsx}': [ 'webpack', 'sourcemap' ],
2526
'test/**/*.tests.{ts,tsx}': [ 'webpack', 'sourcemap' ]
2627
},

es6-babel-react-flux-karma/package.json

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
2-
"name": "globalize-so-what-cha-want",
3-
"version": "0.10.0",
4-
"description": "Tell me what Globalize 1.x modules you want to use, I'll tell you what you need.",
2+
"name": "es6-babel-react-flux-karma",
3+
"version": "1.0.0",
4+
"description": "ES6 + TypeScript + Babel + React + Karma: The Secret Recipe",
55
"main": "index.js",
66
"scripts": {
77
"test": "karma start --reporters mocha,junit --single-run --browsers PhantomJS",
@@ -11,7 +11,7 @@
1111
},
1212
"repository": {
1313
"type": "git",
14-
"url": "git+https://github.com/johnnyreilly/globalize-so-what-cha-want.git"
14+
"url": "git+https://github.com/microsoft/typescriptsamples.git"
1515
},
1616
"keywords": [
1717
"Globalize",
@@ -22,13 +22,16 @@
2222
"author": "John Reilly",
2323
"license": "MIT",
2424
"bugs": {
25-
"url": "https://github.com/johnnyreilly/globalize-so-what-cha-want/issues"
25+
"url": "https://github.com/microsoft/typescriptsamples/issues"
2626
},
27-
"homepage": "https://github.com/johnnyreilly/globalize-so-what-cha-want#readme",
27+
"homepage": "https://github.com/Microsoft/TypeScriptSamples/tree/master/es6-babel-react-flux-karma#readme",
2828
"devDependencies": {
29-
"babel": "^5.8.23",
30-
"babel-core": "^5.8.25",
31-
"babel-loader": "^5.3.2",
29+
"babel": "^6.0.0",
30+
"babel-core": "^6.0.0",
31+
"babel-loader": "^6.0.0",
32+
"babel-polyfill": "^6.0.0",
33+
"babel-preset-es2015": "^6.0.0",
34+
"babel-preset-react": "^6.0.0",
3235
"del": "^2.0.2",
3336
"eslint": "^1.6.0",
3437
"flux": "^2.0.3",

es6-babel-react-flux-karma/src/dependencies.ts

Lines changed: 0 additions & 1 deletion
This file was deleted.

es6-babel-react-flux-karma/src/main.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import './dependencies';
1+
import 'babel-polyfill';
22
import * as React from 'react';
33
import * as ReactDOM from 'react-dom';
44
import App from './components/App';

es6-babel-react-flux-karma/src/tsconfig.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,14 @@
2525
"components/Greeting.tsx",
2626
"components/WhoToGreet.tsx",
2727
"constants/action-types/GreetingActionTypes.ts",
28-
"dependencies.ts",
2928
"dispatcher/AppDispatcher.ts",
3029
"main.tsx",
3130
"stores/FluxStore.ts",
3231
"stores/GreetingStore.ts",
3332
"types/GreetingState.ts"
3433
],
35-
"exclude": []
34+
"exclude": [],
35+
"atom": {
36+
"rewriteTsconfig": true
37+
}
3638
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
import 'babel-polyfill';

es6-babel-react-flux-karma/test/tsconfig.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,5 +27,8 @@
2727
"../typings/react/react.d.ts",
2828
"../typings/tsd.d.ts"
2929
],
30-
"exclude": []
30+
"exclude": [],
31+
"atom": {
32+
"rewriteTsconfig": true
33+
}
3134
}

es6-babel-react-flux-karma/webpack.config.js

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,16 @@
22
'use strict';
33

44
var path = require('path');
5-
// var webpack = require('webpack');
65

76
module.exports = {
87
cache: true,
98
entry: {
109
main: './src/main.tsx',
1110
vendor: [
12-
'react',
13-
'flux',
11+
'babel-polyfill',
1412
'events',
15-
'babel/polyfill'
13+
'flux',
14+
'react'
1615
]
1716
},
1817
output: {
@@ -24,11 +23,14 @@ module.exports = {
2423
loaders: [{
2524
test: /\.ts(x?)$/,
2625
exclude: /node_modules/,
27-
loader: 'babel-loader!ts-loader'
26+
loader: 'babel-loader?presets[]=es2015&presets[]=react!ts-loader'
2827
}, {
2928
test: /\.js$/,
3029
exclude: /node_modules/,
31-
loader: 'babel'
30+
loader: 'babel',
31+
query: {
32+
presets: ['es2015', 'react']
33+
}
3234
}]
3335
},
3436
plugins: [

0 commit comments

Comments
 (0)