Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Strapi build admin dashboard did not read from admin.ts config with webpack compile #321

Open
fallingforest opened this issue Sep 25, 2024 · 2 comments

Comments

@fallingforest
Copy link

I got the issue while build the strapi admin dashboard. it does not read the admin.ts config when building to html, js files

This is my admin.ts file:

export default ({ env }) => ({
  auth: {
    secret: env('ADMIN_JWT_SECRET'),
  },
  apiToken: {
    salt: env('API_TOKEN_SALT'),
  },
  transfer: {
    token: {
      salt: env('TRANSFER_TOKEN_SALT'),
    },
  },
  flags: {
    nps: env.bool('FLAG_NPS', true),
    promoteEE: env.bool('FLAG_PROMOTE_EE', true),
  },
  url: '/',
  serveAdminPanel: env('NODE_ENV') !== 'production' ? true : false,
  watchIgnoreFiles: ['**/config/sync/**'],
});

This is the webpack.config.js file:

'use strict';

const { withNx } = require('@nx-extend/strapi');

module.exports = (config, webpack) => {
  return withNx(config, webpack);
};

I set the url is "/". but when the index.html built, it always return this script path:
<script defer="defer" src="/admin/runtime~main.*.js">

While when I used the yarn build script with a normal strapi project without nx, it will return like this:
<script defer="defer" src="/runtime~main.*.js">

@TriPSs
Copy link
Owner

TriPSs commented Sep 25, 2024

Please provide some more info, package version, Strapi version etc.

@fallingforest
Copy link
Author

Here are some info:

NX   Report complete - copy this into the issue template

Node           : 20.16.0
OS             : linux-x64
Native Target  : x86_64-linux
yarn           : 1.22.22

nx (global)        : 19.6.1
nx                 : 19.6.2
@nx/js             : 19.6.2
@nx/jest           : 19.6.2
@nx/linter         : 19.6.2
@nx/eslint         : 19.6.2
@nx/workspace      : 19.6.2
@nx/cypress        : 19.6.2
@nx/devkit         : 19.6.2
@nx/esbuild        : 19.6.3
@nx/eslint-plugin  : 19.6.2
@nx/nest           : 19.6.2
@nx/next           : 19.6.2
@nx/node           : 19.6.2
@nx/react          : 19.6.2
@nrwl/tao          : 19.6.2
@nx/vite           : 19.6.2
@nx/web            : 19.6.2
@nx/webpack        : 19.6.2
typescript         : 5.5.4
---------------------------------------
Registered Plugins:
@nx/eslint/plugin
---------------------------------------
Community plugins:
@nx-extend/strapi                : 11.0.1
@nx-tools/nx-container           : 5.3.1
@trumbitta/nx-plugin-unused-deps : 1.12.1
---------------------------------------

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants