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

add babel-polyfill #1322

Closed
wants to merge 1 commit into from
Closed

add babel-polyfill #1322

wants to merge 1 commit into from

Conversation

gschrader
Copy link
Contributor

in order to add Object.assign and Array.includes support for older browsers (#1302)

@gschrader
Copy link
Contributor Author

I'm not sure this is the best way to do this, it's a shame it has to be added to each entry point.

@ascott
Copy link
Contributor

ascott commented Oct 11, 2016

i would prefer to do this in webpack.config.js, adding 'babel-polyfill' to the entry array
https://babeljs.io/docs/usage/polyfill/

module.exports = {
   entry: ['babel-polyfill', './app/js']
};

@gschrader
Copy link
Contributor Author

@ascott I'll try to do it that way, I'm a webpack newbie so I wasn't sure how that lined up with this structure:

  entry: {
    'css-theme': APP_DIR + '/javascripts/css-theme.js',
    dashboard: APP_DIR + '/javascripts/dashboard/Dashboard.jsx',
    explore: APP_DIR + '/javascripts/explore/explore.jsx',
    explorev2: APP_DIR + '/javascripts/explorev2/index.jsx',
    welcome: APP_DIR + '/javascripts/welcome.js',
    standalone: APP_DIR + '/javascripts/standalone.js',
    common: APP_DIR + '/javascripts/common.js',
    sqllab: APP_DIR + '/javascripts/SqlLab/index.jsx',
  },

I assume I just add the entry and then I'd have to add the built asset to the html template?

@ascott
Copy link
Contributor

ascott commented Oct 11, 2016

you would remove the require('babel-polyfill'); line in the templates and add babel-polyfill to the entry arrays like this...

entry: {
  'css-theme': ['babel-polyfill', APP_DIR + '/javascripts/css-theme.js'],
  ...
},

the entry object can take either strings to a single file or an array.

thanks for the pr!

@ascott
Copy link
Contributor

ascott commented Oct 12, 2016

@gschrader turns out i had a branch with this work started already so I opened a PR with the working implementation. thanks for your contribution! #1323

@ascott ascott closed this Oct 12, 2016
@gschrader
Copy link
Contributor Author

@ascott great! I'll try your branch with the javafx browser.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants