next.config.js 980 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. import packageJSON from './package.json';
  2. // define transpiled packages for '@growi/*'
  3. const withTM = require('next-transpile-modules')([
  4. '@growi/core',
  5. '@growi/ui',
  6. ]);
  7. // define additional entries
  8. const additionalWebpackEntries = {
  9. boot: './src/client/boot',
  10. };
  11. /** @type {import('next').NextConfig} */
  12. const nextConfig = {
  13. reactStrictMode: true,
  14. typescript: {
  15. tsconfigPath: 'tsconfig.build.client.json',
  16. },
  17. webpack(config, options) {
  18. // configure additional entries
  19. const orgEntry = config.entry;
  20. config.entry = () => {
  21. return orgEntry().then((entry) => {
  22. return { ...entry, ...additionalWebpackEntries };
  23. });
  24. };
  25. // configure plugins
  26. const WebpackAssetsManifest = require('webpack-assets-manifest');
  27. config.plugins.push(
  28. new WebpackAssetsManifest({
  29. publicPath: true,
  30. output: 'custom-manifest.json',
  31. }),
  32. );
  33. return config;
  34. },
  35. };
  36. module.exports = withTM(nextConfig)