mirror of
https://gitee.com/vant-contrib/vant.git
synced 2025-04-06 03:57:59 +08:00
build config
This commit is contained in:
parent
e9a105b76d
commit
7bfc4f4323
2
Makefile
2
Makefile
@ -11,4 +11,4 @@ init:
|
|||||||
node build/bin/init.js $(filter-out $@,$(MAKECMDGOALS))
|
node build/bin/init.js $(filter-out $@,$(MAKECMDGOALS))
|
||||||
|
|
||||||
dev:
|
dev:
|
||||||
npm run docs
|
npm run dev
|
||||||
|
@ -10,15 +10,15 @@ let componentPaths = [];
|
|||||||
delete components.font;
|
delete components.font;
|
||||||
|
|
||||||
Object.keys(components).forEach(key => {
|
Object.keys(components).forEach(key => {
|
||||||
const filePath = path.join(__dirname, `../../packages/${key}/cooking.conf.js`);
|
const filePath = path.join(__dirname, `../../packages/${key}/webpack.conf.js`);
|
||||||
|
|
||||||
if (existsSync(filePath)) {
|
if (existsSync(filePath)) {
|
||||||
componentPaths.push(`packages/${key}/cooking.conf.js`);
|
componentPaths.push(`packages/${key}/webpack.conf.js`);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
const paths = componentPaths.join(',');
|
const paths = componentPaths.join(',');
|
||||||
const cli = `node_modules/.bin/cooking build -c ${paths} -p`;
|
const cli = `node_modules/.bin/webpack build -c ${paths} -p`;
|
||||||
|
|
||||||
execSync(cli, {
|
execSync(cli, {
|
||||||
stdio: 'inherit'
|
stdio: 'inherit'
|
||||||
|
38
build/release.sh
Normal file
38
build/release.sh
Normal file
@ -0,0 +1,38 @@
|
|||||||
|
git checkout master
|
||||||
|
git merge dev
|
||||||
|
|
||||||
|
#!/usr/bin/env sh
|
||||||
|
set -e
|
||||||
|
echo "Enter release version: "
|
||||||
|
read VERSION
|
||||||
|
|
||||||
|
read -p "Releasing $VERSION - are you sure? (y/n)" -n 1 -r
|
||||||
|
echo # (optional) move to a new line
|
||||||
|
if [[ $REPLY =~ ^[Yy]$ ]]
|
||||||
|
then
|
||||||
|
echo "Releasing $VERSION ..."
|
||||||
|
|
||||||
|
# build
|
||||||
|
VERSION=$VERSION npm run dist
|
||||||
|
|
||||||
|
# publish zanui-css
|
||||||
|
echo "Releasing zanui-css $VERSION ..."
|
||||||
|
cd packages/zanui-css
|
||||||
|
npm version $VERSION --message "[release] $VERSION"
|
||||||
|
npm publish
|
||||||
|
cd ../..
|
||||||
|
|
||||||
|
# commit
|
||||||
|
git add -A
|
||||||
|
git commit -m "[build] $VERSION"
|
||||||
|
npm version $VERSION --message "[release] $VERSION"
|
||||||
|
|
||||||
|
# publish
|
||||||
|
git push origin master
|
||||||
|
git push origin refs/tags/v$VERSION
|
||||||
|
git checkout dev
|
||||||
|
git rebase master
|
||||||
|
git push origin dev
|
||||||
|
|
||||||
|
npm publish
|
||||||
|
fi
|
@ -1,13 +1,13 @@
|
|||||||
var config = require('./webpack.config.js')
|
var config = require('./webpack.config.js');
|
||||||
|
|
||||||
config.entry = {
|
config.entry = {
|
||||||
'oxygen': './src/index.js'
|
'zanui': './src/index.js'
|
||||||
}
|
};
|
||||||
|
|
||||||
config.output = {
|
config.output = {
|
||||||
filename: './dist/[name].js',
|
filename: './lib/[name].js',
|
||||||
library: 'zanui',
|
library: 'zanui',
|
||||||
libraryTarget: 'umd'
|
libraryTarget: 'umd'
|
||||||
}
|
};
|
||||||
|
|
||||||
module.exports = config
|
module.exports = config;
|
||||||
|
13
build/webpack.build.min.js
vendored
13
build/webpack.build.min.js
vendored
@ -1,10 +1,9 @@
|
|||||||
var config = require('./webpack.build.js')
|
var config = require('./webpack.build.js');
|
||||||
var webpack = require('webpack')
|
var webpack = require('webpack');
|
||||||
|
|
||||||
|
config.output.filename = config.output.filename.replace(/\.js$/, '.min.js');
|
||||||
|
|
||||||
config.output.filename = config.output.filename.replace(/\.js$/, '.min.js')
|
delete config.devtool;
|
||||||
|
|
||||||
delete config.devtool
|
|
||||||
|
|
||||||
config.plugins = [
|
config.plugins = [
|
||||||
new webpack.optimize.UglifyJsPlugin({
|
new webpack.optimize.UglifyJsPlugin({
|
||||||
@ -14,6 +13,6 @@ config.plugins = [
|
|||||||
warnings: false
|
warnings: false
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
]
|
];
|
||||||
|
|
||||||
module.exports = config
|
module.exports = config;
|
||||||
|
@ -24,7 +24,8 @@ function wrap(render) {
|
|||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
entry: {
|
entry: {
|
||||||
'build-docs': './docs/index.js'
|
'zanui-docs': './docs/index.js',
|
||||||
|
'zanui-examples': './docs/examples.js'
|
||||||
},
|
},
|
||||||
output: {
|
output: {
|
||||||
path: './docs/build',
|
path: './docs/build',
|
||||||
@ -39,7 +40,7 @@ module.exports = {
|
|||||||
extensions: ['.js', '.vue', '.pcss'],
|
extensions: ['.js', '.vue', '.pcss'],
|
||||||
alias: {
|
alias: {
|
||||||
'vue$': 'vue/dist/vue.runtime.common.js',
|
'vue$': 'vue/dist/vue.runtime.common.js',
|
||||||
'oxygen': path.join(__dirname, '..'),
|
'zanui': path.join(__dirname, '..'),
|
||||||
'src': path.join(__dirname, '../src'),
|
'src': path.join(__dirname, '../src'),
|
||||||
'packages': path.join(__dirname, '../packages')
|
'packages': path.join(__dirname, '../packages')
|
||||||
}
|
}
|
||||||
|
0
docs/examples.js
Normal file
0
docs/examples.js
Normal file
10
docs/examples/button.vue
Normal file
10
docs/examples/button.vue
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
<template>
|
||||||
|
<div class="button-demos">
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
export default {
|
||||||
|
|
||||||
|
};
|
||||||
|
</script>
|
@ -1,6 +1,6 @@
|
|||||||
import Vue from 'vue';
|
import Vue from 'vue';
|
||||||
import VueRouter from 'vue-router';
|
import VueRouter from 'vue-router';
|
||||||
import App from './App';
|
import App from './ExamplesDocsApp';
|
||||||
import routes from './router.config';
|
import routes from './router.config';
|
||||||
import demoBlock from './components/demo-block';
|
import demoBlock from './components/demo-block';
|
||||||
import SideNav from './components/side-nav';
|
import SideNav from './components/side-nav';
|
||||||
|
@ -23,7 +23,7 @@ const registerRoute = (navConfig) => {
|
|||||||
route.push({
|
route.push({
|
||||||
path: '/component' + page.path,
|
path: '/component' + page.path,
|
||||||
component: function(resolve) {
|
component: function(resolve) {
|
||||||
require([`./examples${page.path}.md`], resolve);
|
require([`./examples-docs${page.path}.md`], resolve);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
16
examples.html
Normal file
16
examples.html
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<meta charset="UTF-8">
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||||
|
<title>Oxygen</title>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
|
||||||
|
<div id="app-container">
|
||||||
|
<app></app>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<script src="docs/build/zanui-examples.js"></script>
|
||||||
|
</body>
|
||||||
|
</html>
|
@ -11,6 +11,6 @@
|
|||||||
<app></app>
|
<app></app>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<script src="docs/build/build-docs.js"></script>
|
<script src="docs/build/zanui-docs.js"></script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
12
package.json
12
package.json
@ -2,8 +2,8 @@
|
|||||||
"name": "@youzan/oxygen",
|
"name": "@youzan/oxygen",
|
||||||
"version": "0.0.1",
|
"version": "0.0.1",
|
||||||
"description": "有赞vue wap组件库",
|
"description": "有赞vue wap组件库",
|
||||||
"main": "lib/oxygen.js",
|
"main": "lib/zanui.js",
|
||||||
"style": "lib/style.css",
|
"style": "lib/zanui-css.css",
|
||||||
"files": [
|
"files": [
|
||||||
"lib",
|
"lib",
|
||||||
"src",
|
"src",
|
||||||
@ -11,12 +11,12 @@
|
|||||||
],
|
],
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"bootstrap": "npm i --registry=http://registry.npm.qima-inc.com",
|
"bootstrap": "npm i --registry=http://registry.npm.qima-inc.com",
|
||||||
"dev": "npm run bootstrap && npm run build:file",
|
"dev": "npm run bootstrap && npm run build:file && webpack-dev-server --inline --hot --config build/webpack.config.js",
|
||||||
"build:file": "node build/bin/build-entry.js",
|
"build:file": "node build/bin/build-entry.js",
|
||||||
"build:zanui-css": "gulp build --gulpfile packages/zanui-css/gulpfile.js",
|
"build:zanui-css": "gulp build --gulpfile packages/zanui-css/gulpfile.js && cp-cli packages/zanui-css/lib lib/zanui-css",
|
||||||
"build": "npm run clean && npm run lint && npm run build:file && webpack --progress --hide-modules --config build/webpack.build.min.js && webpack --progress --hide-modules --config build/webpack.build.js",
|
"build:zanui": "webpack --progress --hide-modules --config build/webpack.build.js && webpack --progress --hide-modules --config build/webpack.build.min.js",
|
||||||
|
"dist": "npm run clean && npm run build:file && npm run lint && npm run build:zanui && npm run build:zanui-css",
|
||||||
"builddocs": "webpack --progress --hide-modules --config build/webpack.config.js && set NODE_ENV=production webpack --progress --hide-modules --config build/webpack.config.js",
|
"builddocs": "webpack --progress --hide-modules --config build/webpack.config.js && set NODE_ENV=production webpack --progress --hide-modules --config build/webpack.config.js",
|
||||||
"docs": "npm run dev && webpack-dev-server --inline --hot --config build/webpack.config.js",
|
|
||||||
"clean": "rimraf lib && rimraf packages/*/lib",
|
"clean": "rimraf lib && rimraf packages/*/lib",
|
||||||
"lint": "eslint src/**/*.js packages/**/*.{js,vue} --quiet"
|
"lint": "eslint src/**/*.js packages/**/*.{js,vue} --quiet"
|
||||||
},
|
},
|
||||||
|
@ -52,27 +52,6 @@ export default {
|
|||||||
let { type, nativeType, size, disabled, loading, block } = this;
|
let { type, nativeType, size, disabled, loading, block } = this;
|
||||||
let Tag = this.tag;
|
let Tag = this.tag;
|
||||||
|
|
||||||
return (
|
|
||||||
<Tag
|
|
||||||
type={nativeType}
|
|
||||||
disabled={disabled}
|
|
||||||
class={[
|
|
||||||
'z-button',
|
|
||||||
'z-button--' + type,
|
|
||||||
'z-button--' + size,
|
|
||||||
{
|
|
||||||
'is-disabled': disabled,
|
|
||||||
'is-loading': loading,
|
|
||||||
'is-block': block
|
|
||||||
}
|
|
||||||
]}
|
|
||||||
onClick={this.handleClick}
|
|
||||||
>
|
|
||||||
{
|
|
||||||
loading ? <i class="z-icon-loading"></i> : null
|
|
||||||
}
|
|
||||||
<span class="z-button-text">{this.$slots.default}</span>
|
|
||||||
</Tag>
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -1,8 +0,0 @@
|
|||||||
## 0.0.2 (2017-01-20)
|
|
||||||
|
|
||||||
* 改了bug A
|
|
||||||
* 加了功能B
|
|
||||||
|
|
||||||
## 0.0.1 (2017-01-10)
|
|
||||||
|
|
||||||
* 第一版
|
|
@ -1,26 +0,0 @@
|
|||||||
# @youzan/<%= name %>
|
|
||||||
|
|
||||||
!!! 请在此处填写你的文档最简单描述 !!!
|
|
||||||
|
|
||||||
[![version][version-image]][download-url]
|
|
||||||
[![download][download-image]][download-url]
|
|
||||||
|
|
||||||
[version-image]: http://npm.qima-inc.com/badge/v/@youzan/<%= name %>.svg?style=flat-square
|
|
||||||
[download-image]: http://npm.qima-inc.com/badge/d/@youzan/<%= name %>.svg?style=flat-square
|
|
||||||
[download-url]: http://npm.qima-inc.com/package/@youzan/<%= name %>
|
|
||||||
|
|
||||||
## Demo
|
|
||||||
|
|
||||||
## Usage
|
|
||||||
|
|
||||||
## API
|
|
||||||
|
|
||||||
| 参数 | 说明 | 类型 | 默认值 | 可选值 |
|
|
||||||
|-----------|-----------|-----------|-------------|-------------|
|
|
||||||
| className | 自定义额外类名 | string | '' | '' |
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
## License
|
|
||||||
[MIT](https://opensource.org/licenses/MIT)
|
|
@ -1,10 +0,0 @@
|
|||||||
{
|
|
||||||
"name": "<%= name %>",
|
|
||||||
"version": "<%= version %>",
|
|
||||||
"description": "<%= description %>",
|
|
||||||
"main": "./lib/index.js",
|
|
||||||
"author": "<%= author %>",
|
|
||||||
"license": "<%= license %>",
|
|
||||||
"devDependencies": {},
|
|
||||||
"dependencies": {}
|
|
||||||
}
|
|
Loading…
x
Reference in New Issue
Block a user