Skip to content

Commit

Permalink
update to 0.0.2
Browse files Browse the repository at this point in the history
  • Loading branch information
jin5354 committed Dec 26, 2016
1 parent 8e60609 commit 4fd6369
Show file tree
Hide file tree
Showing 7 changed files with 101 additions and 8 deletions.
9 changes: 9 additions & 0 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"presets": [["latest", {
"es2015": {
"modules": false
}
}]],
"plugins": ["transform-vue-jsx"],
"comments": false
}
3 changes: 3 additions & 0 deletions dist/index.js

Large diffs are not rendered by default.

33 changes: 29 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,18 +1,43 @@
{
"name": "wdui",
"version": "0.0.1",
"version": "0.0.2",
"description": "wdui",
"main": "src/index.js",
"main": "dist/index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
"test": "echo \"Error: no test specified\" && exit 1",
"build": "NODE_ENV=production webpack --display-modules --sort-modules-by size"
},
"author": "wdfe",
"license": "MIT",
"devDependencies": {
"autoprefixer": "^6.6.0",
"babel-core": "^6.21.0",
"babel-eslint": "^7.1.1",
"babel-helper-vue-jsx-merge-props": "^2.0.2",
"babel-loader": "^6.2.10",
"babel-plugin-syntax-jsx": "^6.18.0",
"babel-plugin-transform-vue-jsx": "^3.3.0",
"babel-preset-latest": "^6.16.0",
"babel-runtime": "^6.20.0",
"clean-webpack-plugin": "^0.1.14",
"css-loader": "^0.26.1",
"eslint": "^3.12.2",
"eslint-config-wdfe": "http://10.8.96.35:2009/package/eslint-config-wdfe/latest",
"eslint-loader": "^1.6.1",
"eslint-plugin-vue": "^1.0.0",
"file-loader": "^0.9.0",
"json-loader": "^0.5.4",
"lerna": "2.0.0-beta.30",
"vue": "^2.1.7"
"node-sass": "^4.1.1",
"postcss-loader": "^1.2.1",
"postcss-px2rem": "^0.3.0",
"sass-loader": "^4.1.1",
"style-loader": "^0.13.1",
"url-loader": "^0.5.7",
"vue": "^2.1.7",
"vue-loader": "^10.0.2",
"vue-style-loader": "^1.0.0",
"vue-template-compiler": "^2.1.7",
"webpack": "^2.2.0-rc.2"
}
}
2 changes: 1 addition & 1 deletion packages/MessageBox/index.js
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export { default } from './src/Message.js'
export {default} from './src/MessageBox.js'
2 changes: 1 addition & 1 deletion packages/MessageBox/src/MessageBox.vue
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

<script>
import Popup from '../../util/popup/index.js'
import Popup from '../../../src/popup/index.js'
export default {
name: 'MessageBox',
Expand Down
5 changes: 3 additions & 2 deletions src/index.js
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
import MessageBox from '../packages/MessageBox/index.js'

const install = function() {
if(typeof window !== 'undefined' && window.WDUIInstalled) {
if(install.installed) {
return
}
}

if (typeof window !== 'undefined' && window.Vue) {
install(window.Vue)
window.WDUIInstalled = true
}

module.exports = {
install,
version: '0.0.2',
MessageBox
}
55 changes: 55 additions & 0 deletions webpack.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
'use strict'
const webpack = require('webpack')
const CleanPlugin = require('clean-webpack-plugin')
const autoprefixer = require('autoprefixer')
const px2rem = require('postcss-px2rem')

module.exports = {
entry: __dirname + '/src/index.js',
output: {
path: __dirname + '/dist',
filename: 'index.js'
},
module: {
loaders: [
{
test: /\.js$/,
loader: 'babel-loader',
exclude: /node_modules/
},
{
test: /\.vue$/,
loaders: [{
loader: 'vue-loader',
options: {
postcss: [autoprefixer({browsers: ['> 1%', 'ie >= 9', 'iOS >= 6', 'Android >= 2.1']}), px2rem({remUnit: 75})]
}
}]
},
{
test: /\.(scss|sass)$/,
loaders: ['style-loader', 'css-loader', 'sass-loader']
},
{
test: /\.css$/,
loaders: ['style-loader', 'css-loader']
}
]
},
plugins: [
new CleanPlugin(['dist']),
]
}

if(process.env.NODE_ENV === 'production') {
module.exports.plugins.push(new webpack.optimize.UglifyJsPlugin({
output: {
comments: false,
},
compress: {
warnings: false
}
}))
}else {
module.exports.devtool = 'eval-source-map'
}

0 comments on commit 4fd6369

Please sign in to comment.