This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// inside app.js | |
export class App {} | |
// inside domUtil.js | |
import jQuery from 'jquery' // comes from the node_modules directory | |
export var domUtil = {} | |
// inside another file | |
import {App} from './app' | |
import {domUtil as domStuff} from './domUtil' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module.exports = { | |
entry: './src/main', | |
module: { | |
loaders: [ | |
// Transpile any JavaScript file: | |
{ test: /\.js$/, loader: 'webpack-traceur?runtime&sourceMaps&experimental' } | |
] | |
}, | |
resolve: { | |
// you can now require('file') instead of require('file.js') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ npm start | |
> mocha-with-traceur@0.0.1 start /Users/uxebu/mocha-sinon-traceur-example | |
> webpack-dev-server | |
http://localhost:8080/webpack-dev-server/ | |
webpack result is served from / | |
content is served from /Users/uxebu/mocha-sinon-traceur-example | |
[traceur-loader]: Processing file: /Users/uxebu/mocha-sinon-traceur-example/src/main.js | |
[traceur-loader]: Current options are: { runtime: true, traceurOptions: {} } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module.exports = { | |
entry: './src/main', | |
module: { | |
loaders: [ | |
// Transpile any JavaScript file: | |
{ | |
test: /\.js$/, | |
loader: 'webpack-traceur?runtime', | |
exclude: /node_modules/ // <<<<===== prevent traceur to modify all from node_modules | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// should get loaded into tddbin |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
switch(points) { | |
case 0: return 'Love'; | |
case 1: return 'Fifteen'; | |
case 2: return 'Thirty'; | |
case 3: return 'Forty'; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pointsMap = [ | |
'Love', | |
'Fifteen', | |
'Thirty', | |
'Forty' | |
]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pointsMap = { | |
0: 'Love', | |
1: 'Fifteen', | |
2: 'Thirty', | |
3: 'Forty' | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function callTie(points) { | |
if (points < 3) { | |
var pointsMap = { | |
0: 'Love-All', | |
1: 'Fifteen-All', | |
2: 'Thirty-All' | |
}; | |
return pointsMap[points]; | |
} | |
return 'Deuce'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var pointsMap = { | |
0: 'Love-All', | |
1: 'Fifteen-All', | |
2: 'Thirty-All' | |
}; | |
function callTie(points) { | |
if (points < 3) { | |
return pointsMap[points]; | |
} |
OlderNewer