webpack usage

UI Components for Angular
Post Reply
loic.salou
Posts: 9
Joined: 19 Mar 2016, 19:32
Contact:

20 Mar 2016, 10:46

hi,

seems that my previous post wasn't correctly published, probably my mistake.
So I'm trying to use Prime-NG in my apps, but I'm using a starter Angular2-typescript-webpack and I can't seem to be able to build my app including primg-NG I still get nasty errors like "WARNING in ./~/primeng/primeng.js
Cannot find source file 'primeng.ts': Error: Cannot resolve 'file' or 'directory' ./primeng.ts in D:\cellarproject\angular2-webpack-starter-cellar\node_modules\primeng
" at build time and "./~/primeng/components/inputswitch/inputswitch.js
Cannot find source file 'inputswitch.ts': Error: Cannot resolve 'file' or 'directory' ./inputswitch.ts in D:\cellarproject\angular2-webpack-starter-cellar\node_modules\primeng\components\inputswitch
" in the js console.

Any idea on how I should configure webpack and use Prime-NG ?

Thanks in advance

cagatay.civici
Prime
Posts: 18616
Joined: 05 Jan 2009, 00:21
Location: Cybertron
Contact:

20 Mar 2016, 18:12

We don't publish ts files in the npm distribution, could that be the reason? It seems webpack is looking for ts files.

I don't see a problem in including ts and map files in the distribution, I've checked a couple of angular2 libs and they all include them.

cagatay.civici
Prime
Posts: 18616
Joined: 05 Jan 2009, 00:21
Location: Cybertron
Contact:

20 Mar 2016, 19:37

PrimeNG now also includes ts files in npm distro;

https://github.com/primefaces/primeng/issues/125

loic.salou
Posts: 9
Joined: 19 Mar 2016, 19:32
Contact:

22 Mar 2016, 22:29

thanks a lot, will be checking this soon !

cagatay.civici
Prime
Posts: 18616
Joined: 05 Jan 2009, 00:21
Location: Cybertron
Contact:

22 Mar 2016, 23:00

My colleague is working on a webpack quickstart for PrimeNG these days, we'll put it up soon.

TekSiDoT
Posts: 32
Joined: 10 Mar 2016, 16:44

23 Mar 2016, 11:22

great news, looking forward to it.

User avatar
DarthMaul
Posts: 582
Joined: 23 Nov 2015, 21:20

23 Mar 2016, 15:02

Have a look at this one it may solve your problem.

https://github.com/Mrtcndkn/primeng-quickstart

primeng quickstart using webpack.

loic.salou
Posts: 9
Joined: 19 Mar 2016, 19:32
Contact:

28 Mar 2016, 14:43

Hi again,

this starter primeNG / webpack works fine for basic components, thanks ! It helped me.
Problem is now that I intend to use Datatable, and this one component is not that basic. I can instantiate the table and display my content, but I can't seem to inherit from prime-NG CSS, and I get errors as soon as I intend to use the col reorder feature (which I need in my apps). The messages I get are:
  • -

    Code: Select all

    primeui-ng-all.min.js?8e52:7 Uncaught TypeError: Cannot read property 'mouse' of undefined
    -

    Code: Select all

    and VM9811:76 TypeError: jQuery(...).puicolreorder is not a function
        at DataTable.initColumnReordering (eval at <anonymous> (http://localhost:8080/js/common.js:2357:2), <anonymous>:499:51)
I changed my webpack config in order to include jQuery correctly (I had undefined jQuery at the beginning), and also primeui-ng-all.min.js + css, but I may have missed something, it's still crashing with same error messages. I'm afraid webpack is not that simple too, not sure I did it well... I added "resolve" for primgui just as I did for jQuery, for delta/theme too, + Webpack.ProvidePlugin for "primeui" and "ui" variables just as I did for "$" and "jQuery" variables, + I import and require the following in vendor.js:

Code: Select all

// Prime-NG
import 'primeng/primeng';
import 'primeui/primeui-ng-all.min';

require('jquery');
require('pngthemecss');
// require('pngfontawesomecss');
require('puingallcss');
require('puingalljs');
can you see somthing I may have missed ? or, much better ;-) can you provde full showcase built on webpack ?

Thanks in dvance !

User avatar
DarthMaul
Posts: 582
Joined: 23 Nov 2015, 21:20

28 Mar 2016, 16:32

I'm working on it as soon as i figured it out i'll inform you about the issue.

User avatar
DarthMaul
Posts: 582
Joined: 23 Nov 2015, 21:20

28 Mar 2016, 21:22

Here take a look at this => https://github.com/Mrtcndkn/primeng-quickstart i changed it a bit.Look at the commands for terminal it has a small change.

Post Reply

Return to “PrimeNG”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 7 guests