Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AOT Build when using date-fns #458

Open
blaur opened this issue Aug 15, 2017 · 2 comments
Open

AOT Build when using date-fns #458

blaur opened this issue Aug 15, 2017 · 2 comments

Comments

@blaur
Copy link

blaur commented Aug 15, 2017

Hi everyone,

Hope you are well and might be able to assist me.

I'm struggling with my aot build after having included date-fns into my project (through angular-calendar). It all builds okay with the normal production build.

I'm including the functions in my code like this:

import {
  startOfDay,
  subDays,
  addDays,
  endOfMonth,
  isSameDay,
  isSameMonth,
  addWeeks,
  subWeeks,
  addMonths,
  subMonths,
  addHours
} from 'date-fns';

In my seed.config.ts I am including the lib in the following way (also as illustrated in other examples):

paths: {
    ....
   'date-fns': 'node_modules/date-fns/index.js',

packages: {
    ....
    'date-fns': {
        main: './index.js',
        defaultExtension: 'js'
      }

Everywhere I read and everyone I ask tells me the above is sufficient for them. But for some reason I am not able to compile it when used in the angular-seed here.

The error is:
Error on fetch for date-fns/get_iso_week.js

Obivously the mapping is for some reason not correct. Is there anything special I need to do for the angular-seed-advanced to make it right?

If I add the following line to my paths it can succesfully build aot and prod build, but then nothing works anymore so I am but out of ideas:
'date-fns/*': 'node_modules/date-fns/index.js',

Any suggestions?

@blaur blaur changed the title AOT Build with using date-fns AOT Build when using date-fns Aug 15, 2017
@Thavarajan
Copy link

seems this is a javascript lib so you need to add it in the nodemodules section

@blaur blaur closed this as completed Aug 20, 2017
@blaur
Copy link
Author

blaur commented Sep 13, 2017

It now shows that this is still a problem for us. Anybody else having this issue?

@blaur blaur reopened this Sep 13, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants