Skip to content

Commit 63cc092

Browse files
committed
Transpile build with babel
1 parent 0956ccd commit 63cc092

File tree

5 files changed

+1340
-180
lines changed

5 files changed

+1340
-180
lines changed

.babelrc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"presets": [
3+
["@babel/env", { "modules": false, "useBuiltIns": "entry", "corejs": 3 }]
4+
]
5+
}

package.json

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88
"blocknative",
99
"wallet"
1010
],
11-
"main": "dist/bnc-onboard.js",
12-
"module": "dist/bnc-onboard.es5.js",
11+
"main": "dist/onboard.umd.js",
12+
"module": "dist/onboard.esm.js",
1313
"typings": "dist/src/onboard.d.ts",
1414
"files": [
1515
"dist"
@@ -21,17 +21,20 @@
2121
},
2222
"license": "MIT",
2323
"devDependencies": {
24+
"@babel/cli": "^7.7.0",
25+
"@babel/core": "^7.5.5",
26+
"@babel/preset-env": "^7.5.5",
27+
"@joseph184/rollup-plugin-node-builtins": "^2.1.4",
2428
"@pyoner/svelte-ts-preprocess": "^1.2.1",
29+
"@rollup/plugin-json": "^4.0.0",
2530
"@types/node": "^12.12.3",
26-
"@joseph184/rollup-plugin-node-builtins": "^2.1.4",
31+
"babel-plugin-external-helpers": "^6.18.0",
2732
"rollup": "^1.12.0",
2833
"rollup-plugin-commonjs": "^10.0.0",
2934
"rollup-plugin-img": "^1.1.0",
30-
"rollup-plugin-json": "^4.0.0",
3135
"rollup-plugin-node-globals": "^1.4.0",
3236
"rollup-plugin-node-resolve": "^5.2.0",
3337
"rollup-plugin-svelte": "^5.0.3",
34-
"rollup-plugin-terser": "^4.0.4",
3538
"rollup-plugin-typescript2": "0.21.0",
3639
"svelte": "^3.12.1",
3740
"svelte-i18n": "^1.1.2-beta",
@@ -49,7 +52,7 @@
4952
"squarelink": "^1.1.3"
5053
},
5154
"scripts": {
52-
"build": "rollup -c",
55+
"build": "rollup -c && babel dist/onboard.esm.js --out-file dist/onboard.esm.js && babel dist/onboard.umd.js --out-file dist/onboard.umd.js --minified",
5356
"test": "echo \"TBD\" && exit 0"
5457
}
5558
}

rollup.config.js

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
11
import svelte from "rollup-plugin-svelte"
22
import resolve from "rollup-plugin-node-resolve"
3-
import json from "rollup-plugin-json"
3+
import json from "@rollup/plugin-json"
44
import image from "rollup-plugin-img"
55
import commonjs from "rollup-plugin-commonjs"
66
import globals from "rollup-plugin-node-globals"
77
import builtins from "@joseph184/rollup-plugin-node-builtins"
8-
import { terser } from "rollup-plugin-terser"
98
import typescript from "rollup-plugin-typescript2"
109

1110
import {
@@ -28,10 +27,9 @@ export default [
2827
{
2928
input: "src/onboard.ts",
3029
output: {
31-
sourcemap: true,
3230
format: "umd",
3331
name: "onboard",
34-
file: "dist/bnc-onboard.js"
32+
file: "dist/onboard.umd.js"
3533
},
3634
moduleContext: id => {
3735
const thisAsWindowForModules = [
@@ -58,16 +56,14 @@ export default [
5856
commonjs(),
5957
globals(),
6058
builtins(),
61-
typescript(),
62-
terser()
59+
typescript()
6360
]
6461
},
6562
{
6663
input: "src/onboard.ts",
6764
output: {
68-
sourcemap: true,
6965
format: "es",
70-
file: "dist/bnc-onboard.es5.js"
66+
file: "dist/onboard.esm.js"
7167
},
7268
moduleContext: id => {
7369
const thisAsWindowForModules = [

tsconfig.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
// "baseUrl": "./", /* Base directory to resolve non-absolute module names. */
4545
// "paths": {}, /* A series of entries which re-map imports to lookup locations relative to the 'baseUrl'. */
4646
// "rootDirs": [], /* List of root folders whose combined content represents the structure of the project at runtime. */
47-
"typeRoots": [] /* List of folders to include type definitions from. */,
47+
// "typeRoots": [] /* List of folders to include type definitions from. */,
4848
"types": [
4949
"svelte",
5050
"node"

0 commit comments

Comments
 (0)