question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

How am I suppose to import list.js with es6 and webpack ?

See original GitHub issue

I would have expect a export default List;

then I could do import List from 'list.js';

How am I suppose to do that ? thanks in advance !

Issue Analytics

  • State:open
  • Created 6 years ago
  • Comments:15 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
thedaviddiascommented, Nov 13, 2017

Simply put import List from 'list.js'; on top of your file and use the library using new List().

0reactions
monamiicommented, Jul 25, 2022

This worked for me. import * as List from 'list.js';

Read more comments on GitHub >

github_iconTop Results From Across the Web

Module Methods - webpack
Version 2 of webpack supports ES6 module syntax natively, meaning you can use import and export without a tool like babel to handle...
Read more >
How can I use ES6 in webpack.config.js? - Stack Overflow
import path from 'path'; import webpack from 'webpack'; const config: webpack.Configuration = { mode: 'production', entry: './foo.js', output: { path: path.
Read more >
Getting started with webpack and ES6 modules | by Scott Vinkle
With webpack installed, setup, and ready to bundle our source code, we can now start using the import and export JavaScript keywords.
Read more >
import - JavaScript - MDN Web Docs - Mozilla
This is often a relative or absolute URL to the .js file containing the module. In Node, extension-less imports often refer to packages...
Read more >
How to transpile ES modules with webpack and Node.js
This means that we can use import and export statements without relying on external transpilation tools or dependencies like Babel. However, it ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found