Repository: zeppelin Updated Branches: refs/heads/master 296a448e1 -> 252055571
[ZEPPELIN-2166] HeliumBundleFactoty can't transfile imported es6+ ### What is this PR for? Currently, we don't use any preset. This cause error messages like when a helium package imports another packages which include es6+ syntax. ``` SyntaxError: Unexpected token import at helium.service.js:36 at angular.js:10973 at processQueue (angular.js:15552) at angular.js:15568 at Scope.$eval (angular.js:16820) at Scope.$digest (angular.js:16636) at Scope.$apply (angular.js:16928) at done (angular.js:11266) at completeRequest (angular.js:11464) at XMLHttpRequest.requestLoaded (angular.js:11405) ``` - https://github.com/1ambda/zeppelin-advanced-transformation/blob/master/examples/example-highcharts-columnrange/index.js#L3 - https://github.com/1ambda/zeppelin-advanced-transformation/blob/master/index.js#L11 ### What type of PR is it? [Improvement] ### Todos * [x] - Install required NPM packages * [x] - fix babel configuration ### What is the Jira issue? [ZEPPELIN-2166](https://issues.apache.org/jira/browse/ZEPPELIN-2166) ### How should this be tested? - Should be able to bundle existing helium vis - Should be able to bundle https://github.com/1ambda/zeppelin-advanced-transformation/tree/master/examples/example-highcharts-columnrange ### Screenshots (if appropriate) NONE ### Questions: * Does the licenses files need update? - NONE * Is there breaking changes for older versions? - NONE * Does this needs documentation? - NONE Author: 1ambda <1am...@gmail.com> Closes #2071 from 1ambda/ZEPPELIN-2166/fix-webpack-config-for-es6 and squashes the following commits: 40f6b51 [1ambda] fix: Update babel configuration Project: http://git-wip-us.apache.org/repos/asf/zeppelin/repo Commit: http://git-wip-us.apache.org/repos/asf/zeppelin/commit/25205557 Tree: http://git-wip-us.apache.org/repos/asf/zeppelin/tree/25205557 Diff: http://git-wip-us.apache.org/repos/asf/zeppelin/diff/25205557 Branch: refs/heads/master Commit: 252055571bfb444696ddae86b3a4dac24fa16ddf Parents: 296a448 Author: 1ambda <1am...@gmail.com> Authored: Mon Feb 27 11:35:38 2017 +0900 Committer: Lee moon soo <m...@apache.org> Committed: Mon Mar 6 11:59:32 2017 +0900 ---------------------------------------------------------------------- .../src/main/resources/helium/package.json | 6 ++++-- .../src/main/resources/helium/webpack.config.js | 16 ++++++---------- 2 files changed, 10 insertions(+), 12 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/zeppelin/blob/25205557/zeppelin-zengine/src/main/resources/helium/package.json ---------------------------------------------------------------------- diff --git a/zeppelin-zengine/src/main/resources/helium/package.json b/zeppelin-zengine/src/main/resources/helium/package.json index cd4e470..a6752c8 100644 --- a/zeppelin-zengine/src/main/resources/helium/package.json +++ b/zeppelin-zengine/src/main/resources/helium/package.json @@ -9,7 +9,9 @@ }, "devDependencies": { "webpack": "^1.12.2", - "babel": "^5.8.23", - "babel-loader": "^5.3.2" + "babel-core": "^6.23.1", + "babel-loader": "^6.3.2", + "babel-preset-es2015": "^6.22.0", + "babel-preset-stage-0": "^6.22.0" } } http://git-wip-us.apache.org/repos/asf/zeppelin/blob/25205557/zeppelin-zengine/src/main/resources/helium/webpack.config.js ---------------------------------------------------------------------- diff --git a/zeppelin-zengine/src/main/resources/helium/webpack.config.js b/zeppelin-zengine/src/main/resources/helium/webpack.config.js index c318c10..69592ae 100644 --- a/zeppelin-zengine/src/main/resources/helium/webpack.config.js +++ b/zeppelin-zengine/src/main/resources/helium/webpack.config.js @@ -14,20 +14,16 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + module.exports = { - entry: ['./'], - output: { - path: './', - filename: 'helium.bundle.js', - }, - resolve: { - root: __dirname + "/node_modules" - }, + entry: './load.js', + output: { path: './', filename: 'helium.bundle.js', }, module: { loaders: [{ test: /\.js$/, - //exclude: /node_modules/, - loader: 'babel-loader' + // DON'T exclude. since zeppelin will bundle all necessary packages: `exclude: /node_modules/,` + loader: 'babel-loader', + query: { presets: ['es2015', 'stage-0'] }, }] } }