Merge pull request #1275 from 0xProject/feature/instant/productionize-publish-flow

[instant] Productionize publish flow
This commit is contained in:
Francesco Agosti 2018-11-16 11:47:58 -08:00 committed by GitHub
commit d64bc28ba6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 22 additions and 14 deletions

View File

@ -49,7 +49,7 @@
"maxSize": "700kB"
},
{
"path": "packages/instant/public/main.bundle.js",
"path": "packages/instant/umd/instant.js",
"maxSize": "1000kB"
}
],

View File

@ -1,6 +1,6 @@
{
"domain": "0x-instant-dogfood",
"build_command": "yarn build:umd:prod",
"build_command": "WEBPACK_OUTPUT_PATH=public yarn build:umd:prod",
"upload_directory": "public",
"index_key": "index.html",
"error_key": "index.html",

View File

@ -1,2 +1,3 @@
public/main.bundle.js
public/main.bundle.js.map
public/instant.js
public/instant.js.map
umd/*

View File

@ -0,0 +1,5 @@
.*
*
*/
!lib/src/**/*
!umd/**/*

View File

@ -1,6 +1,6 @@
{
"domain": "0x-instant-staging",
"build_command": "yarn build:umd:prod",
"build_command": "WEBPACK_OUTPUT_PATH=public yarn build:umd:prod",
"upload_directory": "public",
"index_key": "index.html",
"error_key": "index.html",

View File

@ -1,10 +1,9 @@
{
"name": "@0x/instant",
"version": "0.0.7",
"version": "1.0.0",
"engines": {
"node": ">=6.12"
},
"private": true,
"description": "0x Instant React Component",
"main": "lib/src/index.js",
"types": "lib/src/index.d.ts",
@ -29,8 +28,8 @@
"config": {
"postpublish": {
"assets": [
"packages/instant/public/index.js",
"packages/instant/public/index.min.js"
"packages/instant/umd/instant.js",
"packages/instant/umd/instant.min.js"
]
}
},
@ -98,6 +97,6 @@
"webpack-dev-server": "^3.1.9"
},
"publishConfig": {
"access": "private"
"access": "public"
}
}

View File

@ -6,7 +6,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>0x Instant Dev Environment</title>
<link rel="stylesheet" href="/external.css">
<script type="text/javascript" src="/main.bundle.js" charset="utf-8"></script>
<script type="text/javascript" src="/instant.js" charset="utf-8"></script>
<script type="text/javascript" src="https://unpkg.com/jsuri@1.3.1/Uri.js" charset="utf-8"></script>
<script type="text/javascript" src="https://unpkg.com/bignumber.js@4.1.0/bignumber.js" charset="utf-8"></script>
<style>

View File

@ -2,11 +2,14 @@ const path = require('path');
const ip = require('ip');
// The common js bundle (not this one) is built using tsc.
// The umd bundle (this one) has a different entrypoint.
const outputPath = process.env.WEBPACK_OUTPUT_PATH || 'umd';
const config = {
entry: './src/index.umd.ts',
entry: {
instant: './src/index.umd.ts',
},
output: {
filename: '[name].bundle.js',
path: path.resolve(__dirname, 'public'),
filename: '[name].js',
path: path.resolve(__dirname, outputPath),
library: 'zeroExInstant',
libraryTarget: 'umd',
},