Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added esnext as a build target. #3230

Merged
merged 3 commits into from
Jan 8, 2019
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions packages/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"description": "Core styles & components",
"main": "lib/cjs/index.js",
"module": "lib/esm/index.js",
"esnext": "lib/esnext/index.js",

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Out of curiosity, is there already an established precedent for using "esnext" for this?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no, I don't think so. would probably be good to settle on a precedent though for future packages

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have seen a reasonable amount of code on the web that has it this way. Webpack doesn't load esnext by default, which is good, because using it will require babel for most people. https://webpack.js.org/configuration/resolve/#resolve-mainfields

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Best prior art, both from a top linked result from google as well as being referenced in the few other places I tried to find information: http://2ality.com/2017/04/transpiling-dependencies-babel.html

Its not "spec" but that shouldn't matter.

"typings": "lib/esm/index.d.ts",
"style": "lib/css/blueprint.css",
"unpkg": "dist/core.bundle.js",
Expand All @@ -19,6 +20,7 @@
"compile": "run-p \"compile:*\"",
"compile:esm": "tsc -p ./src",
"compile:cjs": "tsc -p ./src/tsconfig.cjs.json",
"compile:esnext": "tsc -p ./src/tsconfig.esnext.json",
"compile:css": "sass-compile ./src --functions ./scripts/sass-inline-svg.js",
"dev": "run-p \"compile:esm -- --watch\" \"compile:css -- --watch\"",
"dist": "run-s \"dist:*\"",
Expand Down
12 changes: 12 additions & 0 deletions packages/core/src/tsconfig.esnext.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"extends": "./tsconfig",
"compilerOptions": {
"target": "esnext",
"lib": [
giladgray marked this conversation as resolved.
Show resolved Hide resolved
"dom",
"dom.iterable",
giladgray marked this conversation as resolved.
Show resolved Hide resolved
"es2017"
],
"outDir": "../lib/esnext"
}
}