GithubHelp home page GithubHelp logo

Comments (6)

krasimir avatar krasimir commented on June 2, 2024

Hm ... why you need to add babel-polyfill to the webpack.config.js file. By importing it you are already including it in the bundle.

from webpack-library-starter.

nelsyeung avatar nelsyeung commented on June 2, 2024

@krasimir Because of this documentation: https://babeljs.io/docs/usage/polyfill/ I've tried removing the import 'babel-polyfill'; from the beginning of "src/index.js" and it's still not working. Also tried using just the import 'babel-polyfill' instead of the entry inside webpack.config.js.

from webpack-library-starter.

krasimir avatar krasimir commented on June 2, 2024

I see ... what if you not importing it. I mean using only the addition to webpack.config.js file.

from webpack-library-starter.

nelsyeung avatar nelsyeung commented on June 2, 2024

I've tried every single combinations:

  1. Have both the import and webpack entry: not working
  2. Have only the import in index.js: not working
  3. Have only the webpack entry: not working
  4. Without the import and webpack entry: working (lol basically just your package so of course its working)

from webpack-library-starter.

krasimir avatar krasimir commented on June 2, 2024

Thanks. I'll investigate.

from webpack-library-starter.

nelsyeung avatar nelsyeung commented on June 2, 2024

Sorry about this, I shouldn't even be using babel-polyfill for a library. The reason why this doesn't work is because webpack build for the browsers but Mocha is running tests in node, so it wouldn't have the window object to store _babelPolyfill, therefore undefined. I will close this issue now.

from webpack-library-starter.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.