Skip to content

Commit 229ea0c

Browse files
committed
improve build/test config
1 parent b7be7fd commit 229ea0c

File tree

5 files changed

+204
-188
lines changed

5 files changed

+204
-188
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
.DS_Store
22
node_modules
33
coverage
4+
dist

karma.conf.js

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,27 @@
1+
var path = require('path')
2+
13
module.exports = function (config) {
24
config.set({
35
frameworks: ['jasmine'],
46
browsers: ['PhantomJS'],
5-
reporters: ['progress', 'coverage'],
7+
reporters: ['spec', 'coverage'],
68
files: [
7-
'node_modules/vue/dist/vue.js',
8-
'src/*.js',
9-
'tests/*.js'
9+
'tests/vuefire.spec.js'
1010
],
1111
preprocessors: {
12-
'src/*.js': 'coverage'
12+
'tests/vuefire.spec.js': ['webpack', 'sourcemap']
13+
},
14+
webpack: {
15+
devtool: '#inline-source-map',
16+
module: {
17+
loaders: [{
18+
include: path.resolve(__dirname, 'src/vuefire.js'),
19+
loader: 'istanbul-instrumenter'
20+
}]
21+
}
22+
},
23+
webpackMiddleware: {
24+
noInfo: true
1325
},
1426
coverageReporter: {
1527
reporters: [

package.json

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,10 @@
55
"main": "src/vuefire.js",
66
"scripts": {
77
"lint": "eslint --ext=js,html src tests examples karma.conf.js",
8-
"test": "npm run lint && karma start karma.conf.js --single-run"
8+
"test": "npm run lint && karma start karma.conf.js --single-run",
9+
"build-dev": "webpack src/vuefire.js dist/vuefire.js --output-library=VueFire --output-library-target=umd",
10+
"build-prod": "webpack src/vuefire.js dist/vuefire.min.js --output-library=VueFire --output-library-target=umd -p",
11+
"build": "npm run build-dev && npm run build-prod"
912
},
1013
"repository": {
1114
"type": "git",
@@ -29,12 +32,18 @@
2932
"eslint-plugin-html": "^1.4.0",
3033
"eslint-plugin-promise": "^1.1.0",
3134
"eslint-plugin-standard": "^1.3.2",
35+
"firebase": "^2.4.1",
36+
"istanbul-instrumenter-loader": "^0.2.0",
3237
"jasmine-core": "^2.4.1",
3338
"karma": "^0.13.22",
3439
"karma-coverage": "^0.5.5",
3540
"karma-jasmine": "^0.3.8",
3641
"karma-phantomjs-launcher": "^1.0.0",
42+
"karma-sourcemap-loader": "^0.3.7",
43+
"karma-spec-reporter": "0.0.24",
44+
"karma-webpack": "^1.7.0",
3745
"phantomjs-prebuilt": "^2.1.3",
38-
"vue": "^1.0.19"
46+
"vue": "^1.0.19",
47+
"webpack": "^1.12.14"
3948
}
4049
}

0 commit comments

Comments
 (0)