build config

This commit is contained in:
cookfront
2017-02-26 11:55:16 +08:00
parent e9a105b76d
commit 7bfc4f4323
28 changed files with 93 additions and 94 deletions

View File

@@ -10,15 +10,15 @@ let componentPaths = [];
delete components.font;
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)) {
componentPaths.push(`packages/${key}/cooking.conf.js`);
componentPaths.push(`packages/${key}/webpack.conf.js`);
}
});
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, {
stdio: 'inherit'

38
build/release.sh Normal file
View 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

View File

@@ -1,13 +1,13 @@
var config = require('./webpack.config.js')
var config = require('./webpack.config.js');
config.entry = {
'oxygen': './src/index.js'
}
'zanui': './src/index.js'
};
config.output = {
filename: './dist/[name].js',
filename: './lib/[name].js',
library: 'zanui',
libraryTarget: 'umd'
}
};
module.exports = config
module.exports = config;

View File

@@ -1,10 +1,9 @@
var config = require('./webpack.build.js')
var webpack = require('webpack')
var config = require('./webpack.build.js');
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 = [
new webpack.optimize.UglifyJsPlugin({
@@ -14,6 +13,6 @@ config.plugins = [
warnings: false
}
})
]
];
module.exports = config
module.exports = config;

View File

@@ -24,7 +24,8 @@ function wrap(render) {
module.exports = {
entry: {
'build-docs': './docs/index.js'
'zanui-docs': './docs/index.js',
'zanui-examples': './docs/examples.js'
},
output: {
path: './docs/build',
@@ -39,7 +40,7 @@ module.exports = {
extensions: ['.js', '.vue', '.pcss'],
alias: {
'vue$': 'vue/dist/vue.runtime.common.js',
'oxygen': path.join(__dirname, '..'),
'zanui': path.join(__dirname, '..'),
'src': path.join(__dirname, '../src'),
'packages': path.join(__dirname, '../packages')
}