Giter Site home page Giter Site logo

Comments (5)

alan-agius4 avatar alan-agius4 commented on September 8, 2024

Node module packages should not be imported using relative paths. This rule applies to both JavaScript and CSS files in application and library builders.

Incorrect:

@import '../node_modules/@syncfusion/ej2-base/styles/material.css';

Correct:

@import '@syncfusion/ej2-base/styles/material.css';

from angular-cli.

Mohamed7Imran avatar Mohamed7Imran commented on September 8, 2024

Hi @alan-agius4 ,

Thanks for the update still facing same issues.

image

from angular-cli.

alan-agius4 avatar alan-agius4 commented on September 8, 2024

Out of curiosity, why not include the CSS in the global stylesheet of the application? It seems like the referenced CSS is intended for global use rather than being tied to a specific component. Importing it directly into a component could significantly increase its size, especially if these stylesheets are also used in other components.

I tried building this locally, but it seems that one of the stylesheets isn't exported correctly:

✘ [ERROR] Could not resolve "@syncfusion/ej2-angular-schedule/styles/material.css"

    <stdin>:9:8:
      9 │ @import '@syncfusion/ej2-angular-schedule/styles/material.css';
        ╵         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

  The path "./styles/material.css" is not exported by package "@syncfusion/ej2-angular-schedule":

    ../../node_modules/@syncfusion/ej2-angular-schedule/package.json:43:13:
      43 │   "exports": {

from angular-cli.

Mohamed7Imran avatar Mohamed7Imran commented on September 8, 2024

why not include the CSS in the global stylesheet of the application?

We would like to contain the required styles for the scheduler component in the library itself, as well as the referenced styles is for scheduler dependent styles as it implements and holds other components in it. 

I tried building this locally, but it seems that one of the stylesheets isn't exported correctly:

You can add:

@import '@syncfusion/ej2-schedule/styles/material.css';

instead

@import '@syncfusion/ej2-angular-schedule/styles/material.css';

from angular-cli.

alan-agius4 avatar alan-agius4 commented on September 8, 2024

This approach seems quite inefficient for both build and runtime performance, unless these stylesheets aren't used by any other components in the application. Otherwise, it could lead to redundant stylesheet processing and duplicate styles in the bundles.

For context, the ScheduleComponent alone is surprisingly 4.1MB in size 😲!

The styles appear to be applied correctly:
Screenshot 2024-08-14 at 16 56 51

However, given the complexity of the component's styles, it’s hard to determine which styles might not be applied. To address this, identify and focus the bare minimum styles required to show case the problem, create a minimal reproduction to investigate further. Then you can push this repository to github and link it here.

from angular-cli.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.