Skip to content

Commit

Permalink
✨ It works!
Browse files Browse the repository at this point in the history
  • Loading branch information
jcc committed Mar 17, 2017
0 parents commit 88ecde2
Show file tree
Hide file tree
Showing 20 changed files with 4,909 additions and 0 deletions.
6 changes: 6 additions & 0 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"presets": [
["es2015", {"modules": false}]
],
"plugins": ["transform-runtime"]
}
9 changes: 9 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
root = true

[*]
charset = utf-8
indent_style = space
indent_size = 2
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true
2 changes: 2 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
node_modules/*
build/*
33 changes: 33 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
{
"parser": "babel-eslint",
"env": {
"browser": true,
"commonjs": true,
"es6": true,
"node": true
},
"parserOptions": {
"ecmaVersion": 8,
"sourceType": "module"
},
"rules": {
"no-const-assign": "warn",
"no-this-before-super": "warn",
"no-undef": "warn",
"no-unreachable": "warn",
"no-unused-vars": "warn",
"constructor-super": "warn",
"valid-typeof": "warn",
"semi": [
"warn",
"never"
],
"quotes": [
"warn",
"single"
],
"arrow-parens": 0,
"generator-star-spacing": 0,
"space-before-function-paren": 0
}
}
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
.DS_Store
node_modules/
npm-debug.log
yarn-error.log
15 changes: 15 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# v-distpicker

> A flexible, highly available district selector for picking provinces, cities and districts of China.
## Build Setup

``` bash
# install dependencies
npm install

# serve with hot reload at localhost:8080
npm run dev

# build for production with minification
npm run build
55 changes: 55 additions & 0 deletions build/webpack.dev.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
const path = require('path')
const HtmlWebpackPlugin = require('html-webpack-plugin')

module.exports = {
entry: './examples/main.js',
resolve: {
extensions: ['*', '.js', '.vue'],
alias: {
main: path.resolve(__dirname, '../src')
},
},
output: {
path: path.resolve(__dirname, '../dist/dev'),
publicPath: '/',
filename: 'v-distpicker.js'
},
devServer: {
contentBase: path.resolve(__dirname, '../dist/dev'),
compress: false,
port: 8080
},
plugins: [
new HtmlWebpackPlugin({
filename: path.resolve(__dirname, '../dist/dev/index.html'),
template: 'examples/index.html',
inject: true
})
],
module: {
loaders: [{
test: /\.vue$/,
loader: 'vue-loader',
options: {
loaders: {
scss: 'vue-style-loader!css-loader!sass-loader',
sass: 'vue-style-loader!css-loader!sass-loader?indentedSyntax'
}
}
}, {
test: /\.js$/,
loaders: ['babel-loader', 'eslint-loader'],
exclude: /node_modules/
}, {
test: /\.css$/,
loader: 'style-loader!css-loader'
}, {
test: /\.(png|jpe?g|gif|svg)(\?.*)?$/,
loader: 'url-loader',
query: {
limit: 10000,
name: 'img/[name].[hash:7].[ext]'
}
}]
}
}
41 changes: 41 additions & 0 deletions build/webpack.prod.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
const path = require('path')
const webpack = require('webpack');

module.exports = {
entry: './src/index.js',
resolve: {
extensions: ['*', '.js', '.vue']
},
output: {
path: path.resolve(__dirname, '../dist'),
filename: 'v-distpicker.js',
library: 'VDistpicker',
libraryTarget: 'umd'
},
plugins: [
new webpack.optimize.UglifyJsPlugin({
minimize : true,
sourceMap : false,
mangle: true,
compress: {
warnings: false
}
})
],
module: {
loaders: [{
test: /\.vue$/,
loader: 'vue-loader',
options: {
loaders: {
scss: 'vue-style-loader!css-loader!sass-loader',
sass: 'vue-style-loader!css-loader!sass-loader?indentedSyntax'
}
}
}, {
test: /\.js$/,
loaders: ['babel-loader', 'eslint-loader'],
exclude: /node_modules/
}]
}
}
1 change: 1 addition & 0 deletions dist/v-distpicker.js

Large diffs are not rendered by default.

Loading

0 comments on commit 88ecde2

Please sign in to comment.