Open abakumov-v opened 7 years ago
I'm found reason. Error occurs because I'm restrict my ts loaders by folder "ClientApp" in this line in webpack.config:
include: /ClientApp/
If I comment out this line, the build is completed successfully.
If I'm doing this:
include: [
/ClientApp/,
/node_modules\/ng2-datepicker/
],
then it does not work and still throws the same "Unexpected character '@'" error.
But if I'm doing this:
include: [
/ClientApp/,
/node_modules/
],
then compile without errors.
P.S. To be honest i'm a beginner in Webpack, Typescript and Angular, and I don't know why this error "Unexpected character '@'" occured when I'm used only one folder in "include" section of ts laoder config. I would be happy if someone explained.
Thanks for sharing this, I ran into the exact same problem and your suggestion helped me fix it!
I think this might be a better solutions, just add ngx- prefix to the exclude.
module: {
loaders: [
// Typescript loader
{
test: /\.ts$/,
loaders: ['awesome-typescript-loader', 'angular2-template-loader']
exclude: [/node_modules\/(?!(ng2-.+|ngx-.+))/]
},
....
Hi everyone!
I'm found that webpack throw the next error after installing ng2-datepicker and importing in module.
I have an AppModule.ts and some other "business" modules. I'm import the DatePickerModule in one of modules - OperationsAreaModule:
In FilterCalendarComponent I'm using ng2-datepicker:
Here is filter-component.html:
And when I'm tryed compile my app throught webpack, I'm get this error:
Here is my webpack.config part for loading *.ts files: