Skip to content

Commit

Permalink
完成编译库功能
Browse files Browse the repository at this point in the history
  • Loading branch information
kokoroX committed Sep 13, 2016
1 parent d450f42 commit cc5356e
Show file tree
Hide file tree
Showing 10 changed files with 66 additions and 44 deletions.
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
build/*.js
config/*.js
components/*
lib/*.js
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,5 @@ npm-debug.log
selenium-debug.log
test/unit/coverage
test/e2e/reports
.tags
.tags1
34 changes: 34 additions & 0 deletions build/webpack.bundle.conf.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
var baseWebpackConfig = require('./webpack.base.conf.js')
var merge = require('webpack-merge')
var utils = require('./utils')
var webpack = require('webpack')

delete baseWebpackConfig.entry
delete baseWebpackConfig.output
delete baseWebpackConfig.devtool

module.exports = merge(baseWebpackConfig, {
entry: {
'vue-ant-ui': './components/index.js',
},
output: {
filename: './lib/[name].min.js',
library: 'VueAntUI',
libraryTarget: 'umd'
},
plugins: [
new webpack.optimize.UglifyJsPlugin({
sourceMap: false,
drop_console: true,
compress: {
warnings: false
}
})
],
vue: {
loaders: utils.cssLoaders()
},
module: {
loaders: utils.styleLoaders()
}
})
38 changes: 0 additions & 38 deletions build/webpack.bundle.js

This file was deleted.

2 changes: 1 addition & 1 deletion build/webpack.prod.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ var webpack = require('webpack')
var merge = require('webpack-merge')
var baseWebpackConfig = require('./webpack.base.conf')
var ExtractTextPlugin = require('extract-text-webpack-plugin')
var HtmlWebpackPlugin = require('html-webpack-plugin')
// var HtmlWebpackPlugin = require('html-webpack-plugin')
var env = process.env.NODE_ENV === 'testing'
? require('../config/test.env')
: config.build.env
Expand Down
3 changes: 3 additions & 0 deletions config/bundle.env.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module.exports = {
NODE_ENV: '"bundle"'
}
5 changes: 4 additions & 1 deletion config/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,11 @@ var path = require('path')

module.exports = {
bundle: {
env: require('./bundle.env'),
assetsRoot: path.resolve(__dirname, '../lib'),
assetsPublicPath: '/'
assetsSubDirectory: '/',
assetsPublicPath: '/',
productionSourceMap: true
},
build: {
env: require('./prod.env'),
Expand Down
15 changes: 15 additions & 0 deletions lib/vue-ant-ui.min.js

Large diffs are not rendered by default.

8 changes: 5 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
{
"name": "vue-ant-ui",
"version": "1.0.0",
"version": "0.0.6",
"description": "Ant Design components for Vue",
"author": "kokoro <8462304@qq.com>",
"private": true,
"private": false,
"main": "lib/index.js",
"scripts": {
"dev": "node build/dev-server.js",
"build": "node build/build.js",
"unit": "karma start test/unit/karma.conf.js --single-run",
"e2e": "node test/e2e/runner.js",
"test": "npm run unit && npm run e2e",
"lint": "eslint --ext .js,.vue src test/unit/specs test/e2e/specs"
"lint": "eslint --ext .js,.vue src test/unit/specs test/e2e/specs",
"bundle": "webpack --progress --hide-modules --config ./build/webpack.bundle.conf.js && webpack --progress --hide-modules --config ./build/webpack.bundle.conf.js"
},
"dependencies": {
"babel-runtime": "^6.0.0",
Expand Down
2 changes: 1 addition & 1 deletion src/main.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import Vue from 'vue'
import VueRouter from 'vue-router'
import configRouter from './routes'
import VueAntUI from 'vue-ant-ui'
import VueAntUI from '../lib/vue-ant-ui.min'
import './sass/site/style'
import './sass/highlight.scss'

Expand Down

0 comments on commit cc5356e

Please sign in to comment.