Base solution for your next web application
Open Closed

No min.css files generated #12546


User avatar
0
angel.segura created

Depending on the computer, the min.css files in the image are not generated. Is there any way to force the generation?. Both computers, the one that works, and the one that doesn't, apparently have the same versions of angular, typescript, etc.

Markdown is supported
Copy & paste or drag & drop images (max 30 MB per image)

7 Answer(s)
  • User Avatar
    0
    oguzhanagir created
    Support Team

    Hi @angel.segura

    The .min.css files you see are not generated by Angular's standard ng build command. Instead, they are created by a task runner called Gulp, which is what ASP.NET Zero uses for its theme asset pipeline. Gulp reads the standard *.css files, combines them, minifies them, and outputs the final .min.css files.

    The reason these files are generated on one computer but not on another is that the Gulp build process is not running correctly on the second machine.

    Here are the specific steps to solve this problem and "force" the generation of the .min.css files in an ASP.NET Zero project.

    The command responsible for creating these files is typically gulp build. To run it:

    1. Open a command prompt (like Command Prompt or PowerShell) in your project's .../angular/ directory.

    2. Run the following command:

      gulp build
      

    This command will execute the tasks defined in the gulpfile.js file, which includes bundling and minifying all the necessary CSS and JS assets, including the Metronic theme files.

    If the gulp build command doesn't work or you get an error like "gulp is not recognized...", the issue is likely due to missing tools or corrupted dependencies.

    On the computer that isn't working, make sure the Gulp Command Line Interface (CLI) is installed globally.

    npm install -g gulp-cli
    

    You only need to run this command once on your machine.

    Sometimes, the packages in the node_modules folder can become corrupted or incomplete. A clean reinstall is the most reliable way to fix this.

    1. In your project's .../angular/ directory, delete the node_modules folder and the package-lock.json (or yarn.lock) file.

    2. In the command prompt, clear the npm cache (this is optional but recommended):

      npm cache clean --force
      
    3. Reinstall all the packages:

      npm install
      

      (Or simply yarn if you are using Yarn).

    4. After the packages are successfully installed, try running the Gulp task again:

      gulp build
      

    In ASP.NET Zero, the configuration for which files to bundle and minify is located in bundle.json.

    • Check the bundle.json file located in the root directory of your solution.
    • Inside this file, you should see entries that reference the paths for the Metronic theme (e.g., metronic/themes/...). Ensure these paths are correct and match the file structure in your project. You usually don't need to change this file, but it's good to verify it.
    1. Missing Global Packages: The working computer has gulp-cli installed globally, while the non working one does not.
    2. Corrupted node_modules Folder: A network error or other issue during the npm install process may have caused some packages to be installed incorrectly or not at all.
    3. Different Node.js/NPM Versions: While less common for this specific issue, significant differences in Node.js or NPM major versions can sometimes cause dependency conflicts.
    4. Initial Project Setup: When the project was first set up on the working machine, the gulp build task might have been run automatically. Maybe when the code was copied to the new machine, this build step was skipped.

    If the problem persists after checking these steps, please do not hesitate to contact us.

    Markdown is supported
    Copy & paste or drag & drop images (max 30 MB per image)
  • User Avatar
    0
    angel.segura created

    The thing is that we don't have any gulp file in the angular solution but a bundles.json file

    Markdown is supported
    Copy & paste or drag & drop images (max 30 MB per image)
  • User Avatar
    0
    oguzhanagir created
    Support Team

    Hi @angel.segura

    Could you share your project version with us? The latest version doesn't include the Metronic styles you specified. If you could share your project version information with us, I can give you a more specific answer. Thank you.

    Last version 14.3.0 bundles.json and gulpfile.mjs

    Markdown is supported
    Copy & paste or drag & drop images (max 30 MB per image)
  • User Avatar
    0
    angel.segura created

    I don't know where to find the version, but it is an old 2019 project

    Markdown is supported
    Copy & paste or drag & drop images (max 30 MB per image)
  • User Avatar
    0
    oguzhanagir created
    Support Team

    Hi @angel.segura

    If your project has an AppVersionHelper file under the *Core project, the "Version" information is set here. Can you share this information with us?

    Markdown is supported
    Copy & paste or drag & drop images (max 30 MB per image)
  • User Avatar
    0
    angel.segura created

    8.0.0.0

    Markdown is supported
    Copy & paste or drag & drop images (max 30 MB per image)
  • User Avatar
    0
    oguzhanagir created
    Support Team

    Hi @angel.segura

    To further investigate this issue and provide a more specific answer, could you please email your project to [email protected]? You can send just the "angular" part if you prefer.

    Thank you.

    Markdown is supported
    Copy & paste or drag & drop images (max 30 MB per image)