Comments (4)
from ngc-webpack.
@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.
@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.
@shlomiassaf The explanation makes sense, thanks. I hope the issue is solved for me.
from ngc-webpack.
Related Issues (20)
- Missing assets HOT 1
- Error "callback(): The callback was already called" when building with the new cleanup loader HOT 12
- breaks webpack-dll-bundles-plugin HOT 1
- Add missing any to parameter in plugin.d.ts
- AOT build with angular i18n
- Cannot set property 'disable' of undefined (tsconfig inheritance)
- Plugin doesn't work with angular 5.0.0-rc.0 HOT 23
- Angular 5.0.0.rc6 HOT 7
- Angular 5 Issue HOT 2
- 4.1.0 missing ngc-webpack/src/cli.js HOT 1
- Loader typescript chain in AOT ? HOT 2
- js, .d.ts and metadata file not generated
- Watch mode simply doesn't work with 3.x?
- Missing tsickle depedency
- Lint only
- Change log docs?
- 'Must specify "tsConfigPath" in the configuration of @ngtools/webpack.' HOT 1
- ngc version 3 work with webpack 4 HOT 1
- Error: The "@ngtools/webpack" package installed is not compatible with this version of "ngc-webpack" HOT 9
- Angular 7 ngc-webpack HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ngc-webpack.