I am working on using Zurb Foundation with WebPack and NPM, without Bower.
The problem I am encountering is the same as this below:
https://github.c
I have same problem, but I don't want have two .js files (vendor and app)!
For me, everything need be on a single file, so, I make this:
In webpack.conf.js, use externals (maybe have another way without external, but for me, this is sufficient):
externals: {
jQuery: 'jQuery',
foundation: 'Foundation'
},
create a file in your source folder (any name, like /libs/foundation.js):
// jQuery
var $ = require('jquery');
global.jQuery = $;
// if you want all features of foundation
require('./node_modules_folder/foundation-sites/dist/foundation.js');
// if you want only some features
// require('./node_modules/what-input/what-input');
// require('./node_modules/foundation-sites/js/foundation.core');
// require('./node_modules/foundation-sites/js/....');
export default Foundation;
now, you can use Foundation in any js using following syntax:
import Foundation from './libs/foundation';