I am working on a client-side project using various dependencies (e.g. page, super agent, vue). To optimize the speed of the task, I would like to create a package containing all these dependencies in one file, such as lib.js. My source will be compiled in app.js. And then, I think, I will have to contact both with my build.js. With this setting, grunt will only update app.js and build.js), not lib.js. This also means that for every dependency included in lib.js, I can still require (dep).
I read several articles about this, but I can't get it to work.
My current browser task is:
browserify: {
dev: {
files: {
'build/app.js': ['src/**/*.js', 'src/**/*.html']
},
options: {
debug: true,
external: ['vue', 'superagent', 'page']
}
}
}
and I tried to add something like this without success:
browserify: {
lib: {
files: {
'build/lib.js': ['vue', 'superagent', 'page']
}
}
}
, , , , .
. !