refactor: make build suffix dynamically

This commit is contained in:
Clark Du 2018-08-31 20:55:13 +01:00
parent 510c9e2dc4
commit 76d6ab4190
No known key found for this signature in database
GPG Key ID: D0E5986AF78B86D9
2 changed files with 4 additions and 4 deletions

View File

@ -90,7 +90,7 @@ jobs:
command: |
echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" >> ~/.npmrc
echo "//registry.yarnpkg.com/:_authToken=$NPM_TOKEN" >> ~/.npmrc
EDGE_BUILD=1 yarn build
BUILD_SUFFIX=edge yarn build
npm publish
for p in packages/*; do cd $p ; npm publish ; cd - ; done

View File

@ -7,7 +7,7 @@ import { builtinsMap } from './builtins'
const DEFAULTS = {
distDir: 'dist',
edge: Boolean(process.env.EDGE_BUILD)
buildSuffix: Boolean(process.env.BUILD_SUFFIX)
}
export default class Package extends EventEmitter {
@ -87,8 +87,8 @@ export default class Package extends EventEmitter {
build() {
this.emit('build:before')
if (this.edge) {
this.convertTo('edge')
if (this.buildSuffix) {
this.convertTo(this.buildSuffix)
}
this.logger.info('Cleaning up')