How am I suppose to import list.js with es6 and webpack ?
See original GitHub issueI 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:
- Created 6 years ago
- Comments:15 (2 by maintainers)
Top 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 >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Simply put
import List from 'list.js';
on top of your file and use the library usingnew List()
.This worked for me.
import * as List from 'list.js';