webpack-conditional-loader icon indicating copy to clipboard operation
webpack-conditional-loader copied to clipboard

pass context to truthy blocks

Open MoreBlood opened this issue 6 years ago • 2 comments

this needed for passing arguments through webpack query, for example you have 10 targets with different languages, this will let to pass lang as a query to every build // #if this.query.lang === 'En' --- do something --- // #endif

MoreBlood avatar Nov 09 '18 13:11 MoreBlood

this will let to pass lang as a query to every build

@MoreBlood, looks interesting and possibly helpful to what I'm working on. Could you give an example of how the langs would be passed to each build?

njgraf512 avatar Feb 15 '19 11:02 njgraf512

@njgraf512


            {
              loader: 'webpack-conditional-loader',
              query: {
                aspectRatio: build.width / build.height,
                resizeCode: helpers.getSizeCodeName(build.width, build.height),
                language: build.language,
                localizationTool: true,
              },

MoreBlood avatar Feb 20 '19 17:02 MoreBlood