Skip to content
This repository has been archived by the owner on Feb 8, 2019. It is now read-only.

Commit

Permalink
feat(babel): upgrade to babel6
Browse files Browse the repository at this point in the history
  • Loading branch information
kazupon committed Dec 5, 2015
1 parent 6556006 commit 44aab65
Show file tree
Hide file tree
Showing 7 changed files with 133 additions and 17 deletions.
1 change: 1 addition & 0 deletions config/karma.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ module.exports = function (config) {
exclude: /node_modules/,
loader: 'babel',
query: {
presets: ['es2015'],
plugins: ['babel-plugin-espower']
}
}],
Expand Down
14 changes: 13 additions & 1 deletion config/webpack.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,25 @@ var webpack = require('webpack')
var banner = require('./banner')

module.exports = {
entry: './lib/index.js',
entry: './src/index',
output: {
path: './dist',
filename: pack.name + '.js',
library: pack.name,
libraryTarget: 'umd'
},
module: {
loaders: [{
test: /\.js$/,
loader: 'babel',
query: {
presets: ['es2015'],
plugins: [
['transform-es2015-modules-commonjs', { loose: true }]
]
}
}]
},
plugins: [
new webpack.BannerPlugin(banner)
]
Expand Down
14 changes: 13 additions & 1 deletion config/webpack.min.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,25 @@ var webpack = require('webpack')
var banner = require('./banner')

module.exports = {
entry: './lib/index.js',
entry: './src/index',
output: {
path: './dist',
filename: pack.name + '.min.js',
library: pack.name,
libraryTarget: 'umd'
},
module: {
loaders: [{
test: /\.js$/,
loader: 'babel',
query: {
presets: ['es2015'],
plugins: [
['transform-es2015-modules-commonjs', { loose: true }]
]
}
}]
},
plugins: [
new webpack.BannerPlugin(banner),
new webpack.optimize.UglifyJsPlugin({
Expand Down
77 changes: 77 additions & 0 deletions dist/vue-plugin-boilerplate.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
/*!
* vue-plugin-boilerplate v1.0.0
* (c) 2015 kazuya kawaguchi
* Released under the MIT License.
*/
(function webpackUniversalModuleDefinition(root, factory) {
if(typeof exports === 'object' && typeof module === 'object')
module.exports = factory();
else if(typeof define === 'function' && define.amd)
define([], factory);
else if(typeof exports === 'object')
exports["vue-plugin-boilerplate"] = factory();
else
root["vue-plugin-boilerplate"] = factory();
})(this, function() {
return /******/ (function(modules) { // webpackBootstrap
/******/ // The module cache
/******/ var installedModules = {};

/******/ // The require function
/******/ function __webpack_require__(moduleId) {

/******/ // Check if module is in cache
/******/ if(installedModules[moduleId])
/******/ return installedModules[moduleId].exports;

/******/ // Create a new module (and put it into the cache)
/******/ var module = installedModules[moduleId] = {
/******/ exports: {},
/******/ id: moduleId,
/******/ loaded: false
/******/ };

/******/ // Execute the module function
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);

/******/ // Flag the module as loaded
/******/ module.loaded = true;

/******/ // Return the exports of the module
/******/ return module.exports;
/******/ }


/******/ // expose the modules object (__webpack_modules__)
/******/ __webpack_require__.m = modules;

/******/ // expose the module cache
/******/ __webpack_require__.c = installedModules;

/******/ // __webpack_public_path__
/******/ __webpack_require__.p = "";

/******/ // Load entry module and return exports
/******/ return __webpack_require__(0);
/******/ })
/************************************************************************/
/******/ ([
/* 0 */
/***/ function(module, exports) {

"use strict";

exports.__esModule = true;

exports.default = function (Vue) {
var options = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1];

Vue.prototype.$add = function (a, b) {
return a + b;
};
};

/***/ }
/******/ ])
});
;
6 changes: 6 additions & 0 deletions dist/vue-plugin-boilerplate.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

36 changes: 22 additions & 14 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,26 +10,32 @@
"url": "https://github.com/kazupon/vue-plugin-boilerplate/issues"
},
"devDependencies": {
"babel": "^5.8.23",
"babel-core": "^5.8.23",
"babel-loader": "^5.3.2",
"babel-plugin-espower": "^1.0.0",
"eslint": "^1.3.1",
"babel-core": "^6.2.1",
"babel-loader": "^6.2.0",
"babel-plugin-espower": "^2.0.0",
"babel-plugin-transform-es2015-modules-commonjs": "^6.3.13",
"babel-preset-es2015": "^6.1.18",
"eslint": "^1.10.2",
"istanbul-instrumenter-loader": "^0.1.3",
"json-loader": "^0.5.2",
"json-loader": "^0.5.4",
"karma": "^0.13.9",
"karma-coverage": "^0.5.2",
"karma-mocha": "^0.2.0",
"karma-mocha-reporter": "^1.1.1",
"karma-phantomjs-launcher": "^0.2.1",
"karma-sourcemap-loader": "^0.3.5",
"karma-webpack": "^1.7.0",
"mocha": "^2.3.1",
"mocha": "^2.3.4",
"phantomjs": "^1.9.18",
"power-assert": "^1.0.0",
"vue": "^0.12.13",
"webpack": "^1.12.1"
"power-assert": "^1.2.0",
"vue": "^1.0.10",
"webpack": "^1.12.9"
},
"files": [
"dist/vue-plugin-boilerplate.js",
"dist/vue-plugin-boilerplate.min.js",
"src"
],
"homepage": "https://github.com/kazupon/vue-plugin-boilerplate#readme",
"keywords": [
"boilerplate",
Expand All @@ -39,16 +45,18 @@
],
"license": "MIT",
"main": "dist/vue-plugin-boilerplate.js",
"private": true,
"repository": {
"type": "git",
"url": "git+https://github.com/kazupon/vue-plugin-boilerplate.git"
},
"scripts": {
"build": "babel src --out-dir lib --source-maps-inline",
"bundle": "webpack --config config/webpack.conf.js && webpack --config config/webpack.min.conf.js",
"clean": "rm -rf lib && rm -rf coverage && rm -rf dist",
"build": "webpack --config config/webpack.conf.js",
"clean": "rm -rf coverage && rm -rf dist",
"dist": "npm run build && npm run minify",
"lint": "eslint src test config",
"minify": "webpack --config config/webpack.min.conf.js",
"test": "karma start config/karma.conf.js",
"watch": "babel src --out-dir lib --watch --source-maps-inline"
"watch": "webpack --watch --config config/webpack.conf.js"
}
}
2 changes: 1 addition & 1 deletion test/index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import assert from 'power-assert'
import Vue from 'vue'
import plugin from '../src/index.js'
import plugin from '../src/index'

describe('$add', () => {
let vm
Expand Down

0 comments on commit 44aab65

Please sign in to comment.