According to documentation of webpack (http://webpack.github.io/docs/using-loaders.html#usage), it makes you available to preprocess sources by different customize loader. IIUC, we can have a conditional-loader to decide whether to package source or not that would depend on a given type from build time.
In order to bundle sources by a given device type, we could do some things, for instance of base_modules.js:
var moduleTV = require('conditional?type=tv!./js/modulesTV');
var modulePhone = require('conditional?type=phone!./js/modulesPhone');
When we pass the type=phone into webpack that conditional-loader is able to omit /js/modulesTV modules.
Since there is no any loader existed that can fulfill our needs to do above things, I could be going to write a conditional-loader for it.
Hey @jgyos/owners
According to documentation of webpack (http://webpack.github.io/docs/using-loaders.html#usage), it makes you available to preprocess sources by different customize loader. IIUC, we can have a conditional-loader to decide whether to package source or not that would depend on a given type from build time.
In order to bundle sources by a given device type, we could do some things, for instance of base_modules.js:
When we pass the
type=phone
into webpack that conditional-loader is able to omit /js/modulesTV modules.Since there is no any loader existed that can fulfill our needs to do above things, I could be going to write a conditional-loader for it.
What do you think?