Menu icon Foundation
How to load specific js components only?

Hi,

I'm trying to minimize the size of my app.js file in a project, and I don't get what exactly I must do for this. For the webseite I need only the Sticky Plugin.

In my folder src/assets/js I have my app.js:

 

window.jQuery = $;
require('foundation-sites');

// If you want to pick and choose which modules to include, comment out the above and uncomment
// the line below
// import './lib/foundation-explicit-pieces';

I have commented out the "require('foundation-sites');"

and uncommented the "import './lib..." line.

Then I tried to comment out all the modules I don't need in the 'foundation-explicit-pieces.js'. But that doesn't seem to be the right way. Even if I comment out only the line (or any other line)

import { Drilldown } from 'foundation-sites/js/foundation.drilldown';

my title-bar won't be sticky anymore.

 

So, what is the right way to choose only the modules I need?

 

Thanks and regards

Mathias

 

js modulesjsmodulescustomise

Hi,

I'm trying to minimize the size of my app.js file in a project, and I don't get what exactly I must do for this. For the webseite I need only the Sticky Plugin.

In my folder src/assets/js I have my app.js:

 

window.jQuery = $;
require('foundation-sites');

// If you want to pick and choose which modules to include, comment out the above and uncomment
// the line below
// import './lib/foundation-explicit-pieces';

I have commented out the "require('foundation-sites');"

and uncommented the "import './lib..." line.

Then I tried to comment out all the modules I don't need in the 'foundation-explicit-pieces.js'. But that doesn't seem to be the right way. Even if I comment out only the line (or any other line)

import { Drilldown } from 'foundation-sites/js/foundation.drilldown';

my title-bar won't be sticky anymore.

 

So, what is the right way to choose only the modules I need?

 

Thanks and regards

Mathias

 

Mathias 3 months ago

 Hi again,

 

nobody there that can help me? I still can't figure out how to choose only the js modules I need.

 

Thanks and regards

Mathias