Skip to content

Commit

Permalink
Adds build-web script for transpiling an ES5 distribution
Browse files Browse the repository at this point in the history
  • Loading branch information
spong committed Oct 19, 2019
1 parent 796fa90 commit bddc939
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 1 deletion.
16 changes: 16 additions & 0 deletions babel.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
module.exports = {
env: {
web: {
presets: [
[
'@babel/preset-env',
{
useBuiltIns: 'entry',
modules: false,
corejs: 3,
},
],
]
},
},
};
5 changes: 4 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,16 @@
"description": "Build an element once, move it anywhere",
"main": "dist/cjs/index.js",
"module": "dist/esm/index.js",
"browser": "dist/web/index.js",
"types": "dist/index.d.ts",
"files": [
"dist/**/*.{js,ts,map}",
"src/**/*",
"README.md"
],
"scripts": {
"build": "rimraf dist/ && tsc -p tsconfig.cjs.json && tsc -p tsconfig.esm.json",
"build": "rimraf dist/ && tsc -p tsconfig.cjs.json && tsc -p tsconfig.esm.json && npm run build-web",
"build-web": "BABEL_ENV=web babel dist/esm --config-file=./babel.config.js --out-dir=dist/web",
"pretest": "npm run build",
"test": "echo \"It built ok, that'll do for now\"",
"prepack": "npm run build",
Expand All @@ -38,6 +40,7 @@
},
"homepage": "https://github.com/httptoolkit/react-reverse-portal#readme",
"devDependencies": {
"@babel/cli": "^7.6.4",
"@babel/core": "^7.5.5",
"@storybook/addon-storysource": "^5.1.11",
"@storybook/addons": "^5.1.11",
Expand Down

0 comments on commit bddc939

Please sign in to comment.