|
@@ -1,12 +1,29 @@
|
|
|
|
|
+import eazyLogger from 'eazy-logger';
|
|
|
import { I18NextHMRPlugin } from 'i18next-hmr/plugin';
|
|
import { I18NextHMRPlugin } from 'i18next-hmr/plugin';
|
|
|
import { WebpackManifestPlugin } from 'webpack-manifest-plugin';
|
|
import { WebpackManifestPlugin } from 'webpack-manifest-plugin';
|
|
|
|
|
|
|
|
import { i18n, localePath } from './src/next-i18next.config';
|
|
import { i18n, localePath } from './src/next-i18next.config';
|
|
|
import { listScopedPackages } from './src/utils/next.config.utils';
|
|
import { listScopedPackages } from './src/utils/next.config.utils';
|
|
|
|
|
|
|
|
-// define transpiled packages for '@growi/*'
|
|
|
|
|
-const scopedPackages = listScopedPackages(['@growi']);
|
|
|
|
|
-const withTM = require('next-transpile-modules')(scopedPackages);
|
|
|
|
|
|
|
+
|
|
|
|
|
+// setup logger
|
|
|
|
|
+const logger = eazyLogger.Logger({
|
|
|
|
|
+ prefix: '[{green:next.config.js}] ',
|
|
|
|
|
+ useLevelPrefixes: false,
|
|
|
|
|
+});
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+const setupWithTM = () => {
|
|
|
|
|
+ // define transpiled packages for '@growi/*'
|
|
|
|
|
+ const scopedPackages = listScopedPackages(['@growi'], { ignorePackageNames: '@growi/app' });
|
|
|
|
|
+
|
|
|
|
|
+ logger.info('{bold:Listing scoped packages for transpiling:}');
|
|
|
|
|
+ logger.unprefixed('info', `{grey:${JSON.stringify(scopedPackages, null, 2)}}`);
|
|
|
|
|
+
|
|
|
|
|
+ return require('next-transpile-modules')(scopedPackages);
|
|
|
|
|
+};
|
|
|
|
|
+const withTM = setupWithTM();
|
|
|
|
|
+
|
|
|
|
|
|
|
|
// define additional entries
|
|
// define additional entries
|
|
|
const additionalWebpackEntries = {
|
|
const additionalWebpackEntries = {
|