Open billdwhite opened 7 years ago
Having a similar, but different problem with PrimeNG.
Running:
Angular2 2.0.0-rc.6
AngularCLI 1.0.0-beta.11-webpack.8
PrimeNG: ^1.0.0-beta.14
My angular-cli.json file is:
{
"project": {
"version": "1.0.0-beta.11-webpack.8",
"name": "a2test"
},
"apps": [
{
"root": "src",
"outDir": "dist",
"assets": "assets",
"index": "index.html",
"main": "main.ts",
"test": "test.ts",
"tsconfig": "tsconfig.json",
"prefix": "",
"mobile": false,
"styles": [
"../node_modules/primeng/resources/themes/omega/theme.css",
"../node_modules/primeng/resources/primeng.min.css",
"styles.css"
],
"scripts": [
],
"environments": {
"source": "environments/environment.ts",
"prod": "environments/environment.prod.ts",
"dev": "environments/environment.dev.ts"
}
}
],
"addons": [],
"packages": [],
"e2e": {
"protractor": {
"config": "./protractor.conf.js"
}
},
"test": {
"karma": {
"config": "./karma.conf.js"
}
},
"defaults": {
"styleExt": "css",
"prefixInterfaces": false,
"lazyRoutePrefix": "+"
}
}
my app.module.ts:
import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import { InputTextModule } from 'primeng/components/inputtext/inputtext';
import { ButtonModule } from 'primeng/components/button/button';
import { AppComponent } from './app.component';
import { WelcomeComponent } from './welcome/welcome.component';
@NgModule({
declarations: [
AppComponent, WelcomeComponent
],
imports: [
BrowserModule,
InputTextModule, ButtonModule
],
providers: [],
bootstrap: [AppComponent]
})
export class AppModule { }
running the latest AngularCLI: "1.0.0-beta.11-webpack.8"
When trying to start the app with ng serve, I get:
ERROR in ./~/css-loader!./~/postcss-loader!./~/primeng/resources/primeng.min.css
Module not found: Error: Can't resolve './images/loadingbar.gif' in 'C:\code\a2test\node_modules\primeng\resources'
@ ./~/css-loader!./~/postcss-loader!./~/primeng/resources/primeng.min.css 6:16049-16083
@ ./~/primeng/resources/primeng.min.css
@ multi styles
ERROR in ./~/css-loader!./~/postcss-loader!./~/primeng/resources/primeng.min.css
Module not found: Error: Can't resolve './images/loading.gif' in 'C:\code\a2test\node_modules\primeng\resources'
@ ./~/css-loader!./~/postcss-loader!./~/primeng/resources/primeng.min.css 6:33708-33739
@ ./~/primeng/resources/primeng.min.css
@ multi styles
ERROR in ./~/css-loader!./~/postcss-loader!./~/primeng/resources/primeng.min.css
Module not found: Error: Can't resolve './images/rating.png' in 'C:\code\a2test\node_modules\primeng\resources'
@ ./~/css-loader!./~/postcss-loader!./~/primeng/resources/primeng.min.css 6:50372-50402
@ ./~/primeng/resources/primeng.min.css
@ multi styles
@billdwhite I found a workaround using the new beta 14! Have a look at the issue at angular-cli: https://github.com/angular/angular-cli/issues/1878
When I follow the latest Angular RC5/Angular-Cli Webpack instructions here for including the
primeui-ng-all.min.css
file in theangular-cli.json
file, I get errors complaining about not having an appropriate loader for the 2 gif files mentioned below:My angular-cli-json file looks like this: