diff --git a/.babelrc b/.babelrc new file mode 100644 index 0000000..cbd3ac6 --- /dev/null +++ b/.babelrc @@ -0,0 +1,8 @@ +{ + "presets": [ + "es2015" + ], + "plugins": [ + "transform-runtime" + ] +} diff --git a/package.json b/package.json index 7c2441b..5ac7f55 100644 --- a/package.json +++ b/package.json @@ -115,6 +115,7 @@ "velocity-animate": "^1.4.0", "visibilityjs": "^1.2.4", "viz.js": "^1.4.1", + "vue": "^2.1.6", "winston": "^2.3.0", "xss": "^0.3.2" }, @@ -139,6 +140,12 @@ "url": "https://github.com/hackmdio/hackmd.git" }, "devDependencies": { + "babel-cli": "^6.18.0", + "babel-core": "^6.21.0", + "babel-loader": "^6.2.10", + "babel-plugin-transform-runtime": "^6.15.0", + "babel-preset-es2015": "^6.18.0", + "babel-runtime": "^6.20.0", "copy-webpack-plugin": "^4.0.1", "css-loader": "^0.26.1", "ejs-loader": "^0.3.0", diff --git a/public/js/cover.js b/public/js/cover.js index ee7d75e..4696203 100644 --- a/public/js/cover.js +++ b/public/js/cover.js @@ -28,6 +28,8 @@ var saveAs = require('file-saver').saveAs; var List = require('list.js'); var S = require('string'); +import Vue from 'vue'; + var options = { valueNames: ['id', 'text', 'timestamp', 'fromNow', 'time', 'tags', 'pinned'], item: '
  • \ diff --git a/webpackBaseConfig.js b/webpackBaseConfig.js index 400db14..5c715cc 100644 --- a/webpackBaseConfig.js +++ b/webpackBaseConfig.js @@ -372,6 +372,10 @@ module.exports = { loaders: [{ test: /\.json$/, loader: 'json-loader' + }, { + test: /\.js$/, + loader: 'babel', + exclude: [/node_modules/, /public\/vendor/] }, { test: /\.css$/, loader: ExtractTextPlugin.extract('style-loader', 'css-loader')