aboutsummaryrefslogtreecommitdiffstats
path: root/packages
diff options
context:
space:
mode:
Diffstat (limited to 'packages')
-rw-r--r--packages/instant/package.json14
-rw-r--r--packages/instant/src/index.ts2
-rw-r--r--packages/instant/tsconfig.json5
-rw-r--r--packages/instant/webpack.config.js12
4 files changed, 25 insertions, 8 deletions
diff --git a/packages/instant/package.json b/packages/instant/package.json
index 7f1530fa8..d33dfb7c3 100644
--- a/packages/instant/package.json
+++ b/packages/instant/package.json
@@ -8,19 +8,26 @@
"main": "lib/src/index.js",
"types": "lib/src/index.d.ts",
"scripts": {
+ "build": "yarn build:all",
+ "build:all": "run-p build:umd:prod build:commonjs",
+ "build:umd:prod": "webpack --mode production",
+ "build:commonjs": "tsc -b",
"watch_without_deps": "tsc -w",
+ "dev": "webpack-dev-server --mode development",
"lint": "tslint --project .",
"test": "jest",
"test:coverage": "jest --coverage",
"rebuild_and_test": "run-s clean build test",
"test:circleci": "yarn test:coverage",
"clean": "shx rm -rf lib coverage scripts",
- "build": "webpack --mode production && copyfiles -u 3 './lib/src/monorepo_scripts/**/*' ./scripts",
"manual:postpublish": "yarn build; node ./scripts/postpublish.js"
},
"config": {
"postpublish": {
- "assets": []
+ "assets": [
+ "packages/instant/public/index.js",
+ "packages/instant/public/index.min.js"
+ ]
}
},
"repository": {
@@ -66,7 +73,8 @@
"typedoc": "0.12.0",
"typescript": "3.0.1",
"webpack": "^4.20.2",
- "webpack-cli": "^3.1.1"
+ "webpack-cli": "^3.1.1",
+ "webpack-dev-server": "^3.1.9"
},
"publishConfig": {
"access": "private"
diff --git a/packages/instant/src/index.ts b/packages/instant/src/index.ts
index 345246d09..54059cdad 100644
--- a/packages/instant/src/index.ts
+++ b/packages/instant/src/index.ts
@@ -1 +1 @@
-export { ZeroExInstant } from './components/zero_ex_instant';
+export { ZeroExInstant, ZeroExInstantProps } from './components/zero_ex_instant';
diff --git a/packages/instant/tsconfig.json b/packages/instant/tsconfig.json
index 69d2520fa..28a6190b8 100644
--- a/packages/instant/tsconfig.json
+++ b/packages/instant/tsconfig.json
@@ -8,9 +8,10 @@
"noImplicitAny": true,
"module": "ESNext",
"moduleResolution": "node",
- "lib": ["es2015"],
+ "lib": ["es2015", "dom"],
"target": "es5",
"sourceMap": true
},
- "include": ["./src/**/*", "./test/**/*"]
+ "include": ["./src/**/*", "./test/**/*"],
+ "exclude": ["./src/index.umd.ts"]
}
diff --git a/packages/instant/webpack.config.js b/packages/instant/webpack.config.js
index f7500c69c..78a33ce90 100644
--- a/packages/instant/webpack.config.js
+++ b/packages/instant/webpack.config.js
@@ -1,9 +1,13 @@
const path = require('path');
+// The common js bundle (not this one) is built using tsc.
+// The umd bundle (this one) has a different entrypoint.
module.exports = {
- entry: './src/index.ts',
+ entry: './src/index.umd.ts',
output: {
filename: '[name].bundle.js',
- path: path.resolve(__dirname, 'lib'),
+ path: path.resolve(__dirname, 'public'),
+ library: 'zeroExInstant',
+ libraryTarget: 'umd',
},
devtool: 'source-map',
resolve: {
@@ -17,4 +21,8 @@ module.exports = {
},
],
},
+ devServer: {
+ contentBase: path.join(__dirname, 'public'),
+ port: 5000,
+ },
};