Static Site (from REACT) generator

npm i –save-dev react webpack webpack-dev-server jsx-loader static-site-generator-webpack-plugin react-router

 

Creating a static site from a Create React App (CRA) project involves rendering the React application to HTML at build time, rather than serving it as a dynamic JavaScript application. Here are the steps you can follow:

  1. Set Up Your Create React App: If you haven't already, initialize a new Create React App project.

    
    npx create-react-app my-static-site
    
  2. Modify the React App: Develop your application as you usually would. Ensure the routing (if you're using something like react-router) falls back to a default page for any undefined routes. This is essential because static sites can't determine routes on-the-fly like a dynamic application would.

  3. Integrate a Static Site Generator: One way to convert a dynamic React app into static HTML pages is by using a static site generator. Gatsby and Next.js with static site generation mode are popular choices.

    For this guide, let's use react-snap:

    a. Install react-snap:

    bashCopy code
    npm install react-snap
    

    b. Update your package.json: Add the following line to your package.json:

    
    "postbuild": "react-snap"
    

    Your scripts might look something like:

    
    "scripts": {
      "start": "react-scripts start",
      "build": "react-scripts build",
      "postbuild": "react-snap",
      "test": "react-scripts test",
      "eject": "react-scripts eject"
    }
    

    c. Update your index.js: Check if the application is being rendered by a crawler or by react-snap and use hydrate method:

    
    import React from 'react';
    import ReactDOM from 'react-dom';
    import App from './App';
    
    const rootElement = document.getElementById("root");
    
    
    
    
  4. Build Your App: Now, you can build your app using:

    
    npm run build
    

    react-snap will generate static HTML pages in the build directory.

  5. Deploy Your Static Site: Once built, the static pages are ready to be served by any static site host, like Netlify, Vercel, GitHub Pages, or even traditional web servers like Apache or Nginx. Upload the contents of the build directory to your chosen host.

Remember, when converting a dynamic React app to a static site, there are limitations. Dynamic features that require a runtime (like certain user interactions) will not work unless they're implemented using client-side JavaScript. However, for content-driven sites that don't require significant user interaction, generating a static site can improve performance and reduce server costs.

 

 

 

  1. Postbuild Command:

    Make sure you have the postbuild script set correctly in your package.json:

    jsonCopy code
    "postbuild": "react-snap"
    
  2. Run the Build Command:

    Make sure you run:

    bashCopy code
    npm run build
    

    After running this command, react-snap should execute due to the postbuild script.

  3. Check Console Output:

    Pay attention to any warnings or errors in the console output after running the build command. This can give insights into issues that might have occurred.

  4. Inspect react-snap Configuration:

    If you have a react-snap configuration in your package.json, ensure it's set up correctly. For instance:

    jsonCopy code
    "reactSnap": {
      "include": [
        "/",
        "/about"
        // ... other routes
      ]
    }
    
  5. Service Workers:

    If you have service workers (perhaps from using create-react-app's default service worker setup), it might cache the site and interfere with react-snap. You might want to unregister the service worker during the snapshot process.

  6. Dynamic Routes:

    react-snap pre-renders routes by visiting them in a headless browser. If you have routes generated based on dynamic data or API calls, you need to ensure those are captured or provide them in the reactSnap.include configuration.

  7. External API Calls:

    If your app makes API calls or relies on external data, there might be timing issues. Ensure any asynchronous operations are complete before the snapshotting process. You might need to adjust settings like reactSnap.timeout.

  8. Check the Snapshots:

    react-snap generates snapshots in the build directory. Check if .html files are generated for each of your routes.

  9. Hydration Errors:

    Ensure that your application is set up to handle both ReactDOM.render() and ReactDOM.hydrate(), as mentioned in the initial guide for setting up react-snap. If hydration errors occur, they might prevent the correct static generation.

  10. Dependencies:

Ensure all dependencies are up to date. Sometimes, incompatibilities between packages or using outdated versions can lead to unexpected behavior.

If none of the above resolves the issue, there might be a specific configuration or code issue in your application that's preventing the static generation. Sharing more specific details or error messages, if any, would help in pinpointing the problem.

 

 

 


 

 

 

To update a React app to produce static HTML pages using the mentioned tools, follow these steps:

  1. Install the Necessary Packages:

    First, you need to install the necessary packages:

    bashCopy code
    npm i --save-dev webpack webpack-dev-server jsx-loader static-site-generator-webpack-plugin react-router-dom sass-loader css-loader style-loader node-sass mini-css-extract-plugin
    
  2. Set Up Webpack:

    Create a webpack.config.js in your project root:

    const path = require('path');
    const MiniCssExtractPlugin = require('mini-css-extract-plugin');
    const StaticSiteGeneratorPlugin = require('static-site-generator-webpack-plugin');
    
    module.exports = {
      entry: './src/index.js',
      output: {
        filename: 'bundle.js',
        path: __dirname + '/dist',
        libraryTarget: 'umd'
      },
      resolve: {
        alias: {
          '@': path.resolve(__dirname, 'src/styles/')
        }
      },
      module: {
        rules: [
          {
            test: /\.(js|jsx)$/,
            exclude: /node_modules/,
            use: ['jsx-loader']
          },
          {
            test: /\.scss$/,
            use: [
              MiniCssExtractPlugin.loader, 
              'css-loader', 
              'sass-loader'
            ]
          }
        ]
      },
      plugins: [
        new StaticSiteGeneratorPlugin({
          paths: [
            '/',
            '/about/',
            // ... any other routes you might have
          ],
          locals: {
            // Properties here are merged into `locals`
            // passed to the exported render function
            greet: 'Hello'
          }
        }),
        new MiniCssExtractPlugin({
          filename: '[name].css',
          chunkFilename: '[id].css',
        }),
      ]
    };
    
    

 

 

 

 

 

f you want Webpack to handle SCSS files and also manage imports such as @variables.scss, you'll need to make several adjustments to your Webpack configuration:

  1. Install the Necessary Loaders and Packages:

    • sass-loader: Compiles Sass to CSS.
    • css-loader: Interprets @import and url() like import/require() and resolves them.
    • style-loader: Injects our styles into our DOM.
    • node-sass: Provides binding for Node.js to LibSass, a Sass compiler.
    • mini-css-extract-plugin: Extracts CSS into separate files.
    bashCopy code
    npm install --save-dev sass-loader css-loader style-loader node-sass mini-css-extract-plugin
    
  2. Adjust Your Webpack Configuration:

    Update your webpack.config.js:

    javascriptCopy code
    const MiniCssExtractPlugin = require('mini-css-extract-plugin');
    const StaticSiteGeneratorPlugin = require('static-site-generator-webpack-plugin');
    
    module.exports = {
      // ... your existing config
    
      module: {
        rules: [
          // ... your other rules for jsx
          {
            test: /\.scss$/,
            use: [
              MiniCssExtractPlugin.loader, 
              'css-loader', 
              'sass-loader'
            ]
          }
        ]
      },
      plugins: [
        // ... your other plugins
        new MiniCssExtractPlugin({
          filename: '[name].css',
          chunkFilename: '[id].css',
        }),
      ]
    };
    
  3. Use SCSS in Your React Components:

    Now, in your React components, you can import and use SCSS:

    javascriptCopy code
    import './styles.scss';
    

    And in your styles.scss:

    scssCopy code
    @import '@variables.scss';
    
    .my-class {
      background: $myBackgroundColor;
    }
    
  4. Resolve @ Aliases:

    If you're using @ as an alias to a specific directory (e.g., src/styles), you'll need to add a resolve alias in your Webpack config:

    javascriptCopy code
    const path = require('path');
    
    module.exports = {
      // ... your existing config
      resolve: {
        alias: {
          '@': path.resolve(__dirname, 'src/styles/')
        }
      },
      // ... the rest of your config
    };
    

    This way, when you do @import '@variables.scss';, Webpack knows where to look.

By following the steps above, Webpack will handle SCSS files in your project, including resolving paths such as @variables.scss.

 

 

 

The build folder is ready to be deployed. You may serve it with a static server:

npm install -g serve serve -s build

Find out more about deployment here:

https://cra.link/deployment

ns-whitelabel@0.1.0 postbuild /Users/spiffy/Documents/nsgandolf/static-stage sh scripts/gzip_files.sh && npm run set:production:env:variables && npm run generate:routes:file && react-snap

Enterning build dir List Build Directory: asset-manifest.json env.js index.html logo512.png static content favicon.ico locales manifest.json validate_env.js default-script.js img logo192.png robots.txt

gzip: . is a directory gzip: ./special_promo is a directory gzip: ./special_promo/20yearcontest is a directory gzip: ./special_promo/20yearcontest/img is a directory gzip: ./special_promo/20yearcontest/img/l is a directory ./special_promo/20yearcontest/img/l/9thegaysimplelife_l.jpg: 0.1% — replaced with ./special_promo/20yearcontest/img/l/9thegaysimplelife_l.jpg.gz gzip: . is a directory gzip: ./account is a directory gzip: ./account/member-benefits is a directory ./account/member-benefits/membbenefit_logo2.jpg: 12.6% — replaced with ./account/member-benefits/membbenefit_logo2.jpg.gz gzip: ./account/member-benefits/l is a directory ./account/member-benefits/l/8scaredstiff2_l.jpg: 0.1% — replaced with ./account/member-benefits/l/8scaredstiff2_l.jpg.gz gzip: . is a directory gzip: ./en is a directory ./en/common.json: 37.1% — replaced with ./en/common.json.gz ./en/translation.json: 67.8% — replaced with ./en/translation.json.gz gzip: . is a directory ./.DS_Store: 94.3% — replaced with ./.DS_Store.gz gzip: ./css is a directory ./css/32.9f45b183.chunk.css.map: 67.6% — replaced with ./css/32.9f45b183.chunk.css.map.gz ./css/49.563e7a0b.chunk.css.map: 64.0% — replaced with ./css/49.563e7a0b.chunk.css.map.gz ./css/36.3cdc335c.chunk.css: 64.5% — replaced with ./css/36.3cdc335c.chunk.css.gz ./css/21.c2b6c1ba.chunk.css.map: 62.5% — replaced with ./css/21.c2b6c1ba.chunk.css.map.gz ./css/47.a2c00f12.chunk.css: 15.3% — replaced with ./css/47.a2c00f12.chunk.css.gz ./css/40.cb72108f.chunk.css.map: 56.4% — replaced with ./css/40.cb72108f.chunk.css.map.gz ./css/main.19f2e323.chunk.css: 82.4% — replaced with ./css/main.19f2e323.chunk.css.gz ./css/51.3d6781be.chunk.css.map: 54.2% — replaced with ./css/51.3d6781be.chunk.css.map.gz ./css/26.445d845c.chunk.css: 28.5% — replaced with ./css/26.445d845c.chunk.css.gz ./css/17.7b300c5f.chunk.css: 77.3% — replaced with ./css/17.7b300c5f.chunk.css.gz ./css/42.ae788eb2.chunk.css: 30.6% — replaced with ./css/42.ae788eb2.chunk.css.gz ./css/35.2a5d6ab6.chunk.css.map: 57.7% — replaced with ./css/35.2a5d6ab6.chunk.css.map.gz ./css/7.1207c0ca.chunk.css: 67.1% — replaced with ./css/7.1207c0ca.chunk.css.gz ./css/3.c93e4f5c.chunk.css: 74.9% — replaced with ./css/3.c93e4f5c.chunk.css.gz ./css/2.19627560.chunk.css.map: 72.2% — replaced with ./css/2.19627560.chunk.css.map.gz ./css/32.9f45b183.chunk.css: 72.5% — replaced with ./css/32.9f45b183.chunk.css.gz ./css/16.e9f63c27.chunk.css.map: 59.5% — replaced with ./css/16.e9f63c27.chunk.css.map.gz ./css/25.da81c6f8.chunk.css: 56.3% — replaced with ./css/25.da81c6f8.chunk.css.gz ./css/22.e04c60b3.chunk.css.map: 63.2% — replaced with ./css/22.e04c60b3.chunk.css.map.gz ./css/31.9f45b183.chunk.css: 72.5% — replaced with ./css/31.9f45b183.chunk.css.gz ./css/22.e04c60b3.chunk.css: 69.3% — replaced with ./css/22.e04c60b3.chunk.css.gz ./css/4.b17b99f9.chunk.css: 71.1% — replaced with ./css/4.b17b99f9.chunk.css.gz ./css/33.dff4b9f0.chunk.css.map: 24.6% — replaced with ./css/33.dff4b9f0.chunk.css.map.gz ./css/31.9f45b183.chunk.css.map: 67.6% — replaced with ./css/31.9f45b183.chunk.css.map.gz ./css/19.dc000885.chunk.css.map: 69.4% — replaced with ./css/19.dc000885.chunk.css.map.gz ./css/12.fa860e80.chunk.css.map: 66.5% — replaced with ./css/12.fa860e80.chunk.css.map.gz ./css/26.445d845c.chunk.css.map: 32.7% — replaced with ./css/26.445d845c.chunk.css.map.gz ./css/18.4f649a75.chunk.css.map: 57.5% — replaced with ./css/18.4f649a75.chunk.css.map.gz ./css/16.e9f63c27.chunk.css: 61.4% — replaced with ./css/16.e9f63c27.chunk.css.gz ./css/18.4f649a75.chunk.css: 52.9% — replaced with ./css/18.4f649a75.chunk.css.gz ./css/20.fdb85042.chunk.css.map: 61.1% — replaced with ./css/20.fdb85042.chunk.css.map.gz ./css/43.a2c3242a.chunk.css.map: 61.9% — replaced with ./css/43.a2c3242a.chunk.css.map.gz ./css/30.9f45b183.chunk.css.map: 67.6% — replaced with ./css/30.9f45b183.chunk.css.map.gz ./css/37.3627af05.chunk.css.map: 61.3% — replaced with ./css/37.3627af05.chunk.css.map.gz ./css/2.19627560.chunk.css: 45.1% — replaced with ./css/2.19627560.chunk.css.gz ./css/44.c145848d.chunk.css: 68.4% — replaced with ./css/44.c145848d.chunk.css.gz ./css/10.bfa56e9c.chunk.css.map: 79.8% — replaced with ./css/10.bfa56e9c.chunk.css.map.gz ./css/40.cb72108f.chunk.css: 48.3% — replaced with ./css/40.cb72108f.chunk.css.gz ./css/48.e198d31d.chunk.css.map: 64.9% — replaced with ./css/48.e198d31d.chunk.css.map.gz ./css/27.9f45b183.chunk.css: 72.5% — replaced with ./css/27.9f45b183.chunk.css.gz ./css/21.c2b6c1ba.chunk.css: 68.4% — replaced with ./css/21.c2b6c1ba.chunk.css.gz ./css/41.22931c37.chunk.css: 30.3% — replaced with ./css/41.22931c37.chunk.css.gz ./css/44.c145848d.chunk.css.map: 61.7% — replaced with ./css/44.c145848d.chunk.css.map.gz ./css/47.a2c00f12.chunk.css.map: 52.5% — replaced with ./css/47.a2c00f12.chunk.css.map.gz ./css/29.9f45b183.chunk.css: 72.5% — replaced with ./css/29.9f45b183.chunk.css.gz ./css/13.0a7b3f25.chunk.css.map: 70.5% — replaced with ./css/13.0a7b3f25.chunk.css.map.gz ./css/38.0cf6c1d0.chunk.css.map: 57.6% — replaced with ./css/38.0cf6c1d0.chunk.css.map.gz ./css/11.74ef3f01.chunk.css.map: 74.5% — replaced with ./css/11.74ef3f01.chunk.css.map.gz ./css/43.a2c3242a.chunk.css: 68.6% — replaced with ./css/43.a2c3242a.chunk.css.gz ./css/48.e198d31d.chunk.css: 65.1% — replaced with ./css/48.e198d31d.chunk.css.gz ./css/23.da81c6f8.chunk.css: 56.3% — replaced with ./css/23.da81c6f8.chunk.css.gz ./css/1.65a7f161.chunk.css.map: 68.6% — replaced with ./css/1.65a7f161.chunk.css.map.gz ./css/17.7b300c5f.chunk.css.map: 70.5% — replaced with ./css/17.7b300c5f.chunk.css.map.gz ./css/3.c93e4f5c.chunk.css.map: 67.1% — replaced with ./css/3.c93e4f5c.chunk.css.map.gz ./css/20.fdb85042.chunk.css: 62.8% — replaced with ./css/20.fdb85042.chunk.css.gz ./css/19.dc000885.chunk.css: 74.9% — replaced with ./css/19.dc000885.chunk.css.gz ./css/41.22931c37.chunk.css.map: 52.8% — replaced with ./css/41.22931c37.chunk.css.map.gz ./css/28.9f45b183.chunk.css: 72.5% — replaced with ./css/28.9f45b183.chunk.css.gz ./css/39.a56e4efb.chunk.css.map: 46.3% — replaced with ./css/39.a56e4efb.chunk.css.map.gz ./css/42.ae788eb2.chunk.css.map: 52.6% — replaced with ./css/42.ae788eb2.chunk.css.map.gz ./css/46.f57cda16.chunk.css.map: 16.1% — replaced with ./css/46.f57cda16.chunk.css.map.gz ./css/7.1207c0ca.chunk.css.map: 62.1% — replaced with ./css/7.1207c0ca.chunk.css.map.gz ./css/25.da81c6f8.chunk.css.map: 54.4% — replaced with ./css/25.da81c6f8.chunk.css.map.gz ./css/45.a382d0bb.chunk.css: 64.9% — replaced with ./css/45.a382d0bb.chunk.css.gz ./css/50.9f2bfd98.chunk.css: 59.9% — replaced with ./css/50.9f2bfd98.chunk.css.gz ./css/37.3627af05.chunk.css: 66.8% — replaced with ./css/37.3627af05.chunk.css.gz ./css/14.cfece844.chunk.css.map: 60.8% — replaced with ./css/14.cfece844.chunk.css.map.gz ./css/12.fa860e80.chunk.css: 76.8% — replaced with ./css/12.fa860e80.chunk.css.gz ./css/35.2a5d6ab6.chunk.css: 55.9% — replaced with ./css/35.2a5d6ab6.chunk.css.gz ./css/46.f57cda16.chunk.css: -38.2% — replaced with ./css/46.f57cda16.chunk.css.gz ./css/38.0cf6c1d0.chunk.css: 48.6% — replaced with ./css/38.0cf6c1d0.chunk.css.gz ./css/14.cfece844.chunk.css: 65.2% — replaced with ./css/14.cfece844.chunk.css.gz ./css/28.9f45b183.chunk.css.map: 67.6% — replaced with ./css/28.9f45b183.chunk.css.map.gz ./css/33.dff4b9f0.chunk.css: -8.9% — replaced with ./css/33.dff4b9f0.chunk.css.gz ./css/main.19f2e323.chunk.css.map: 79.5% — replaced with ./css/main.19f2e323.chunk.css.map.gz ./css/39.a56e4efb.chunk.css: 38.9% — replaced with ./css/39.a56e4efb.chunk.css.gz ./css/51.3d6781be.chunk.css: 45.8% — replaced with ./css/51.3d6781be.chunk.css.gz ./css/49.563e7a0b.chunk.css: 68.1% — replaced with ./css/49.563e7a0b.chunk.css.gz ./css/29.9f45b183.chunk.css.map: 67.6% — replaced with ./css/29.9f45b183.chunk.css.map.gz ./css/10.bfa56e9c.chunk.css: 76.2% — replaced with ./css/10.bfa56e9c.chunk.css.gz ./css/15.7956c531.chunk.css: 76.1% — replaced with ./css/15.7956c531.chunk.css.gz ./css/30.9f45b183.chunk.css: 72.5% — replaced with ./css/30.9f45b183.chunk.css.gz ./css/34.1c89fffa.chunk.css.map: 57.3% — replaced with ./css/34.1c89fffa.chunk.css.map.gz ./css/36.3cdc335c.chunk.css.map: 60.2% — replaced with ./css/36.3cdc335c.chunk.css.map.gz ./css/13.0a7b3f25.chunk.css: 80.2% — replaced with ./css/13.0a7b3f25.chunk.css.gz ./css/4.b17b99f9.chunk.css.map: 65.4% — replaced with ./css/4.b17b99f9.chunk.css.map.gz ./css/1.65a7f161.chunk.css: 73.8% — replaced with ./css/1.65a7f161.chunk.css.gz ./css/24.da81c6f8.chunk.css.map: 54.4% — replaced with ./css/24.da81c6f8.chunk.css.map.gz ./css/45.a382d0bb.chunk.css.map: 61.5% — replaced with ./css/45.a382d0bb.chunk.css.map.gz ./css/27.9f45b183.chunk.css.map: 67.6% — replaced with ./css/27.9f45b183.chunk.css.map.gz ./css/11.74ef3f01.chunk.css: 80.8% — replaced with ./css/11.74ef3f01.chunk.css.gz ./css/34.1c89fffa.chunk.css: 54.7% — replaced with ./css/34.1c89fffa.chunk.css.gz ./css/23.da81c6f8.chunk.css.map: 54.4% — replaced with ./css/23.da81c6f8.chunk.css.map.gz ./css/50.9f2bfd98.chunk.css.map: 58.6% — replaced with ./css/50.9f2bfd98.chunk.css.map.gz ./css/24.da81c6f8.chunk.css: 56.3% — replaced with ./css/24.da81c6f8.chunk.css.gz ./css/15.7956c531.chunk.css.map: 69.8% — replaced with ./css/15.7956c531.chunk.css.map.gz gzip: ./js is a directory ./js/53.c3e9892a.chunk.js.map: 7.0% — replaced with ./js/53.c3e9892a.chunk.js.map.gz ./js/36.611b0ed1.chunk.js.map: 63.8% — replaced with ./js/36.611b0ed1.chunk.js.map.gz ./js/26.42940673.chunk.js.map: 67.2% — replaced with ./js/26.42940673.chunk.js.map.gz ./js/12.fe078a56.chunk.js: 67.8% — replaced with ./js/12.fe078a56.chunk.js.gz ./js/1.94885cbc.chunk.js: 72.9% — replaced with ./js/1.94885cbc.chunk.js.gz ./js/29.1e5fa0af.chunk.js: 68.6% — replaced with ./js/29.1e5fa0af.chunk.js.gz ./js/13.05a8f93d.chunk.js: 68.7% — replaced with ./js/13.05a8f93d.chunk.js.gz ./js/53.c3e9892a.chunk.js: 6.8% — replaced with ./js/53.c3e9892a.chunk.js.gz ./js/4.e47f6052.chunk.js.map: 69.9% — replaced with ./js/4.e47f6052.chunk.js.map.gz ./js/57.2a77dac0.chunk.js: 6.6% — replaced with ./js/57.2a77dac0.chunk.js.gz ./js/65.0260a870.chunk.js: 4.6% — replaced with ./js/65.0260a870.chunk.js.gz ./js/61.74f5fad7.chunk.js: 4.7% — replaced with ./js/61.74f5fad7.chunk.js.gz ./js/58.9504f860.chunk.js: 5.3% — replaced with ./js/58.9504f860.chunk.js.gz ./js/54.8df4959f.chunk.js.map: 7.0% — replaced with ./js/54.8df4959f.chunk.js.map.gz ./js/62.b1b0b2d2.chunk.js.map: 6.2% — replaced with ./js/62.b1b0b2d2.chunk.js.map.gz ./js/64.0f2b5f36.chunk.js.map: 8.4% — replaced with ./js/64.0f2b5f36.chunk.js.map.gz ./js/60.8444a861.chunk.js.map: 11.5% — replaced with ./js/60.8444a861.chunk.js.map.gz ./js/22.8a065a80.chunk.js: 61.9% — replaced with ./js/22.8a065a80.chunk.js.gz ./js/32.7d3f6549.chunk.js: 72.2% — replaced with ./js/32.7d3f6549.chunk.js.gz ./js/39.b8926443.chunk.js: 44.4% — replaced with ./js/39.b8926443.chunk.js.gz ./js/32.7d3f6549.chunk.js.map: 74.3% — replaced with ./js/32.7d3f6549.chunk.js.map.gz ./js/16.dc35c840.chunk.js: 62.6% — replaced with ./js/16.dc35c840.chunk.js.gz ./js/56.7c4d3b08.chunk.js.map: 9.7% — replaced with ./js/56.7c4d3b08.chunk.js.map.gz ./js/3.0fb4e179.chunk.js: 66.2% — replaced with ./js/3.0fb4e179.chunk.js.gz ./js/55.f602bc93.chunk.js.map: 9.7% — replaced with ./js/55.f602bc93.chunk.js.map.gz ./js/17.a6f7e648.chunk.js.map: 74.5% — replaced with ./js/17.a6f7e648.chunk.js.map.gz ./js/30.4bcb93c2.chunk.js: 69.1% — replaced with ./js/30.4bcb93c2.chunk.js.gz ./js/18.eba672cc.chunk.js.map: 70.2% — replaced with ./js/18.eba672cc.chunk.js.map.gz ./js/48.acf0e7ba.chunk.js: 53.0% — replaced with ./js/48.acf0e7ba.chunk.js.gz ./js/12.fe078a56.chunk.js.map: 70.0% — replaced with ./js/12.fe078a56.chunk.js.map.gz ./js/28.8890de5a.chunk.js: 69.9% — replaced with ./js/28.8890de5a.chunk.js.gz ./js/33.06f21347.chunk.js.map: 67.8% — replaced with ./js/33.06f21347.chunk.js.map.gz ./js/48.acf0e7ba.chunk.js.map: 58.9% — replaced with ./js/48.acf0e7ba.chunk.js.map.gz ./js/26.42940673.chunk.js: 63.6% — replaced with ./js/26.42940673.chunk.js.gz ./js/21.e45ecd5c.chunk.js.map: 65.9% — replaced with ./js/21.e45ecd5c.chunk.js.map.gz ./js/0.05d09190.chunk.js: 73.6% — replaced with ./js/0.05d09190.chunk.js.gz ./js/46.c6ad00bc.chunk.js: 59.2% — replaced with ./js/46.c6ad00bc.chunk.js.gz ./js/24.e423cf4e.chunk.js: 58.7% — replaced with ./js/24.e423cf4e.chunk.js.gz ./js/13.05a8f93d.chunk.js.map: 71.9% — replaced with ./js/13.05a8f93d.chunk.js.map.gz ./js/6.2572a79e.chunk.js: 24.5% — replaced with ./js/6.2572a79e.chunk.js.gz ./js/23.8456bc74.chunk.js: 58.7% — replaced with ./js/23.8456bc74.chunk.js.gz ./js/45.9d692e36.chunk.js: 46.5% — replaced with ./js/45.9d692e36.chunk.js.gz ./js/28.8890de5a.chunk.js.map: 73.0% — replaced with ./js/28.8890de5a.chunk.js.map.gz ./js/65.0260a870.chunk.js.map: 7.6% — replaced with ./js/65.0260a870.chunk.js.map.gz ./js/43.c44acedc.chunk.js.map: 63.4% — replaced with ./js/43.c44acedc.chunk.js.map.gz ./js/7.cd5c823b.chunk.js: 58.6% — replaced with ./js/7.cd5c823b.chunk.js.gz ./js/44.a9d26b38.chunk.js: 62.2% — replaced with ./js/44.a9d26b38.chunk.js.gz ./js/59.25eeb22d.chunk.js.map: 12.1% — replaced with ./js/59.25eeb22d.chunk.js.map.gz ./js/21.e45ecd5c.chunk.js: 58.8% — replaced with ./js/21.e45ecd5c.chunk.js.gz ./js/41.b4319d9e.chunk.js.map: 53.4% — replaced with ./js/41.b4319d9e.chunk.js.map.gz ./js/39.b8926443.chunk.js.map: 52.5% — replaced with ./js/39.b8926443.chunk.js.map.gz ./js/60.8444a861.chunk.js: 5.3% — replaced with ./js/60.8444a861.chunk.js.gz ./js/runtime-main.e0222544.js: 50.3% — replaced with ./js/runtime-main.e0222544.js.gz ./js/24.e423cf4e.chunk.js.map: 64.9% — replaced with ./js/24.e423cf4e.chunk.js.map.gz ./js/35.5b01a924.chunk.js: 60.6% — replaced with ./js/35.5b01a924.chunk.js.gz ./js/38.36086832.chunk.js: 56.5% — replaced with ./js/38.36086832.chunk.js.gz ./js/18.eba672cc.chunk.js: 63.0% — replaced with ./js/18.eba672cc.chunk.js.gz ./js/27.2719bf49.chunk.js.map: 75.1% — replaced with ./js/27.2719bf49.chunk.js.map.gz ./js/10.be762c99.chunk.js.LICENSE.txt: 88.7% — replaced with ./js/10.be762c99.chunk.js.LICENSE.txt.gz ./js/30.4bcb93c2.chunk.js.map: 72.3% — replaced with ./js/30.4bcb93c2.chunk.js.map.gz ./js/15.93fcda1b.chunk.js.map: 69.0% — replaced with ./js/15.93fcda1b.chunk.js.map.gz ./js/runtime-main.e0222544.js.map: 67.6% — replaced with ./js/runtime-main.e0222544.js.map.gz ./js/3.0fb4e179.chunk.js.map: 69.2% — replaced with ./js/3.0fb4e179.chunk.js.map.gz ./js/23.8456bc74.chunk.js.map: 65.0% — replaced with ./js/23.8456bc74.chunk.js.map.gz ./js/main.7a3c303d.chunk.js: 39.0% — replaced with ./js/main.7a3c303d.chunk.js.gz ./js/63.82b8e456.chunk.js.map: 12.1% — replaced with ./js/63.82b8e456.chunk.js.map.gz ./js/10.be762c99.chunk.js: 72.0% — replaced with ./js/10.be762c99.chunk.js.gz ./js/29.1e5fa0af.chunk.js.map: 72.1% — replaced with ./js/29.1e5fa0af.chunk.js.map.gz ./js/19.907fe59c.chunk.js.map: 68.8% — replaced with ./js/19.907fe59c.chunk.js.map.gz ./js/41.b4319d9e.chunk.js: 37.6% — replaced with ./js/41.b4319d9e.chunk.js.gz ./js/14.5555290d.chunk.js: 64.4% — replaced with ./js/14.5555290d.chunk.js.gz ./js/6.2572a79e.chunk.js.map: 46.4% — replaced with ./js/6.2572a79e.chunk.js.map.gz ./js/37.30351dff.chunk.js: 59.8% — replaced with ./js/37.30351dff.chunk.js.gz ./js/10.be762c99.chunk.js.map: 75.7% — replaced with ./js/10.be762c99.chunk.js.map.gz ./js/62.b1b0b2d2.chunk.js: 4.7% — replaced with ./js/62.b1b0b2d2.chunk.js.gz ./js/35.5b01a924.chunk.js.map: 63.8% — replaced with ./js/35.5b01a924.chunk.js.map.gz ./js/7.cd5c823b.chunk.js.map: 69.3% — replaced with ./js/7.cd5c823b.chunk.js.map.gz ./js/44.a9d26b38.chunk.js.map: 65.1% — replaced with ./js/44.a9d26b38.chunk.js.map.gz ./js/47.92f4ff9d.chunk.js: 60.8% — replaced with ./js/47.92f4ff9d.chunk.js.gz ./js/50.f677bf80.chunk.js.map: 57.9% — replaced with ./js/50.f677bf80.chunk.js.map.gz ./js/17.a6f7e648.chunk.js: 72.4% — replaced with ./js/17.a6f7e648.chunk.js.gz ./js/46.c6ad00bc.chunk.js.map: 65.7% — replaced with ./js/46.c6ad00bc.chunk.js.map.gz ./js/0.05d09190.chunk.js.map: 73.6% — replaced with ./js/0.05d09190.chunk.js.map.gz ./js/0.05d09190.chunk.js.LICENSE.txt: 23.9% — replaced with ./js/0.05d09190.chunk.js.LICENSE.txt.gz ./js/34.ca64f7d8.chunk.js: 59.2% — replaced with ./js/34.ca64f7d8.chunk.js.gz ./js/43.c44acedc.chunk.js: 48.7% — replaced with ./js/43.c44acedc.chunk.js.gz ./js/31.7a18f210.chunk.js: 72.5% — replaced with ./js/31.7a18f210.chunk.js.gz ./js/37.30351dff.chunk.js.map: 63.4% — replaced with ./js/37.30351dff.chunk.js.map.gz ./js/2.86cf2eaf.chunk.js: 74.7% — replaced with ./js/2.86cf2eaf.chunk.js.gz ./js/52.877c9c8b.chunk.js: 27.4% — replaced with ./js/52.877c9c8b.chunk.js.gz ./js/54.8df4959f.chunk.js: 6.0% — replaced with ./js/54.8df4959f.chunk.js.gz ./js/64.0f2b5f36.chunk.js: 5.5% — replaced with ./js/64.0f2b5f36.chunk.js.gz ./js/4.e47f6052.chunk.js: 69.9% — replaced with ./js/4.e47f6052.chunk.js.gz ./js/14.5555290d.chunk.js.map: 68.6% — replaced with ./js/14.5555290d.chunk.js.map.gz ./js/20.f59ab5ad.chunk.js.map: 63.8% — replaced with ./js/20.f59ab5ad.chunk.js.map.gz ./js/45.9d692e36.chunk.js.map: 52.6% — replaced with ./js/45.9d692e36.chunk.js.map.gz ./js/42.7f0d5d46.chunk.js.map: 47.5% — replaced with ./js/42.7f0d5d46.chunk.js.map.gz ./js/main.7a3c303d.chunk.js.map: 51.3% — replaced with ./js/main.7a3c303d.chunk.js.map.gz ./js/2.86cf2eaf.chunk.js.map: 75.7% — replaced with ./js/2.86cf2eaf.chunk.js.map.gz ./js/1.94885cbc.chunk.js.map: 74.9% — replaced with ./js/1.94885cbc.chunk.js.map.gz ./js/56.7c4d3b08.chunk.js: 5.4% — replaced with ./js/56.7c4d3b08.chunk.js.gz ./js/63.82b8e456.chunk.js: 6.1% — replaced with ./js/63.82b8e456.chunk.js.gz ./js/27.2719bf49.chunk.js: 71.7% — replaced with ./js/27.2719bf49.chunk.js.gz ./js/5.7ad9e583.chunk.js: 21.8% — replaced with ./js/5.7ad9e583.chunk.js.gz ./js/51.736de040.chunk.js.map: 65.2% — replaced with ./js/51.736de040.chunk.js.map.gz ./js/19.907fe59c.chunk.js: 66.5% — replaced with ./js/19.907fe59c.chunk.js.gz ./js/51.736de040.chunk.js: 56.8% — replaced with ./js/51.736de040.chunk.js.gz ./js/38.36086832.chunk.js.map: 66.1% — replaced with ./js/38.36086832.chunk.js.map.gz ./js/5.7ad9e583.chunk.js.map: 39.8% — replaced with ./js/5.7ad9e583.chunk.js.map.gz ./js/40.bc60fca0.chunk.js.map: 37.0% — replaced with ./js/40.bc60fca0.chunk.js.map.gz ./js/31.7a18f210.chunk.js.map: 74.0% — replaced with ./js/31.7a18f210.chunk.js.map.gz ./js/52.877c9c8b.chunk.js.map: 30.8% — replaced with ./js/52.877c9c8b.chunk.js.map.gz ./js/11.0683e544.chunk.js: 70.8% — replaced with ./js/11.0683e544.chunk.js.gz ./js/61.74f5fad7.chunk.js.map: 7.0% — replaced with ./js/61.74f5fad7.chunk.js.map.gz ./js/11.0683e544.chunk.js.map: 71.8% — replaced with ./js/11.0683e544.chunk.js.map.gz ./js/25.41f48d70.chunk.js: 58.7% — replaced with ./js/25.41f48d70.chunk.js.gz ./js/16.dc35c840.chunk.js.map: 68.5% — replaced with ./js/16.dc35c840.chunk.js.map.gz ./js/25.41f48d70.chunk.js.map: 65.0% — replaced with ./js/25.41f48d70.chunk.js.map.gz ./js/33.06f21347.chunk.js: 63.1% — replaced with ./js/33.06f21347.chunk.js.gz ./js/36.611b0ed1.chunk.js: 60.8% — replaced with ./js/36.611b0ed1.chunk.js.gz ./js/47.92f4ff9d.chunk.js.map: 66.3% — replaced with ./js/47.92f4ff9d.chunk.js.map.gz ./js/55.f602bc93.chunk.js: 5.4% — replaced with ./js/55.f602bc93.chunk.js.gz ./js/22.8a065a80.chunk.js.map: 66.9% — replaced with ./js/22.8a065a80.chunk.js.map.gz ./js/49.463b1ae6.chunk.js.map: 69.8% — replaced with ./js/49.463b1ae6.chunk.js.map.gz ./js/57.2a77dac0.chunk.js.map: 16.0% — replaced with ./js/57.2a77dac0.chunk.js.map.gz ./js/15.93fcda1b.chunk.js: 64.2% — replaced with ./js/15.93fcda1b.chunk.js.gz ./js/34.ca64f7d8.chunk.js.map: 63.0% — replaced with ./js/34.ca64f7d8.chunk.js.map.gz ./js/58.9504f860.chunk.js.map: 12.1% — replaced with ./js/58.9504f860.chunk.js.map.gz ./js/59.25eeb22d.chunk.js: 6.1% — replaced with ./js/59.25eeb22d.chunk.js.gz ./js/40.bc60fca0.chunk.js: 17.9% — replaced with ./js/40.bc60fca0.chunk.js.gz ./js/49.463b1ae6.chunk.js: 66.9% — replaced with ./js/49.463b1ae6.chunk.js.gz ./js/50.f677bf80.chunk.js: 50.8% — replaced with ./js/50.f677bf80.chunk.js.gz ./js/20.f59ab5ad.chunk.js: 59.0% — replaced with ./js/20.f59ab5ad.chunk.js.gz ./js/42.7f0d5d46.chunk.js: 30.4% — replaced with ./js/42.7f0d5d46.chunk.js.gz gzip: ./media is a directory ./media/slick.29518378.woff: 1.3% — replaced with ./media/slick.29518378.woff.gz ./media/fa-regular-400.7a333762.woff2: -0.4% — replaced with ./media/fa-regular-400.7a333762.woff2.gz ./media/TopTenNumber7.f9860d23.svg: 48.3% — replaced with ./media/TopTenNumber7.f9860d23.svg.gz ./media/close-forgot.9a076e4f.svg: 39.0% — replaced with ./media/close-forgot.9a076e4f.svg.gz ./media/privacy-policy.48d78593.xsl: 72.6% — replaced with ./media/privacy-policy.48d78593.xsl.gz ./media/TopTenNumber3.62e7f732.svg: 48.9% — replaced with ./media/TopTenNumber3.62e7f732.svg.gz ./media/rta-logo.35704685.svg: 64.1% — replaced with ./media/rta-logo.35704685.svg.gz ./media/frequently-asked-questions.cc558380.xml: 64.3% — replaced with ./media/frequently-asked-questions.cc558380.xml.gz ./media/terms-of-service.1c6da653.xml: 76.1% — replaced with ./media/terms-of-service.1c6da653.xml.gz ./media/MyBenefits.6417914a.jpg: 2.0% — replaced with ./media/MyBenefits.6417914a.jpg.gz ./media/TopTenNumber1.738cbc1b.svg: 47.1% — replaced with ./media/TopTenNumber1.738cbc1b.svg.gz ./media/contest-rules.645abaa5.xsl: 71.3% — replaced with ./media/contest-rules.645abaa5.xsl.gz ./media/TopTenNumber4.3216dcfd.svg: 48.7% — replaced with ./media/TopTenNumber4.3216dcfd.svg.gz ./media/chat.46e78d75.svg: 44.0% — replaced with ./media/chat.46e78d75.svg.gz ./media/fa-brands-400.2285773e.woff: -0.1% — replaced with ./media/fa-brands-400.2285773e.woff.gz ./media/contest-rules.d1236213.xml: 64.2% — replaced with ./media/contest-rules.d1236213.xml.gz ./media/fa-solid-900.1551f4f6.woff2: 0.0% — replaced with ./media/fa-solid-900.1551f4f6.woff2.gz ./media/fa-solid-900.be9ee23c.ttf: 49.3% — replaced with ./media/fa-solid-900.be9ee23c.ttf.gz ./media/downloadIcon.beaae461.svg: 28.2% — replaced with ./media/downloadIcon.beaae461.svg.gz ./media/fa-brands-400.23f19bb0.eot: 32.4% — replaced with ./media/fa-brands-400.23f19bb0.eot.gz ./media/Model4Us_Button.3ee3715e.jpg: 0.8% — replaced with ./media/Model4Us_Button.3ee3715e.jpg.gz ./media/frequently-asked-questions.880c2664.xsl: 70.3% — replaced with ./media/frequently-asked-questions.880c2664.xsl.gz ./media/Metropolis-Regular.67a1988d.otf: 24.5% — replaced with ./media/Metropolis-Regular.67a1988d.otf.gz ./media/fa-brands-400.2f517e09.svg: 65.8% — replaced with ./media/fa-brands-400.2f517e09.svg.gz ./media/fa-brands-400.d878b0a6.woff2: -0.1% — replaced with ./media/fa-brands-400.d878b0a6.woff2.gz ./media/TopTenNumber8.0cab9c30.svg: 50.6% — replaced with ./media/TopTenNumber8.0cab9c30.svg.gz ./media/fsc-logo.e7932087.svg: 64.8% — replaced with ./media/fsc-logo.e7932087.svg.gz ./media/Warning_Gold.9dbb9bb5.svg: 38.3% — replaced with ./media/Warning_Gold.9dbb9bb5.svg.gz ./media/fa-regular-400.bb58e57c.woff: -0.1% — replaced with ./media/fa-regular-400.bb58e57c.woff.gz ./media/custodian-of-records.5b943ab8.xml: 53.5% — replaced with ./media/custodian-of-records.5b943ab8.xml.gz ./media/fa-solid-900.9bbb245e.eot: 49.4% — replaced with ./media/fa-solid-900.9bbb245e.eot.gz ./media/NewTodayEmblem.298b5b34.svg: 63.8% — replaced with ./media/NewTodayEmblem.298b5b34.svg.gz ./media/ns_logo_white.be081261.svg: 25.4% — replaced with ./media/ns_logo_white.be081261.svg.gz ./media/fa-regular-400.4689f52c.svg: 74.1% — replaced with ./media/fa-regular-400.4689f52c.svg.gz ./media/Metropolis-Bold.c5e04faf.otf: 24.3% — replaced with ./media/Metropolis-Bold.c5e04faf.otf.gz ./media/terms-of-service.1f43a514.xsl: 83.5% — replaced with ./media/terms-of-service.1f43a514.xsl.gz ./media/TopTenNumber9.33b2a9d7.svg: 49.8% — replaced with ./media/TopTenNumber9.33b2a9d7.svg.gz ./media/TopTenNumber6.a9003f5a.svg: 49.4% — replaced with ./media/TopTenNumber6.a9003f5a.svg.gz ./media/Top10.0bdc82ea.svg: 49.7% — replaced with ./media/Top10.0bdc82ea.svg.gz ./media/TopTenNumber5.4cb1cd34.svg: 48.4% — replaced with ./media/TopTenNumber5.4cb1cd34.svg.gz ./media/fa-brands-400.527940b1.ttf: 32.4% — replaced with ./media/fa-brands-400.527940b1.ttf.gz ./media/chat-activated-blk.2fefdf66.svg: 54.1% — replaced with ./media/chat-activated-blk.2fefdf66.svg.gz ./media/email.ca6d219d.svg: 32.0% — replaced with ./media/email.ca6d219d.svg.gz ./media/fa-regular-400.491974d1.ttf: 51.7% — replaced with ./media/fa-regular-400.491974d1.ttf.gz ./media/member-benefits-july-2020.299416b7.jpg: 1.3% — replaced with ./media/member-benefits-july-2020.299416b7.jpg.gz ./media/slick.2630a3e3.svg: 56.5% — replaced with ./media/slick.2630a3e3.svg.gz ./media/member-benefits-july-2020-image2.61f47f3f.jpg: 2.7% — replaced with ./media/member-benefits-july-2020-image2.61f47f3f.jpg.gz ./media/frequently-asked-questions-blueprint.2dec3892.xml: 64.5% — replaced with ./media/frequently-asked-questions-blueprint.2dec3892.xml.gz ./media/fa-solid-900.7a8b4f13.svg: 72.0% — replaced with ./media/fa-solid-900.7a8b4f13.svg.gz ./media/fa-regular-400.77206a6b.eot: 51.9% — replaced with ./media/fa-regular-400.77206a6b.eot.gz ./media/TopTenNumber10.d4f2b780.svg: 50.5% — replaced with ./media/TopTenNumber10.d4f2b780.svg.gz ./media/slick.c94f7671.ttf: 47.7% — replaced with ./media/slick.c94f7671.ttf.gz ./media/terms-of-service-blueprint.de1c3f15.xml: 76.0% — replaced with ./media/terms-of-service-blueprint.de1c3f15.xml.gz ./media/fa-solid-900.eeccf4f6.woff: -0.1% — replaced with ./media/fa-solid-900.eeccf4f6.woff.gz ./media/ns_logo_blue.58f74e38.svg: 25.5% — replaced with ./media/ns_logo_blue.58f74e38.svg.gz ./media/TopTenNumber2.67c39c62.svg: 47.6% — replaced with ./media/TopTenNumber2.67c39c62.svg.gz ./media/Metropolis-Medium.cdcce862.otf: 24.4% — replaced with ./media/Metropolis-Medium.cdcce862.otf.gz ./media/privacy-policy-blueprint.cb18da03.xml: 59.6% — replaced with ./media/privacy-policy-blueprint.cb18da03.xml.gz ./media/privacy-policy.58c061bc.xml: 60.1% — replaced with ./media/privacy-policy.58c061bc.xml.gz ./media/custodian-of-records.8b82d9cd.xsl: 78.3% — replaced with ./media/custodian-of-records.8b82d9cd.xsl.gz ./media/call.f5b319b2.svg: 35.3% — replaced with ./media/call.f5b319b2.svg.gz ./media/slick.a4e97f5a.eot: 49.3% — replaced with ./media/slick.a4e97f5a.eot.gz asset-manifest.json env.js index.html logo512.png static content favicon.ico locales manifest.json validate_env.js default-script.js img logo192.png robots.txt Exiting build dir

ns-whitelabel@0.1.0 set:production:env:variables /Users/spiffy/Documents/nsgandolf/static-stage cd scripts/ && node create_env_file.js && cd ../

The /env.js file was saved!

ns-whitelabel@0.1.0 generate:routes:file /Users/spiffy/Documents/nsgandolf/static-stage cd scripts/ && node generate_routes_file.js && cd ../

The /routes.js file was saved! ️️️⚠️ warning at /: got 403 HTTP code for https://www.nakedsword.com/ns-overrides-ext/ns-overrides-ext.css ️️️💬 console.log at /: Failed to load resource: the server responded with a status of 403 () ️️️💬 console.log at /: Access to XMLHttpRequest at 'https://ns-api.nakedsword.com/frontend/whitelabel_config/1/get?id=1' from origin 'http://localhost:45678' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. ️️️💬 console.log at /: Failed to load resource: net::ERR_FAILED ️️️💬 console.log at /: Access to XMLHttpRequest at 'https://ns-api.nakedsword.com/frontend/player_config/1?id=1' from origin 'http://localhost:45678' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. ️️️💬 console.log at /: Failed to load resource: net::ERR_FAILED 💬 console.log at /: { message: 'Network Error', name: 'AxiosError', code: 'ERR_NETWORK', config: { transitional: { silentJSONParsing: true, forcedJSONParsing: true, clarifyTimeoutError: false }, adapter: {}, transformRequest: [ {} ], transformResponse: [ {} ], timeout: 0, xsrfCookieName: 'XSRF-TOKEN', xsrfHeaderName: 'X-XSRF-TOKEN', maxContentLength: -1, maxBodyLength: -1, env: { FormData: null }, validateStatus: {}, headers: { Accept: 'application/json, text/plain, /', Authorization: 'Bearer null', 'x-ident': 'eyJjaXBoZXJ0ZXh0IjoiMENVV1pyeFdsODFyRzIyazRrM0FPc0VVaVhKY2ZJU09iZ1E4Y2JFOWZRa202ZGQzSWJtTXczaWVkUDFpd28ySCIsInNhbHQiOiI4NDhiMTUwYzlmOWFhMzY4ZTk2ZmI5MDNkZGUyOTg4MjgxOTE1NGNlMjJlZmMwMWZjYzFmN2Q1OWYwOTRjOWFjYmRlZGQxMzRjNjliMjhiNmIwZGVlNWEzYjM2Y2I0YzRjYmYzYWYyZDhkMjg3Nzk2MTEyNzlhZTk1YWUxZmY4NTJkYjkyMjA1MzdlNTNjMWVmYjM4Yzk4MDIyZDQwZGZhMGJiMjA2ZDMzYzYwMGM2YjRmMzkyZTZkM2E5YjM0NDNkYzQ3MjY1MzdmZmJiODYzZTE2MjIxOGYzZDE2MTI5MGRkMTRhODUxY2RlY2Q3NzgzMjM2MDE4NGNlMWFmZTg1MzhjYTRhNDJiNzliZmQ3MTkwMDA2YzNjZjk4YzlmNzk5NDhmZWIxN2Q4MWY5MDQ2NzNjMmFmYjJlNjQ2NjBiNGIzODYwNzNkYzExNzcwMWI5MWQ5NTQ0ZGE1ZGRiMGYwZjY2NmZiZDQ2NWFlOGJmMzNlOTJjMThmNWEwYzM4OTRkOTJkNjc2ZDIzZGJmN2RmODVjYjU2NzU2ZGE3ZDU4NGI3Yzk1NmQyZTcwMmIzMDY5YzViYTkyNzk4MGViZWM3ZDc5Mjg0NTA3ZjhkYzg4OTRhYWY0ZDY5MmU0MDgwZjk4NDM2MWI1MTk1OWMwZWY4Y2Y5NTg1YzQwZTc3ZjJlYiIsIml2IjoiOWUxYTA5YTE4MzdmNTFkOWIwZDBlYmUxYTAzZTM1NmUifQ==', 'X-CSRF-TOKEN': null }, baseURL: 'https://ns-api.nakedsword.com', params: { id: '1' }, method: 'get', url: '/frontend/whitelabel_config/1/get' }, request: {}, response: {} } 💬 console.log at /: { message: 'Network Error', name: 'AxiosError', code: 'ERR_NETWORK', config: { transitional: { silentJSONParsing: true, forcedJSONParsing: true, clarifyTimeoutError: false }, adapter: {}, transformRequest: [ {} ], transformResponse: [ {} ], timeout: 0, xsrfCookieName: 'XSRF-TOKEN', xsrfHeaderName: 'X-XSRF-TOKEN', maxContentLength: -1, maxBodyLength: -1, env: { FormData: null }, validateStatus: {}, headers: { Accept: 'application/json, text/plain, /', Authorization: 'Bearer null', 'x-ident': 'eyJjaXBoZXJ0ZXh0IjoiMENVV1pyeFdsODFyRzIyazRrM0FPc0VVaVhKY2ZJU09iZ1E4Y2JFOWZRa202ZGQzSWJtTXczaWVkUDFpd28ySCIsInNhbHQiOiI4NDhiMTUwYzlmOWFhMzY4ZTk2ZmI5MDNkZGUyOTg4MjgxOTE1NGNlMjJlZmMwMWZjYzFmN2Q1OWYwOTRjOWFjYmRlZGQxMzRjNjliMjhiNmIwZGVlNWEzYjM2Y2I0YzRjYmYzYWYyZDhkMjg3Nzk2MTEyNzlhZTk1YWUxZmY4NTJkYjkyMjA1MzdlNTNjMWVmYjM4Yzk4MDIyZDQwZGZhMGJiMjA2ZDMzYzYwMGM2YjRmMzkyZTZkM2E5YjM0NDNkYzQ3MjY1MzdmZmJiODYzZTE2MjIxOGYzZDE2MTI5MGRkMTRhODUxY2RlY2Q3NzgzMjM2MDE4NGNlMWFmZTg1MzhjYTRhNDJiNzliZmQ3MTkwMDA2YzNjZjk4YzlmNzk5NDhmZWIxN2Q4MWY5MDQ2NzNjMmFmYjJlNjQ2NjBiNGIzODYwNzNkYzExNzcwMWI5MWQ5NTQ0ZGE1ZGRiMGYwZjY2NmZiZDQ2NWFlOGJmMzNlOTJjMThmNWEwYzM4OTRkOTJkNjc2ZDIzZGJmN2RmODVjYjU2NzU2ZGE3ZDU4NGI3Yzk1NmQyZTcwMmIzMDY5YzViYTkyNzk4MGViZWM3ZDc5Mjg0NTA3ZjhkYzg4OTRhYWY0ZDY5MmU0MDgwZjk4NDM2MWI1MTk1OWMwZWY4Y2Y5NTg1YzQwZTc3ZjJlYiIsIml2IjoiOWUxYTA5YTE4MzdmNTFkOWIwZDBlYmUxYTAzZTM1NmUifQ==', 'X-CSRF-TOKEN': null }, baseURL: 'https://ns-api.nakedsword.com', params: { id: '1' }, method: 'get', url: '/frontend/player_config/1' }, request: {}, response: {} } 💬 console.log at /: TypeError: Cannot read property 'reduce' of undefined 💬 console.log at /: TypeError: Cannot read property 'reduce' of undefined ✅ crawled 1 out of 1 (/)

   ~/Doc/ns/static-stage  on   stage !3 ?1   ✔  took 37s   14.19.0   at 09:54:14 PM 

 

 

 

 

 

 

 

  1. Set Up React Router:

    In your src/index.js:

    javascriptCopy code
    import React from 'react';
    import { StaticRouter } from 'react-router-dom';
    import App from './App';
    
    // Exported static site renderer:
    module.exports = locals => {
      const context = {};
    
      return (
        <StaticRouter
          location={locals.path}
          context={context}
        >
          <App />
        </StaticRouter>
      );
    };
    

    Make sure your App component uses Route components from react-router-dom to define its routes.

  2. Building and Running the App:

    To generate static pages, run:

    bashCopy code
    webpack
    

    This will bundle your React app and generate static HTML pages in the dist directory.

    To run the app in development mode with webpack-dev-server:

    bashCopy code
    webpack-dev-server
    
  3. Deploy Your Static Site:

    Once you've built the app, the static pages are ready to be deployed. Upload the contents of the dist directory to your chosen hosting provider.

Remember that this is a basic setup. Depending on your application, you might need to make more custom configurations to Webpack or adjust the routing setup. Also, make sure to adjust any links in your app to match the static route paths you've defined.

Scroll to Top