Просмотр исходного кода

remove boot.js and simplify next.config.js

Yuki Takei 3 лет назад
Родитель
Сommit
61f7f7eb05

+ 0 - 0
packages/app/src/client/boot.js → packages/app/_obsolete/src/client/boot.js


+ 0 - 0
packages/app/src/client/util/old-ios.js → packages/app/_obsolete/src/util/old-ios.js


+ 0 - 21
packages/app/next.config.js

@@ -9,12 +9,6 @@ const { withSuperjson } = require('next-superjson');
 const { PHASE_PRODUCTION_BUILD, PHASE_PRODUCTION_SERVER } = require('next/constants');
 const { PHASE_PRODUCTION_BUILD, PHASE_PRODUCTION_SERVER } = require('next/constants');
 
 
 
 
-// define additional entries
-const additionalWebpackEntries = {
-  boot: './src/client/boot',
-};
-
-
 const setupTranspileModules = () => {
 const setupTranspileModules = () => {
   const eazyLogger = require('eazy-logger');
   const eazyLogger = require('eazy-logger');
   const { listScopedPackages, listPrefixedPackages } = require('./src/utils/next.config.utils');
   const { listScopedPackages, listPrefixedPackages } = require('./src/utils/next.config.utils');
@@ -87,21 +81,6 @@ module.exports = async(phase, { defaultConfig }) => {
       config.externals.push('dtrace-provider');
       config.externals.push('dtrace-provider');
       config.externals.push('mongoose');
       config.externals.push('mongoose');
 
 
-      // configure additional entries
-      const orgEntry = config.entry;
-      config.entry = () => {
-        return orgEntry().then((entry) => {
-          return { ...entry, ...additionalWebpackEntries };
-        });
-      };
-
-      const { WebpackManifestPlugin } = require('webpack-manifest-plugin');
-      config.plugins.push(
-        new WebpackManifestPlugin({
-          fileName: 'custom-manifest.json',
-        }),
-      );
-
       // setup i18next-hmr
       // setup i18next-hmr
       if (!options.isServer && options.dev) {
       if (!options.isServer && options.dev) {
         const { I18NextHMRPlugin } = require('i18next-hmr/plugin');
         const { I18NextHMRPlugin } = require('i18next-hmr/plugin');

+ 1 - 2
packages/app/package.json

@@ -251,7 +251,6 @@
     "ts-node": "^9.1.1",
     "ts-node": "^9.1.1",
     "ts-node-dev": "^2.0.0",
     "ts-node-dev": "^2.0.0",
     "tsc-alias": "^1.2.9",
     "tsc-alias": "^1.2.9",
-    "unstated": "^2.1.1",
-    "webpack-manifest-plugin": "^5.0.0"
+    "unstated": "^2.1.1"
   }
   }
 }
 }

+ 5 - 21
packages/app/src/pages/_document.page.tsx

@@ -1,45 +1,29 @@
 import React from 'react';
 import React from 'react';
 
 
-import fs from 'fs';
-
 import Document, {
 import Document, {
   DocumentContext, DocumentInitialProps,
   DocumentContext, DocumentInitialProps,
   Html, Head, Main, NextScript,
   Html, Head, Main, NextScript,
 } from 'next/document';
 } from 'next/document';
 
 
-// import { renderScriptTagsByGroup, renderStyleTagsByGroup } from '~/service/cdn-resources-loader';
-import { resolveFromRoot } from '~/utils/project-dir-utils';
 
 
-interface GrowiDocumentProps {
-  bootJsPath: string;
-}
-declare type GrowiDocumentInitialProps = DocumentInitialProps & GrowiDocumentProps;
+// type GrowiDocumentProps = {};
+// declare type GrowiDocumentInitialProps = GrowiDocumentProps & DocumentInitialProps;
+declare type GrowiDocumentInitialProps = DocumentInitialProps;
 
 
-async function importCustomManifest(): Promise<any> {
-  const customManifestStr: string = await fs.readFileSync(resolveFromRoot('.next/custom-manifest.json'), 'utf-8');
-  return JSON.parse(customManifestStr);
-}
 
 
-class GrowiDocument extends Document<GrowiDocumentProps> {
+class GrowiDocument extends Document {
 
 
   static override async getInitialProps(ctx: DocumentContext): Promise<GrowiDocumentInitialProps> {
   static override async getInitialProps(ctx: DocumentContext): Promise<GrowiDocumentInitialProps> {
     const initialProps: DocumentInitialProps = await Document.getInitialProps(ctx);
     const initialProps: DocumentInitialProps = await Document.getInitialProps(ctx);
 
 
-    const customManifest: any = await importCustomManifest();
-    const bootJsPath = customManifest['boot.js'];
-
-    return { ...initialProps, bootJsPath };
+    return initialProps;
   }
   }
 
 
   override render(): JSX.Element {
   override render(): JSX.Element {
 
 
-    const { bootJsPath } = this.props;
-
     return (
     return (
       <Html>
       <Html>
         <Head>
         <Head>
-          {/* eslint-disable-next-line @next/next/no-sync-scripts */}
-          <script src={bootJsPath}></script>
           {/*
           {/*
           {renderScriptTagsByGroup('basis')}
           {renderScriptTagsByGroup('basis')}
           {renderStyleTagsByGroup('basis')}
           {renderStyleTagsByGroup('basis')}

+ 0 - 26
yarn.lock

@@ -19501,11 +19501,6 @@ sort-keys@^4.0.0:
   dependencies:
   dependencies:
     is-plain-obj "^2.0.0"
     is-plain-obj "^2.0.0"
 
 
-source-list-map@^2.0.1:
-  version "2.0.1"
-  resolved "https://registry.yarnpkg.com/source-list-map/-/source-list-map-2.0.1.tgz#3993bd873bfc48479cca9ea3a547835c7c154b34"
-  integrity sha512-qnQ7gVMxGNxsiL4lEuJwe/To8UnK7fAnmbGEEH8RpLouuKbeEm0lhbQVFIrNSuB+G7tVrAlVsZgETT5nljf+Iw==
-
 "source-map-js@>=0.6.2 <2.0.0":
 "source-map-js@>=0.6.2 <2.0.0":
   version "1.0.2"
   version "1.0.2"
   resolved "https://registry.yarnpkg.com/source-map-js/-/source-map-js-1.0.2.tgz#adbc361d9c62df380125e7f161f71c826f1e490c"
   resolved "https://registry.yarnpkg.com/source-map-js/-/source-map-js-1.0.2.tgz#adbc361d9c62df380125e7f161f71c826f1e490c"
@@ -20305,11 +20300,6 @@ table@^6.7.5:
     string-width "^4.2.3"
     string-width "^4.2.3"
     strip-ansi "^6.0.1"
     strip-ansi "^6.0.1"
 
 
-tapable@^2.0.0:
-  version "2.2.1"
-  resolved "https://registry.yarnpkg.com/tapable/-/tapable-2.2.1.tgz#1967a73ef4060a82f12ab96af86d52fdb76eeca0"
-  integrity sha512-GNzQvQTOIP6RyTfE2Qxb8ZVlNmw0n88vp1szwWRimP02mnTsx3Wtn5qRdqY9w2XduFNUgvOwhNnQsjwCp+kqaQ==
-
 tapable@^2.2.0:
 tapable@^2.2.0:
   version "2.2.0"
   version "2.2.0"
   resolved "https://registry.yarnpkg.com/tapable/-/tapable-2.2.0.tgz#5c373d281d9c672848213d0e037d1c4165ab426b"
   resolved "https://registry.yarnpkg.com/tapable/-/tapable-2.2.0.tgz#5c373d281d9c672848213d0e037d1c4165ab426b"
@@ -22029,22 +22019,6 @@ webpack-bundle-analyzer@4.3.0:
     sirv "^1.0.7"
     sirv "^1.0.7"
     ws "^7.3.1"
     ws "^7.3.1"
 
 
-webpack-manifest-plugin@^5.0.0:
-  version "5.0.0"
-  resolved "https://registry.yarnpkg.com/webpack-manifest-plugin/-/webpack-manifest-plugin-5.0.0.tgz#084246c1f295d1b3222d36e955546433ca8df803"
-  integrity sha512-8RQfMAdc5Uw3QbCQ/CBV/AXqOR8mt03B6GJmRbhWopE8GzRfEpn+k0ZuWywxW+5QZsffhmFDY1J6ohqJo+eMuw==
-  dependencies:
-    tapable "^2.0.0"
-    webpack-sources "^2.2.0"
-
-webpack-sources@^2.2.0:
-  version "2.3.1"
-  resolved "https://registry.yarnpkg.com/webpack-sources/-/webpack-sources-2.3.1.tgz#570de0af163949fe272233c2cefe1b56f74511fd"
-  integrity sha512-y9EI9AO42JjEcrTJFOYmVywVZdKVUfOvDUPsJea5GIr1JOEGFVqwlY2K098fFoIjOkDzHn2AjRvM8dsBZu+gCA==
-  dependencies:
-    source-list-map "^2.0.1"
-    source-map "^0.6.1"
-
 whatwg-encoding@^1.0.5:
 whatwg-encoding@^1.0.5:
   version "1.0.5"
   version "1.0.5"
   resolved "https://registry.yarnpkg.com/whatwg-encoding/-/whatwg-encoding-1.0.5.tgz#5abacf777c32166a51d085d6b4f3e7d27113ddb0"
   resolved "https://registry.yarnpkg.com/whatwg-encoding/-/whatwg-encoding-1.0.5.tgz#5abacf777c32166a51d085d6b4f3e7d27113ddb0"