Answer the question
In order to leave comments, you need to log in
What is the correct way to export a compressed (uglifyjs) npm package?
Greetings, I wrote a simple wrapper over api using ES7 features, then I transpiled the whole thing with the help of webpack, or rather even with the help of babel, transpiled it into ES5.
The problem is that when I import it in another project, I get just an empty object,
although it is in the package code. export default
In this regard, I have a number of questions that I would like to receive answers from the community
import library from 'library'
an empty object if there isexport default
export'ы
's module.exports
not in the browser, how can I access my package in the browser, because it is isolated from the global scope? use window.myLibrary? is this the normal approach?Answer the question
In order to leave comments, you need to log in
Found a solution in the webpack documentation, the section is called Authoring Libraries
https://github.com/reactjs/redux
Take a close look at rollup.config.js and package.json
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question