[keycloak-user] Angular 2 with Webpack

Niko Köbler niko at n-k.de
Tue Jan 31 14:47:25 EST 2017


Brian, ebondu,

I’m not having problems with static resources or keycloak.json.
This is all fine for me (and additionally I get my „keycloak.json“ from a service somewhere else - works).

My troubles are packing the bundle with Webpack if the keycloak-js module is referenced.
And this is, as I mentioned, happening with Webpack2 and Typescript. With Webpack1 and JavaScript everything is fine.

- Niko


> Am 31.01.2017 um 17:51 schrieb Brian Schofield <scope022 at gmail.com>:
> 
> @ebondu
> Are you not using HtmlWebpackPlugin or CommonChunksPlugin?
> I only ask because I would be hesitant to use CopyWebpackPlugin to copy an
> entire directory especially when you can have webpack inject all your
> bundles into your index page and allow webpack to configure and build your
> distribution directory.
> 
> On Tue, Jan 31, 2017 at 9:32 AM, ebondu <dev.ebondu at gmail.com> wrote:
> 
>> Hi,
>> 
>> Just to clarify, "keycloak.js" and "keycloak.json" files have differents
>> purposes. The first one is the official Javascript adapater lib and the
>> second one is your keycloak client configuration & realm settings file.
>> The native Typescript lib is supposed to *replace* the original Javascript
>> lib so you don't need to import bundle keycloak.js in your index.html (or
>> to
>> add it to your bundle).
>> 
>> @Niko,
>> Here is the webpack config I used for assets:
>> 
>> new CopyWebpackPlugin([{
>>     from: root('src/public')
>> }])
>> 
>> 
>> 
>> 
>> 
>> --
>> View this message in context: http://keycloak-user.88327.x6.
>> nabble.com/keycloak-user-Angular-2-with-Webpack-tp2493p2545.html
>> Sent from the keycloak-user mailing list archive at Nabble.com.
>> _______________________________________________
>> keycloak-user mailing list
>> keycloak-user at lists.jboss.org
>> https://lists.jboss.org/mailman/listinfo/keycloak-user
>> 
> 
> 
> 
> -- 
> Brian §chofield
> _______________________________________________
> keycloak-user mailing list
> keycloak-user at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/keycloak-user




More information about the keycloak-user mailing list