Skip to content

Commit b581eb4

Browse files
committed
generated + added build
1 parent 46fceb2 commit b581eb4

File tree

8 files changed

+40
-10
lines changed

8 files changed

+40
-10
lines changed

.babelrc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"presets": [
3+
["es2015", {"modules": false}]
4+
]
5+
}

README.md

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,9 @@ A simple bootstrap styled Vue component for notifications. Compatible with Vue 2
44

55
## Install
66

7-
`$ npm install vue2-notify --save`
7+
```
8+
$ npm install vue2-notify --save
9+
```
810

911
Then in your main.js:
1012

@@ -19,11 +21,15 @@ Vue.use(Notify)
1921

2022
Inside your component:
2123

22-
`this.$notify('A message that should be displayed', 'type')`
24+
```
25+
this.$notify('A message that should be displayed', 'type')
26+
```
2327

2428
or
2529

26-
`Vue.$notify('A message that should be displayed', 'type')`
30+
```
31+
Vue.$notify('A message that should be displayed', 'type')
32+
```
2733

2834

2935
Type should be one of the types defined in the configuration of the component.

build/prod.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
module.exports = () => {
2+
require('../src/notify.js')
3+
require('../src/notify.vue')
4+
}

dist/build.js

Lines changed: 9 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/build.js.map

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,26 +8,27 @@
88
"dev": "cross-env NODE_ENV=development webpack-dev-server --open --hot",
99
"build": "cross-env NODE_ENV=production webpack --progress --hide-modules"
1010
},
11-
"dependencies": {
12-
"velocity-animate": "^1.5.0",
13-
"vue": "^2.3.3"
14-
},
1511
"repository": {
1612
"type": "git",
1713
"url": "https://github.com/websmurf/vue2-notify"
1814
},
1915
"bugs": {
2016
"url": "https://github.com/websmurf/vue2-notify/issues"
2117
},
18+
"dependencies": {
19+
"velocity-animate": "^1.5.0"
20+
},
2221
"devDependencies": {
2322
"babel-core": "^6.0.0",
2423
"babel-loader": "^6.0.0",
2524
"babel-preset-env": "^1.5.1",
25+
"babel-preset-es2015": "^6.24.1",
2626
"cross-env": "^3.0.0",
2727
"css-loader": "^0.25.0",
2828
"file-loader": "^0.9.0",
2929
"node-sass": "^4.5.0",
3030
"sass-loader": "^5.0.1",
31+
"vue": "^2.0.0",
3132
"vue-loader": "^12.1.0",
3233
"vue-template-compiler": "^2.3.3",
3334
"webpack": "^2.6.1",

src/notify.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
'use strict'
2-
import VeuNotify from './notify.vue'
2+
import VueNotify from './notify.vue'
33

44
export default {
55
install (Vue, options = {}) {
66
// Create component instance
7-
let Constr = Vue.extend(VeuNotify)
7+
let Constr = Vue.extend(VueNotify)
88
let Notify = new Constr()
99

1010
// Mount it

webpack.config.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
var path = require('path')
2+
var entry = process.env.NODE_ENV === 'production' ? './build/prod.js' : './build/dev.js'
23
var webpack = require('webpack')
34

45
module.exports = {
5-
entry: './build/dev.js',
6+
entry: entry,
67
output: {
78
path: path.resolve(__dirname, './dist'),
89
publicPath: '/dist/',
@@ -54,6 +55,9 @@ module.exports = {
5455
}
5556

5657
if (process.env.NODE_ENV === 'production') {
58+
module.exports.output.library = 'vue2-notify'
59+
module.exports.output.libraryTarget = 'commonjs2'
60+
5761
module.exports.devtool = '#source-map'
5862
// http://vue-loader.vuejs.org/en/workflow/production.html
5963
module.exports.plugins = (module.exports.plugins || []).concat([

0 commit comments

Comments
 (0)