Skip to content

Commit 3a1624b

Browse files
committed
fix the building process with babel
1 parent bf883a0 commit 3a1624b

File tree

2 files changed

+11
-13
lines changed

2 files changed

+11
-13
lines changed

gruntfile.js

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,23 +2,20 @@ module.exports = function(grunt) {
22
// Project configuration.
33
grunt.initConfig({
44
pkg: grunt.file.readJSON("package.json"),
5-
babel: {
6-
options: {
7-
sourceMap: true
8-
},
9-
dist: {
10-
files: {
11-
"dist/app.js": "./src/index.js"
12-
}
13-
}
14-
},
155
browserify: {
166
options: {
177
banner:
188
"/*! <%= pkg.name %> - BSD3 License - <%= grunt.template.today('yyyy-mm-dd') %> */\n",
199
alias: {
2010
"php-parser": "./src/index.js"
21-
}
11+
},
12+
transform: [
13+
[
14+
"babelify", {
15+
"presets": ["es2015"]
16+
}
17+
]
18+
],
2219
},
2320
dist: {
2421
files: {
@@ -111,7 +108,7 @@ module.exports = function(grunt) {
111108
grunt.loadNpmTasks("grunt-babel");
112109

113110
// Default task(s).
114-
grunt.registerTask("build", ["babel", "browserify", "uglify"]);
111+
grunt.registerTask("build", ["browserify", "uglify"]);
115112
grunt.registerTask("doc", ["documentation"]);
116113
grunt.registerTask("release", ["browser", "doc"]);
117114
};

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,8 @@
2828
"author": "Ioan CHIRIAC",
2929
"license": "BSD-3-Clause",
3030
"devDependencies": {
31-
"babel-preset-env": "^1.6.1",
31+
"babel-preset-es2015": "^6.6.0",
32+
"babelify": "^7.2.0",
3233
"coveralls": "^2.11.15",
3334
"eslint": "^4.14.0",
3435
"eslint-config-prettier": "^2.9.0",

0 commit comments

Comments
 (0)