I\'m currently building a library of React components and bundling it with Webpack 4.
Everything works just fine from building the library\'s bundle to publishing it on
You're exporting your library as commonjs
and trying to import it via import/export
syntax. You should change your output to
output: {
filename: "index.js",
path: path.resolve(__dirname, "dist"),
libraryTarget: "umd",
library: "my-design-system"
}
Found a lot of info here: https://webpack.js.org/guides/author-libraries/