Skip to content

Commit 98cb1a0

Browse files
committed
fix(build): migrate to Babel 6
1 parent 4274c08 commit 98cb1a0

File tree

4 files changed

+18
-9
lines changed

4 files changed

+18
-9
lines changed

.babelrc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"plugins": ["transform-runtime"],
3+
"presets": ["es2015"]
4+
}

karma.conf.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ module.exports = function(config) {
2020
devtool: 'eval',
2121
module: {
2222
loaders: [
23-
{test: /\.js$/, loader: 'babel?optional[]=runtime&stage=1', exclude: /(\.test.js$|node_modules)/},
23+
{test: /\.js$/, loader: 'babel', exclude: /(\.test.js$|node_modules)/},
2424
{test: /\.css$/, loader: 'style!css'},
2525
{test: /\.tpl.html/, loader: 'html'},
2626
{test: /\.(png|jpg|gif|svg|eot|ttf|woff|woff2)$/, loader: 'url?limit=50000'}

package.json

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
"dist": "webpack --TARGET=DIST",
1010
"server_build": "node server.js",
1111
"server_dist": "node server.js --TARGET=DIST",
12-
"test": "mocha --compilers js:mocha-babel ./src/**/*.test.js",
12+
"test": "mocha --compilers js:babel-register ./src/**/*.test.js",
1313
"karma": "karma start"
1414
},
1515
"author": "tomas.trajan@gmail.com",
@@ -20,8 +20,6 @@
2020
"angular-highlightjs": "^0.4.3",
2121
"angular-ui-bootstrap": "^0.13.4",
2222
"angular-ui-router": "^0.2.15",
23-
"babel-core": "^5.8.20",
24-
"babel-runtime": "^5.8.20",
2523
"bootstrap": "^3.3.5",
2624
"highlight.js": "^8.8.0",
2725
"jquery": "^2.1.4",
@@ -30,8 +28,11 @@
3028
"devDependencies": {
3129
"angular-mocks": "^1.4.7",
3230
"awesome-typescript-loader": "^0.11.3",
33-
"babel": "^5.8.21",
34-
"babel-loader": "^5.3.2",
31+
"babel-core": "^6.4.0",
32+
"babel-loader": "^6.2.1",
33+
"babel-plugin-transform-runtime": "^6.4.3",
34+
"babel-preset-es2015": "^6.3.13",
35+
"babel-register": "^6.4.3",
3536
"chai": "^3.2.0",
3637
"chalk": "^1.1.0",
3738
"clean-webpack-plugin": "^0.1.3",
@@ -48,8 +49,8 @@
4849
"karma-webpack": "^1.7.0",
4950
"minimist": "^1.1.3",
5051
"mocha": "^2.2.5",
51-
"mocha-babel": "^3.0.0",
5252
"ngtemplate-loader": "^1.3.0",
53+
"open-browser-webpack-plugin": "0.0.2",
5354
"serve-static": "^1.10.0",
5455
"sinon": "^1.17.1",
5556
"style-loader": "^0.12.3",

webpack.config.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ var webpack = require('webpack');
55

66
var HtmlWebpackPlugin = require('html-webpack-plugin');
77
var CleanWebpackPlugin = require('clean-webpack-plugin');
8+
var OpenBrowserWebpackPlugin = require('open-browser-webpack-plugin');
89

910
var PARAMS_DEFAULT = {
1011
resolve: {
@@ -43,7 +44,10 @@ var PARAMS_PER_TARGET = {
4344
filename: '[name].js'
4445
},
4546
plugins: [
46-
new webpack.optimize.CommonsChunkPlugin('vendor', 'vendor.js')
47+
new webpack.optimize.CommonsChunkPlugin('vendor', 'vendor.js'),
48+
new OpenBrowserWebpackPlugin({
49+
url: 'http://localhost:' + PARAMS_DEFAULT.devServer.port
50+
})
4751
]
4852
},
4953
BUILD: {
@@ -82,7 +86,7 @@ module.exports = {
8286
output: params.output,
8387
module: {
8488
loaders: [
85-
{test: /\.js$/, loader: 'babel?optional[]=runtime&stage=1', exclude: /(\.test.js$|node_modules)/},
89+
{test: /\.js$/, loader: 'babel', exclude: /(\.test.js$|node_modules)/},
8690
{test: /\.css$/, loader: 'style!css'},
8791
{test: /\.tpl.html/, loader: 'html'},
8892
{test: /\.(png|jpg|gif|svg|eot|ttf|woff|woff2)$/, loader: 'url?limit=50000'}

0 commit comments

Comments
 (0)