Skip to content

Commit

Permalink
add base file
Browse files Browse the repository at this point in the history
  • Loading branch information
邢光 committed Mar 17, 2017
1 parent d820282 commit cec525e
Show file tree
Hide file tree
Showing 20 changed files with 7,941 additions and 2 deletions.
8 changes: 8 additions & 0 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"presets": [
["latest", {
"es2015": { "modules": false }
}],
"stage-2"
]
}
16 changes: 16 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
// http://eslint.org/docs/user-guide/configuring

module.exports = {
root: true,
parser: 'babel-eslint',
parserOptions: {
sourceType: 'module'
},
env: {
browser: true,
},
extends: 'standard',
plugins: [
'html'
]
}
2 changes: 2 additions & 0 deletions .gitignore
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
node_modules
dist
npm-debug.log
11 changes: 11 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
language: node_js
node_js:
- node
- --lts # LTS: See https://github.com/creationix/nvm/pull/1070
branches:
only:
- dev
install:
- npm install
script:
- npm run build
Empty file modified LICENSE
100644 → 100755
Empty file.
Empty file modified README.md
100644 → 100755
Empty file.
47 changes: 47 additions & 0 deletions build/webpack.base.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
var path = require('path')

function resolve (dir) {
return path.join(__dirname, '..', dir)
}

module.exports = {
entry: {
app: './examples/main.js'
},
output: {
path: path.resolve(__dirname, '../dist'),
filename: 'index.js',
publicPath: '/'
},
resolve: {
extensions: ['.js', '.vue'],
alias: {
'vue$': 'vue/dist/vue.esm.js'
}
},
module: {
rules: [
{
test: /\.(js|vue)$/,
loader: 'eslint-loader',
enforce: "pre",
include: [resolve('examples'), resolve('src')],
options: {
formatter: require('eslint-friendly-formatter')
}
},
{
test: /\.vue$/,
loader: 'vue-loader',
options: {
sourceMap: true
}
},
{
test: /\.js$/,
loader: 'babel-loader',
include: [resolve('./src'), resolve('./examples')]
}
]
}
}
26 changes: 26 additions & 0 deletions build/webpack.dev.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
var webpack = require('webpack')
var merge = require('webpack-merge')
var path = require('path')
var baseWebpackConfig = require('./webpack.base.config')
var HtmlWebpackPlugin = require('html-webpack-plugin')
var opn = require('opn')

opn('http://localhost:8099')
module.exports = merge(baseWebpackConfig, {
devtool: '#source-map',
devServer: {
port: '8099',
contentBase: path.join(__dirname, "dist")
},
plugins: [
new webpack.DefinePlugin({
'process.env': '"development"'
}),
new HtmlWebpackPlugin({
filename: 'index.html',
template: './examples/index.html',
inject: true
}),
new webpack.HotModuleReplacementPlugin()
]
})
46 changes: 46 additions & 0 deletions build/webpack.prod.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
var path = require('path')
var webpack = require('webpack')
var merge = require('webpack-merge')
var baseWebpackConfig = require('./webpack.base.config')
var HtmlWebpackPlugin = require('html-webpack-plugin')

module.exports = merge(baseWebpackConfig, {
devtool: '#source-map',
output: {
path: path.resolve(__dirname, '../dist'),
filename: 'js/[name].[chunkhash:8].js',
chunkFilename: 'js/[id].[chunkhash:8].js'
},
plugins: [
new webpack.DefinePlugin({
'process.env': '"production"'
}),
new webpack.optimize.UglifyJsPlugin({
compress: {
warnings: false
},
sourceMap: true
}),
new HtmlWebpackPlugin({
filename: 'index.html',
template: './examples/index.html',
inject: true
}),
new webpack.optimize.CommonsChunkPlugin({
name: 'vendor',
minChunks: function (module, count) {
return (
module.resource &&
/\.js$/.test(module.resource) &&
module.resource.indexOf(
path.join(__dirname, '../node_modules')
) === 0
)
}
}),
new webpack.optimize.CommonsChunkPlugin({
name: 'manifest',
chunks: ['vendor']
})
]
})
20 changes: 20 additions & 0 deletions examples/App.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<template>
<div class="page-app">
2
</div>
</template>

<script>
export default {
name: 'App',
created () {
console.log(1)
}
}
</script>

<style lang="less">
.page-app {
background-color: red;
}
</style>
12 changes: 12 additions & 0 deletions examples/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>vue-echarts-components</title>
</head>
<body>
<div id="app"></div>
</body>
</html>
8 changes: 8 additions & 0 deletions examples/main.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import App from './App'
import Vue from 'vue'
/* eslint-disable no-new */
new Vue({
el: '#app',
template: '<App/>',
components: { App }
})
38 changes: 36 additions & 2 deletions package.json
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
"test": "echo \"Error: no test specified\" && exit 1",
"dev": "./node_modules/.bin/webpack-dev-server --config ./build/webpack.dev.config.js",
"build": "./node_modules/.bin/webpack --config ./build/webpack.prod.config.js"
},
"repository": {
"type": "git",
Expand All @@ -17,5 +19,37 @@
"url": "https://github.com/xiguaxigua/vue-echarts-components/issues"
},
"homepage": "https://github.com/xiguaxigua/vue-echarts-components#readme",
"dependencies": {}
"dependencies": {
"echarts": "3.4.0",
"vue": "2.2.4"
},
"devDependencies": {
"babel-core": "6.24.0",
"babel-eslint": "7.1.1",
"babel-loader": "6.4.1",
"babel-preset-latest": "6.24.0",
"babel-preset-stage-2": "6.22.0",
"css-loader": "0.27.3",
"eslint": "3.17.1",
"eslint-config-standard": "7.0.1",
"eslint-friendly-formatter": "2.0.7",
"eslint-loader": "1.6.3",
"eslint-plugin-html": "2.0.1",
"eslint-plugin-promise": "3.5.0",
"eslint-plugin-standard": "2.1.1",
"extract-text-webpack-plugin": "2.1.0",
"html-webpack-plugin": "2.28.0",
"less": "2.7.2",
"less-loader": "3.0.0",
"opn": "4.0.2",
"optimize-css-assets-webpack-plugin": "1.3.0",
"postcss-loader": "1.3.3",
"style-loader": "0.14.1",
"vue-loader": "11.1.4",
"vue-style-loader": "2.0.4",
"vue-template-compiler": "2.2.4",
"webpack": "2.2.1",
"webpack-dev-server": "2.4.2",
"webpack-merge": "4.1.0"
}
}
Empty file added src/bar/index.js
Empty file.
Empty file added src/bar/index.vue
Empty file.
1 change: 1 addition & 0 deletions src/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

Empty file added src/line/index.js
Empty file.
Empty file added src/line/index.vue
Empty file.
Loading

0 comments on commit cec525e

Please sign in to comment.