mirror of
https://gitee.com/vant-contrib/vant-weapp.git
synced 2025-04-28 20:36:37 +08:00
[Build] update dev script
This commit is contained in:
parent
8735aad3bf
commit
8ce068bcb2
@ -4,6 +4,9 @@ const path = require('path');
|
|||||||
const tips = '// This file is auto gererated by build/build-entry.js';
|
const tips = '// This file is auto gererated by build/build-entry.js';
|
||||||
const root = path.join(__dirname, '../');
|
const root = path.join(__dirname, '../');
|
||||||
const join = dir => path.join(root, dir);
|
const join = dir => path.join(root, dir);
|
||||||
|
const serve = require('webpack-serve');
|
||||||
|
const config = require('./webpack.dev');
|
||||||
|
const extracter = require('./extracter');
|
||||||
|
|
||||||
// generate webpack entry file for markdown docs
|
// generate webpack entry file for markdown docs
|
||||||
function buildDocsEntry() {
|
function buildDocsEntry() {
|
||||||
@ -29,3 +32,11 @@ export default {
|
|||||||
}
|
}
|
||||||
|
|
||||||
buildDocsEntry();
|
buildDocsEntry();
|
||||||
|
|
||||||
|
serve({}, { config });
|
||||||
|
|
||||||
|
extracter({
|
||||||
|
src: path.resolve(__dirname, '../packages'),
|
||||||
|
dist: path.resolve(__dirname, '../example/dist'),
|
||||||
|
watch: true
|
||||||
|
});
|
@ -2,9 +2,9 @@ const path = require('path');
|
|||||||
const fs = require('fs-extra');
|
const fs = require('fs-extra');
|
||||||
const nodeWatch = require('node-watch');
|
const nodeWatch = require('node-watch');
|
||||||
const debounce = require('lodash/debounce');
|
const debounce = require('lodash/debounce');
|
||||||
require('shelljs/global');
|
const shelljs = require('shelljs');
|
||||||
|
|
||||||
module.exports = function (config = {}) {
|
module.exports = function(config = {}) {
|
||||||
// 清空 dist 目录
|
// 清空 dist 目录
|
||||||
fs.emptyDirSync(config.dist);
|
fs.emptyDirSync(config.dist);
|
||||||
|
|
||||||
@ -15,7 +15,7 @@ module.exports = function (config = {}) {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
const debouncedFunc = debounce(config => extracter(config), 500);
|
const debouncedFunc = debounce(config => extracter(config), 100);
|
||||||
|
|
||||||
function extracter(config = {}) {
|
function extracter(config = {}) {
|
||||||
// 复制 src
|
// 复制 src
|
||||||
@ -27,5 +27,5 @@ function extracter(config = {}) {
|
|||||||
});
|
});
|
||||||
|
|
||||||
// 编译 js wxss 文件
|
// 编译 js wxss 文件
|
||||||
exec(`gulp build --gulpfile scripts/utils/build.js --dist ${config.dist} --color`);
|
shelljs.exec(`gulp build --gulpfile build/build.js --dist ${config.dist} --color`);
|
||||||
}
|
}
|
@ -4,7 +4,7 @@
|
|||||||
"description": "高颜值、好用、易扩展的小程序 UI 库,Powered by 有赞",
|
"description": "高颜值、好用、易扩展的小程序 UI 库,Powered by 有赞",
|
||||||
"main": "app.js",
|
"main": "app.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "node build/build-entry.js && webpack-serve --config build/webpack.dev.js",
|
"dev": "node build/dev.js",
|
||||||
"lint": "eslint ./packages --ext .js",
|
"lint": "eslint ./packages --ext .js",
|
||||||
"release": "sh scripts/release.sh",
|
"release": "sh scripts/release.sh",
|
||||||
"build": "sh scripts/deploy.sh",
|
"build": "sh scripts/deploy.sh",
|
||||||
|
@ -1,20 +0,0 @@
|
|||||||
#!/usr/bin/env sh
|
|
||||||
|
|
||||||
if ! command_exists github_changelog_generator ; then
|
|
||||||
fail 'github_changelog_generator is required to publish packages'
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ -z "$CHANGELOG_GITHUB_TOKEN" ] ; then
|
|
||||||
fail 'You must set CHANGELOG_GITHUB_TOKEN environment variable\nhttps://github.com/skywinder/github-changelog-generator#github-token'
|
|
||||||
fi
|
|
||||||
|
|
||||||
basepath=$(dirname $0)
|
|
||||||
|
|
||||||
github_changelog_generator \
|
|
||||||
--header-label "## 更新日志" \
|
|
||||||
--bugs-label "**Bug Fixes**" \
|
|
||||||
--enhancement-label "**Breaking changes**" \
|
|
||||||
--issues-label "**Issue**" \
|
|
||||||
--pr-label "**Improvements**" \
|
|
||||||
--no-unreleased \
|
|
||||||
-o $basepath/../CHANGELOG-GENERATED.md
|
|
@ -1,8 +0,0 @@
|
|||||||
const path = require('path');
|
|
||||||
const extracter = require('./utils/extracter');
|
|
||||||
|
|
||||||
extracter({
|
|
||||||
src: path.resolve(__dirname, '../packages'),
|
|
||||||
dist: path.resolve(__dirname, '../example/dist'),
|
|
||||||
watch: true
|
|
||||||
});
|
|
@ -1,7 +0,0 @@
|
|||||||
cd website && yarn && yarn cache node_modules
|
|
||||||
|
|
||||||
npm run build
|
|
||||||
|
|
||||||
cd ../
|
|
||||||
|
|
||||||
|
|
Loading…
x
Reference in New Issue
Block a user