Skip to content

Commit

Permalink
Merge babel config and add jscript fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
neersighted committed Jan 13, 2016
1 parent f40f4ed commit e9ccc6c
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 7 deletions.
9 changes: 9 additions & 0 deletions tgui/.babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"presets": [
"es2015"
],
"plugins": [
"transform-jscript",
"external-helpers-2"
]
}
2 changes: 1 addition & 1 deletion tgui/assets/tgui.js

Large diffs are not rendered by default.

11 changes: 5 additions & 6 deletions tgui/gulp/tasks/js.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,11 @@ through = require "through2"


b.componentify.compilers["text/javascript"] = (source, file) ->
compiled = babel.transform source,
fs = require "fs"
config =
sourceMaps: true
presets: ["es2015"]
plugins: ["external-helpers-2"]
Object.assign config, JSON.parse fs.readFileSync(".babelrc", "utf8")
compiled = babel.transform source, config

output =
source: compiled.code
Expand Down Expand Up @@ -45,9 +46,7 @@ bundle = ->
browserify file.path,
extensions: [".js", ".coffee", ".ract"]
debug: f.debug
.transform b.babelify,
presets: ["es2015"]
plugins: ["external-helpers-2"]
.transform b.babelify
.plugin b.helpers
.transform b.coffeeify
.transform b.componentify
Expand Down
1 change: 1 addition & 0 deletions tgui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"dependencies": {
"autoprefixer": "~6.2.3",
"babel-plugin-external-helpers-2": "~6.3.13",
"babel-plugin-transform-jscript": "~6.4.0",
"babel-preset-es2015": "~6.3.13",
"babelify": "~7.2.0",
"babelify-external-helpers": "~1.0.0",
Expand Down

0 comments on commit e9ccc6c

Please sign in to comment.