Skip to content
This repository was archived by the owner on Dec 1, 2023. It is now read-only.

Commit f9f9092

Browse files
author
Steffan
committed
add babel, update storybook and deps
1 parent 9acf977 commit f9f9092

File tree

6 files changed

+2461
-3149
lines changed

6 files changed

+2461
-3149
lines changed

.babelrc

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"presets": [
3+
["@babel/preset-env", {
4+
"loose": true,
5+
"modules": false
6+
}]
7+
]
8+
}

.storybook/webpack.config.js

-14
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,9 @@
11
const path = require('path');
2-
const VueLoaderPlugin = require('vue-loader/lib/plugin')
32

43
module.exports = (baseConfig, configType, config) => {
54

6-
// remove babel-loader
7-
config.module.rules.shift();
8-
9-
// add buble-loader
10-
config.module.rules.unshift({
11-
test: /\.js$/,
12-
exclude: /node_modules/,
13-
use: 'buble-loader'
14-
});
15-
165
// add alias
176
config.resolve.alias['vue-event-manager'] = path.resolve(__dirname, '../src')
187

19-
// https://github.com/storybooks/storybook/issues/3267
20-
config.plugins.push(new VueLoaderPlugin());
21-
228
return config;
239
};

build/build.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ const fs = require('fs');
44
const zlib = require('zlib');
55
const rollup = require('rollup');
66
const uglify = require('uglify-js');
7-
const buble = require('rollup-plugin-buble');
7+
const babel = require('rollup-plugin-babel');
88
const replace = require('rollup-plugin-replace');
99
const {name, version, homepage} = require('../package.json');
1010
const banner =
@@ -16,7 +16,7 @@ const banner =
1616

1717
rollup.rollup({
1818
input: 'src/index.js',
19-
plugins: [buble(), replace({__VERSION__: version})]
19+
plugins: [babel(), replace({__VERSION__: version})]
2020
})
2121
.then(bundle =>
2222
bundle.generate({

package.json

+17-17
Original file line numberDiff line numberDiff line change
@@ -24,33 +24,33 @@
2424
"karma": "karma start test/karma.conf.js --single-run",
2525
"build": "node ./build/build.js",
2626
"release": "node ./build/release.js",
27-
"webpack": "webpack",
2827
"eslint": "eslint .",
2928
"eslint-fix": "eslint . --fix",
3029
"storybook": "start-storybook -c .storybook -p 9001"
3130
},
3231
"devDependencies": {
33-
"@storybook/addon-actions": "^3.4.10",
34-
"@storybook/vue": "^3.4.10",
35-
"buble": "^0.19.3",
36-
"buble-loader": "^0.5.1",
37-
"eslint": "^5.5.0",
38-
"jasmine": "^3.1.0",
39-
"jasmine-core": "^3.2.1",
40-
"karma": "^2.0.0",
32+
"@babel/core": "^7.1.6",
33+
"@babel/preset-env": "^7.1.6",
34+
"@storybook/addon-actions": "^4.0.9",
35+
"@storybook/vue": "^4.0.9",
36+
"babel-loader": "^8.0.4",
37+
"babel-preset-vue": "^2.0.2",
38+
"eslint": "^5.9.0",
39+
"jasmine": "^3.3.0",
40+
"jasmine-core": "^3.3.0",
41+
"karma": "^3.1.1",
4142
"karma-chrome-launcher": "^2.2.0",
4243
"karma-firefox-launcher": "^1.1.0",
43-
"karma-jasmine": "^1.1.1",
44+
"karma-jasmine": "^2.0.1",
4445
"karma-safari-launcher": "^1.0.0",
45-
"karma-webpack": "^2.0.9",
46+
"karma-webpack": "^3.0.5",
4647
"replace-in-file": "^3.4.2",
47-
"rollup": "^0.65.2",
48-
"rollup-plugin-buble": "^0.19.2",
49-
"rollup-plugin-replace": "^2.0.0",
48+
"rollup": "^0.67.3",
49+
"rollup-plugin-babel": "^4.0.3",
50+
"rollup-plugin-replace": "^2.1.0",
5051
"uglify-js": "^3.4.9",
5152
"vue": "^2.5.17",
52-
"vue-loader": "^15.4.1",
53-
"vue-template-compiler": "^2.5.17",
54-
"webpack": "^3.10.0"
53+
"vue-loader": "^15.4.2",
54+
"vue-template-compiler": "^2.5.17"
5555
}
5656
}

webpack.config.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
module.exports = {
44

5+
mode: 'production',
6+
57
entry: {
68
'test/specs': './test/index',
79
},
@@ -21,7 +23,7 @@ module.exports = {
2123
{
2224
test: /\.js$/,
2325
exclude: /node_modules/,
24-
use: 'buble-loader'
26+
use: 'babel-loader'
2527
}
2628
]
2729
}

0 commit comments

Comments
 (0)