Open mikelfcosta opened 2 years ago
Hey thanks! I don't know very much about the NextJS build pipeline. But it sure sounds like a plugin we could build, similar (if not using) to the webpack plugin. You're right that today, the webpack plugin does only work if using the HTML plugin, something that most people do today.
You might be able to use the webpack plugin with headerInjection: false
though. I think that's the only option that requires the HTML plugin.
Looking at it, headerInjection: false
doesn't quite solve the issue. While it may be the only config option using the plugin, the index file still tries to import from the library. Given that it's a peer dependency of @app-config/webpack
it might not be best to assume the package exists in the index file.
Checking to see if the module exists first using require.resolve("html-webpack-plugin")
might be a solution.
the index file still tries to import from the library
Oh! The import there makes sense, I didn't notice that. So a lazy load instead would likely work.
I'm looking to create a PR to lazy load the module! It doesn't seem that I have access to push to a new branch.
I was able to create a PR for lazy loading: https://github.com/launchcodedev/app-config/pull/218
Hey!
I've used this library really well in SPA apps and express servers, and it worked perfectly with the schema validation and environment configs.
While trying to use it in a NextJS app, I ran into the following issues:
Has anyone had success using this lib with a NextJS app, or if there are any plans for a plugin to support it?