Last active
April 8, 2018 02:25
-
-
Save rauschma/fc6973110700c4932d360d5eb6ad9931 to your computer and use it in GitHub Desktop.
Revisions
-
rauschma revised this gist
Jul 25, 2017 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,6 +1,6 @@ # Polyfillying the standard library when using `babel-preset-env` * Overview of a workflow based on `env`: http://2ality.com/2017/07/npm-packages-via-babel.html * `env` has the option `useBuiltins` that helps with polyfilling the standard library: https://github.com/babel/babel-preset-env#usebuiltins ## Browsers -
rauschma revised this gist
Jul 25, 2017 . 1 changed file with 3 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,6 +1,7 @@ # Polyfillying the standard library when using `babel-preset-env` * General sketch of a workflow based on `env`: http://2ality.com/2017/07/npm-packages-via-babel.html * `env` has the option `useBuiltins` that helps with polyfilling the standard library: https://github.com/babel/babel-preset-env#usebuiltins ## Browsers -
rauschma revised this gist
Jul 25, 2017 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -4,7 +4,7 @@ General sketch of a workflow based on `env`: http://2ality.com/2017/07/npm-packa ## Browsers Approach for untranspiled code (meant to be transpiled by Babel and, e.g., webpack): * No package ever polyfills. * Use only functionality at stage 4 or older. -
rauschma revised this gist
Jul 25, 2017 . 1 changed file with 6 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,4 +1,8 @@ # Polyfillying when using `babel-preset-env` General sketch of a workflow based on `env`: http://2ality.com/2017/07/npm-packages-via-babel.html ## Browsers Approach for untranspiled code: @@ -7,7 +11,7 @@ Approach for untranspiled code: * The entry point does `import "babel-polyfill";` for which `env.useBuiltins` generates the imports appropriate for the current targets. * Benefit: the bundle only includes functionality that the target platforms don’t have. Think: custom-tailored `babel-polyfill`. ## Node.js For Node.js, the untranspiled code would be transpiled via `target: { node: "current" }`. -
rauschma revised this gist
Jul 25, 2017 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -11,5 +11,5 @@ Approach for untranspiled code: For Node.js, the untranspiled code would be transpiled via `target: { node: "current" }`. * To play it safe, should every package do `import "babel-polyfill";` at its entry point? * Note: not as problematic, because bundle size is not a factor on Node.js. -
rauschma revised this gist
Jul 25, 2017 . 1 changed file with 2 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -2,8 +2,8 @@ Approach for untranspiled code: * No package ever polyfills. * Use only functionality at stage 4 or older. * The entry point does `import "babel-polyfill";` for which `env.useBuiltins` generates the imports appropriate for the current targets. * Benefit: the bundle only includes functionality that the target platforms don’t have. Think: custom-tailored `babel-polyfill`. -
rauschma created this gist
Jul 25, 2017 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,15 @@ # Browsers Approach for untranspiled code: * No package ever polyfills * Use only functionality from stage 4 or older * The entry point does `import "babel-polyfill";` for which `env.useBuiltins` generates the imports appropriate for the current targets. * Benefit: the bundle only includes functionality that the target platforms don’t have. Think: custom-tailored `babel-polyfill`. # Node.js For Node.js, the untranspiled code would be transpiled via `target: { node: "current" }`. * Play it safe, should every package do `import "babel-polyfill";` at its entry point? * Note: not as problematic, because bundle size is not a factor on Node.js.