Fuse-box: Include a sub package in a bundle

Created on 23 Feb 2017  路  4Comments  路  Source: fuse-box/fuse-box

Hello,

This is probably my own ignorance, but I did not find a way to include a subpackage in my vendor bundle.

A created a small project demonstrating the issue.

The gist of the problem is that the locales of the package date-fns are in a subpackage.
I tried to include them like this:

fsbx.FuseBox.init({
  homeDir: `./src`,
  cache: false,
  log: false
}).bundle({
  [`dist/vendor.js`]: "+date-fns +date-fns/locale/fr"
})

But this does not work as I expected.
Could you suggest another way to accomplish this?

bug

Most helpful comment

Coming with the next one

All 4 comments

@geowarin thanks for reporting!

Yeah, it's a known "bug" you can't really add it like so. But this will be fixed.
You can make a workaround for now:

require("date-fns/locale/fr")

Ok. Yeah there is an easy workaround for those interested.

additionalVendors.js

require('date-fns/locale/fr');

fuse.js

vendor.bundle({
  [`dist/vendor.js`]: "+date-fns additionalVendors.js"
})

Thanks there seems to be a problem with distinguishing what is a node module reference and what is a file. Gotta keep that issue in mind.
Thanks.

Coming with the next one

Was this page helpful?
0 / 5 - 0 ratings

Related issues

nchanged picture nchanged  路  5Comments

charles-mathieus-jomedia picture charles-mathieus-jomedia  路  4Comments

viankakrisna picture viankakrisna  路  5Comments

dzek69 picture dzek69  路  3Comments

dlacaille picture dlacaille  路  3Comments