Browse Source

[MIN] added the Babel Object Rest Plugin (#4589)

* added rest operator for babel

* added package-lock.json to .gitignore

* removed package-lock.json
version-14
Achilles Rasquinha 7 years ago
committed by Faris Ansari
parent
commit
c87172345f
3 changed files with 8 additions and 1 deletions
  1. +5
    -1
      .gitignore
  2. +2
    -0
      frappe/build.js
  3. +1
    -0
      package.json

+ 5
- 1
.gitignore View File

@@ -10,4 +10,8 @@ dist/
build/ build/
frappe/docs/current frappe/docs/current
.vscode .vscode
node_modules
node_modules


# Not Recommended, but will remove once webpack ready
package-lock.json

+ 2
- 0
frappe/build.js View File

@@ -154,11 +154,13 @@ function get_compiled_file(file, output_path, minify, force_compile) {


function babelify(content, path, minify) { function babelify(content, path, minify) {
let presets = ['env']; let presets = ['env'];
var plugins = ['transform-object-rest-spread']
// Minification doesn't work when loading Frappe Desk // Minification doesn't work when loading Frappe Desk
// Avoid for now, trace the error and come back. // Avoid for now, trace the error and come back.
try { try {
return babel.transform(content, { return babel.transform(content, {
presets: presets, presets: presets,
plugins: plugins,
comments: false comments: false
}).code; }).code;
} catch (e) { } catch (e) {


+ 1
- 0
package.json View File

@@ -23,6 +23,7 @@
}, },
"devDependencies": { "devDependencies": {
"babel-core": "^6.26.0", "babel-core": "^6.26.0",
"babel-plugin-transform-object-rest-spread": "^6.26.0",
"babel-preset-env": "^1.6.0", "babel-preset-env": "^1.6.0",
"babel-preset-minify": "^0.2.0", "babel-preset-minify": "^0.2.0",
"chokidar": "^1.7.0", "chokidar": "^1.7.0",


Loading…
Cancel
Save