Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
PanJiaChen committed Apr 15, 2017
1 parent 1dfc674 commit 58c9b45
Show file tree
Hide file tree
Showing 8 changed files with 28 additions and 27 deletions.
7 changes: 2 additions & 5 deletions .babelrc
@@ -1,8 +1,5 @@

{
"presets": [
["latest", {
"es2015": { "modules": false }
}]
]
"presets": ["es2015", "stage-2"],
"plugins": ["transform-runtime"]
}
3 changes: 1 addition & 2 deletions demo/index.html
Expand Up @@ -8,7 +8,7 @@
</head>

<body>
<script src='https://unpkg.com/vue@2.2.6/dist/vue.js'></script>
<script src='https://unpkg.com/vue@2.2.6'></script>
<script src="../dist/vue-count-to.min.js"></script>
<a href="https://your-url" class="github-corner" aria-label="View source on Github">
<svg width="80" height="80" viewBox="0 0 250 250" style="fill:#4AB7BD; color:#fff; position: absolute; top: 0; border: 0; right: 0;"
Expand Down Expand Up @@ -60,7 +60,6 @@ <h3> custom example</h3>
</template>
</div>
<script>
Vue.use(VueCountTo)
var Main = {
name: 'test',
data() {
Expand Down
2 changes: 1 addition & 1 deletion dist/vue-count-to.min.js

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

2 changes: 1 addition & 1 deletion dist/vue-count-to.min.js.map

Large diffs are not rendered by default.

7 changes: 5 additions & 2 deletions package.json
@@ -1,7 +1,7 @@
{
"name": "vue-count-to",
"description": "It's a vue component that will count to a target number at a specified duration",
"version": "1.0.0",
"version": "1.0.4",
"author": "Pan <panfree23@gmail.com>",
"main": "dist/vue-count-to.min.js",
"scripts": {
Expand All @@ -13,7 +13,10 @@
"devDependencies": {
"babel-core": "^6.0.0",
"babel-loader": "^6.0.0",
"babel-preset-latest": "^6.0.0",
"babel-plugin-transform-runtime": "^6.15.0",
"babel-preset-es2015": "^6.14.0",
"babel-preset-stage-2": "^6.13.0",
"babel-runtime": "^6.11.6",
"cross-env": "^3.0.0",
"css-loader": "^0.25.0",
"file-loader": "^0.9.0",
Expand Down
1 change: 0 additions & 1 deletion src/component/vue-countTo.vue
Expand Up @@ -6,7 +6,6 @@
<script>
import { requestAnimationFrame, cancelAnimationFrame } from './requestAnimationFrame.js'
export default {
name: 'count-to',
props: {
startVal: {
type: Number,
Expand Down
7 changes: 4 additions & 3 deletions src/index.js
@@ -1,4 +1,5 @@
import VueCountToComponent from './component/vue-countTo.vue'
export function install(Vue) {
Vue.component('countTo', VueCountToComponent)
import CountTo from './component/vue-countTo.vue';
export default CountTo;
if (typeof window !== 'undefined' && window.Vue) {
window.Vue.component('count-to', CountTo);
}
26 changes: 14 additions & 12 deletions webpack.config.js
@@ -1,27 +1,29 @@
const path = require('path')
const webpack = require('webpack')

function resolve(dir) {
return path.join(__dirname, '..', dir)
}
module.exports = {
entry: './src/index.js',
output: {
path: path.resolve(__dirname, './dist'),
publicPath: '/dist/',
filename: 'vue-count-to.min.js',
library: 'VueCountTo',
library: 'CountTo',
libraryTarget: 'umd',
umdNamedDefine: true
},
module: {
rules: [
// {
// test: /\.(js|vue)$/,
// loader: 'eslint-loader',
// enforce: 'pre',
// include: [resolve('src'), resolve('test')],
// options: {
// formatter: require('eslint-friendly-formatter')
// }
// },
{
test: /\.(js|vue)$/,
loader: 'eslint-loader',
enforce: 'pre',
include: [resolve('src'), resolve('test')],
options: {
formatter: require('eslint-friendly-formatter')
}
},
{
test: /\.vue$/,
loader: 'vue-loader'
Expand All @@ -42,7 +44,7 @@ module.exports = {
},
resolve: {
alias: {
vue$: 'vue/dist/vue.common.js'
vue$: 'vue/dist/vue.esm.js'
}
},
externals: {
Expand Down

0 comments on commit 58c9b45

Please sign in to comment.