Giter Club home page Giter Club logo

Comments (4)

shlomiassaf avatar shlomiassaf commented on August 31, 2024 1

from ngc-webpack.

shlomiassaf avatar shlomiassaf commented on August 31, 2024

@bisubus Hi

Sorry for the late response.

This is not an ngc-webpack issue, it is just how the AOT compiler works.

The AOT compiler does not know about webpack and it expects client code, sending require to it will make it fail.

ngc-webpack does not process your code, the AOT compiler does (actually it's TS) and both AOT compiler and TS doesn't know about require

But it cannot be easily used in JIT.

This is not correct, use angular2-template-loader as done in angular-starter
This will work in JIT and AOT.

Use it and it will solve the issue, this is exactly the purpose of that loader.

from ngc-webpack.

bisubus avatar bisubus commented on August 31, 2024

@shlomiassaf Thank you for commenting on this. Are you certain about angular2-template-loader and the way it works with ngc-webpack? I have it in my config currently, but I honestly don't remember how it affected AOT/JiT build.

IIUC, all angular2-template-loader is supposed to do is transforming styleUrls: ['./foo-bar.scss'] to styles: [require('./foo-bar.scss')], isn't it? Why is it expected to work then, while using styles: [require('./foo-bar.scss')] directly doesn't work?

from ngc-webpack.

bisubus avatar bisubus commented on August 31, 2024

@shlomiassaf The explanation makes sense, thanks. I hope the issue is solved for me.

from ngc-webpack.

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.