add version

pull/165/head
tjz 7 years ago
parent 4b8bb49350
commit 464582ded6

@ -153,7 +153,7 @@ module.exports = function (modules) {
new webpack.BannerPlugin(` new webpack.BannerPlugin(`
${distFileBaseName} v${pkg.version} ${distFileBaseName} v${pkg.version}
Copyright 2017-present, vue-antd-ui, Inc. Copyright 2017-present, vue-antd-ui.
All rights reserved. All rights reserved.
`), `),
new webpack.ProgressPlugin((percentage, msg, addInfo) => { new webpack.ProgressPlugin((percentage, msg, addInfo) => {
@ -170,7 +170,7 @@ All rights reserved.
} }
if (process.env.RUN_ENV === 'PRODUCTION') { if (process.env.RUN_ENV === 'PRODUCTION') {
const entry = ['./components/index'] const entry = ['./index']
config.entry = { config.entry = {
[`${distFileBaseName}.min`]: entry, [`${distFileBaseName}.min`]: entry,
} }

@ -1,3 +1,18 @@
/* @remove-on-es-build-begin */
// this file is not used if use https://github.com/ant-design/babel-plugin-import
const ENV = process.env.NODE_ENV
if (ENV !== 'production' &&
ENV !== 'test' &&
typeof console !== 'undefined' &&
console.warn &&
typeof window !== 'undefined') {
console.warn(
'You are using a whole package of antd, ' +
'please use https://www.npmjs.com/package/babel-plugin-import to reduce app bundle size.',
)
}
/* @remove-on-es-build-end */
import Button from './button' import Button from './button'
const ButtonGroup = Button.Group const ButtonGroup = Button.Group
export { Button, ButtonGroup } export { Button, ButtonGroup }
@ -105,3 +120,5 @@ export { default as Calendar } from './calendar'
import DatePicker from './date-picker' import DatePicker from './date-picker'
const { MonthPicker, RangePicker, WeekPicker } = DatePicker const { MonthPicker, RangePicker, WeekPicker } = DatePicker
export { DatePicker, MonthPicker, RangePicker, WeekPicker } export { DatePicker, MonthPicker, RangePicker, WeekPicker }
export { default as version } from './version'

@ -0,0 +1,3 @@
import { version } from '../../package.json'
export default version

@ -0,0 +1,2 @@
// empty file prevent babel-plugin-import error
import '../../style/index.less'

@ -0,0 +1,28 @@
/* eslint no-console:0 */
function camelCase (name) {
return name.charAt(0).toUpperCase() +
name.slice(1).replace(/-(\w)/g, (m, n) => {
return n.toUpperCase()
})
}
// Just import style for https://github.com/ant-design/ant-design/issues/3745
const req = require.context('./components', true, /^\.\/[^_][\w-]+\/style\/index\.js?$/)
req.keys().forEach((mod) => {
let v = req(mod)
if (v && v.default) {
v = v.default
}
const match = mod.match(/^\.\/([^_][\w-]+)\/index\.js?$/)
if (match && match[1]) {
if (match[1] === 'message' || match[1] === 'notification') {
// message & notification should not be capitalized
exports[match[1]] = v
} else {
exports[camelCase(match[1])] = v
}
}
})
module.exports = require('./components')

@ -1,6 +1,6 @@
{ {
"name": "vue-antd-ui", "name": "vue-antd-ui",
"version": "0.1.0", "version": "0.1.1",
"title": "Ant Design Vue", "title": "Ant Design Vue",
"description": "An enterprise-class UI design language and Vue-based implementation", "description": "An enterprise-class UI design language and Vue-based implementation",
"keywords": [ "keywords": [

Loading…
Cancel
Save