We wanted to integrate Flexmonster in our build system, using webpack and standard installation using npm/yarn.
As Flexmonster’s package.json does not have “main” field (which should be “flexmonster.js”), it is not possible to use it in tests run by node as imports are not working.
Also it is not possible to build it using webpack for the same reason, although we found a way around it (by using alias and exports-loader to mock module export).
Thank you for your question!
We have released Flexmonster as an npm package only a week ago, so it is not fully configured yet. Our dev team is going to further improve our npm package for wider usage and kindly ask you to use a workaround for now. We will inform you as soon as we have a better approach.
Please let us know if you have any other questions.
We have published a patch for NPM package (email@example.com) that simplifies the usage with Webpack and ES6/CommonJS modules.
Here is the link to our GitHub sample showing how Flexmonster is integrated with Webpack: https://github.com/flexmonster/pivot-webpack
Here you can see that Flexmonster JS and CSS are included in
index.js (via import/require). In
webpack.config.js we have used standard CSS and fonts loading.
We suggest you try this new version.
Our team would be grateful for any feedback.
Thank you very much, this is what we needed.
Alse the module export was an issue and it is fixed as well 🙂
We’re glad to hear that!
Thanks for letting us know.