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

chore: build/transpile itowns to specific targets. #1231

Closed
wants to merge 2 commits into from

Conversation

gchoqueux
Copy link
Contributor

Description

With babel it's possible to transpile itowns to specific targets. (visiting).
I would like target to specific browser using browserslist.

Questions

  • For example, the possible targets could be browsers supporting ES6.
  • In webpack.config.js there is this comment (see bellow), I think it's obsolete, then we could remove target option { modules: false }, WDYT?
/*
   configuring babel:
   - when babel runs alone (for `test-unit` for instance), we let him deal with
   ES6 modules, because node doesn't support them yet (planned for v10 lts).
   - however, webpack also has ES6 module support and these 2 don't play well
   together. When running webpack (either `build` or `start` script), we prefer
   to rely on webpack loaders (much more powerful and gives more possibilities),
   so let's disable modules for babel here.
*/

@gchoqueux gchoqueux added this to the 2.xx.x milestone Sep 13, 2019
Copy link
Contributor

@tbroyer tbroyer left a comment

Choose a reason for hiding this comment

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

How about putting the browserslist configuration in the package.json or a .browserslistrc file, and then (possibly) use the eslint-plugin-compat plugin to also detect usage of features that are not supported by the target browsers? (you'd probably have to "annotate" non-client files with /* eslint-env node */ to disable the plugin where it doesn't make sense, such as the webpack.config.js)

"presets": ["@babel/preset-env"],
"presets": [["@babel/preset-env",
{
"targets": "> 0.5%, last 2 versions, Firefox ESR, not dead"
Copy link
Contributor

Choose a reason for hiding this comment

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

This query (which is equivalent to "defaults") includes Opera Mini which, among others things, doesn't support WebGL.

@Desplandis
Copy link
Contributor

Done in #2296 and #2252.
We can close this PR.

@Desplandis Desplandis closed this Jun 6, 2024
@gchoqueux gchoqueux deleted the babel_target branch January 31, 2025 16:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants