Skip to content

Commit 6b74bb6

Browse files
committed
[Refactor] Remove babel from project
1 parent e27399a commit 6b74bb6

File tree

7 files changed

+13
-48
lines changed

7 files changed

+13
-48
lines changed

.babelrc

Lines changed: 0 additions & 9 deletions
This file was deleted.

build/webpack.base.conf.js

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -30,14 +30,6 @@ module.exports = {
3030
test: /\.vue$/,
3131
loader: 'vue',
3232
},
33-
{
34-
test: /\.js$/,
35-
loader: 'babel',
36-
include: [
37-
path.join(projectRoot, 'example'),
38-
],
39-
exclude: /node_modules/,
40-
},
4133
{
4234
test: /\.json$/,
4335
loader: 'json',

example/App.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
</template>
44

55
<script>
6-
import Clock from '../Clock';
6+
const Clock = require('../Clock');
77
8-
export default {
8+
module.exports = {
99
name: 'app',
1010
components: {
1111
Clock,

example/main.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// The Vue build version to load with the `import` command
22
// (runtime-only or standalone) has been set in webpack.base.conf with an alias.
3-
import Vue from 'vue';
4-
import App from './App';
3+
const Vue = require('vue');
4+
const App = require('./App');
55

66
/* eslint-disable no-new */
77
new Vue({

package.json

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"scripts": {
88
"dev": "node build/dev-server.js",
99
"build": "node build/build.js",
10-
"unit": "cross-env BABEL_ENV=test karma start test/unit/karma.conf.js --single-run",
10+
"unit": "karma start test/unit/karma.conf.js --single-run",
1111
"test": "npm run unit",
1212
"lint:fix": "eslint --ext .js,.vue Clock.vue test/unit/specs --fix"
1313
},
@@ -38,16 +38,9 @@
3838
},
3939
"devDependencies": {
4040
"avoriaz": "^1.8.2",
41-
"babel-core": "^6.0.0",
42-
"babel-eslint": "^7.0.0",
43-
"babel-loader": "^6.0.0",
44-
"babel-plugin-istanbul": "^3.0.0",
45-
"babel-preset-es2015": "^6.0.0",
46-
"babel-preset-stage-2": "^6.0.0",
47-
"babel-register": "^6.0.0",
4841
"chai": "^3.5.0",
4942
"chalk": "^1.1.3",
50-
"connect-history-api-fallback": "^1.1.0",
43+
"connect-history-api-fallba§ck": "^1.1.0",
5144
"cross-env": "^3.1.4",
5245
"css-loader": "^0.25.0",
5346
"eslint": "^3.7.1",

test/unit/karma.conf.js

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,6 @@ const config = require('../../config');
1313

1414
const webpackConfig = merge(baseConfig, {
1515
devtool: '#inline-source-map',
16-
vue: {
17-
loaders: {
18-
js: 'babel-loader'
19-
}
20-
},
2116
plugins: [
2217
new webpack.DefinePlugin({
2318
'process.env': config.test.env
@@ -42,9 +37,9 @@ module.exports = function (config) {
4237
// 1. install corresponding karma launcher
4338
// http://karma-runner.github.io/0.13/config/browsers.html
4439
// 2. add it to the `browsers` array below.
45-
browsers: ['Chrome','PhantomJS'],
40+
browsers: ['Chrome'],
4641
frameworks: ['mocha', 'sinon-chai'],
47-
reporters: ['spec', 'coverage'],
42+
reporters: ['spec'],
4843
files: ['./index.js'],
4944
preprocessors: {
5045
'./index.js': ['webpack', 'sourcemap']
@@ -53,12 +48,5 @@ module.exports = function (config) {
5348
webpackMiddleware: {
5449
noInfo: true,
5550
},
56-
coverageReporter: {
57-
dir: './coverage',
58-
reporters: [
59-
{ type: 'lcov', subdir: '.' },
60-
{ type: 'text-summary' },
61-
]
62-
},
6351
});
6452
};

test/unit/specs/Clock.spec.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1-
import { mount } from 'avoriaz';
2-
import { expect } from 'chai';
3-
import sinon from 'sinon';
4-
import Clock from '../../../Clock';
1+
const mount = require('avoriaz').mount;
2+
const expect = require('chai').expect;
3+
const sinon = require('sinon');
4+
const Clock = require('../../../Clock');
5+
56

67
const seconds = (1000);
78
const minutes = (60 * seconds);

0 commit comments

Comments
 (0)