Skip to content

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

@fallingforest

Description

@fallingforest

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">

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions