Get queries from Browserslist config.
Argument | Type | Default | Description |
---|---|---|---|
options | object |
{} |
Browserslist options. |
Returns object
.
Get Browserslist config's environments, ignoring defaults
env.
Argument | Type | Default | Description |
---|---|---|---|
options | object |
— | Browserslist options. |
Returns string[]
.
Get environment name from options.
Argument | Type | Default | Description |
---|---|---|---|
options | object |
{} |
bdsl-webpack-plugin options. |
Returns string
.
Paste Browserslist environment name into filename template.
Argument | Type | Default | Description |
---|---|---|---|
template | string |
— | Filename template with [env] placeholder. |
browserslistEnv | string |
— | Environment name to paste. |
Returns string
.
Read options here.
Read options here.
Browserslist Differential Script Loading builder.
Argument | Type | Default | Description |
---|---|---|---|
options | object |
{} |
Builder and browserslist-useragent-regexp common options. |
options.ignorePatch | boolean |
true |
Ignore the difference in patch browser numbers. |
options.ignoreMinor | boolean |
false |
Ignore the difference in minor browser versions. |
options.allowHigherVersions | boolean |
true |
For all browsers in the browserslist query, return a match if the useragent version is equal to or higher than the one specified in browserslist. |
options.allowZeroSubverions | boolean |
true |
Ignore match of patch or patch and minor, if they are 0. |
options.unsafeUseDocumentWrite | boolean |
false |
Use document.write() to inject <script> . This variant supports defer scripts, but some browsers can restrict document.write() calls. |
Check builder has enough count of environments.
Returns boolean
.
Check builder has elements for every environment.
Returns boolean
.
Get HTML elements for default env.
Returns HTMLElementObject[]
.
Add environment.
Argument | Type | Default | Description |
---|---|---|---|
options | object |
{} |
Builder and browserslist-useragent-regexp options. |
options.isModule | boolean |
— | Use type=module support check instead of RegExp. Should be used only on certain build. |
options.browsers | string | string[] |
— | Manually provide a browserslist query (or an array of queries). It overrides the browserslist configuration specified in your project. |
options.env | string |
— | When multiple browserslist environments are specified, pick the config belonging to this environment. |
options.ignorePatch | boolean |
true |
Ignore the difference in patch browser numbers. |
options.ignoreMinor | boolean |
false |
Ignore the difference in minor browser versions. |
options.allowHigherVersions | boolean |
true |
For all browsers in the browserslist query, return a match if the useragent version is equal to or higher than the one specified in browserslist. |
options.allowZeroSubverions | boolean |
true |
Ignore match of patch or patch and minor, if they are 0. |
elements | (HTMLElementObject | JSXElementObject)[] |
— | script/style elements. |
Returns string
- environment name.
Set environment elements.
Argument | Type | Default | Description |
---|---|---|---|
optionsOrEnv | string | object |
— | Filename template with [env] placeholder. |
elements | (HTMLElementObject | JSXElementObject)[] |
— | Environment name to paste. |
Returns string
- environment name.
Build DSL script.
Argument | Type | Default | Description |
---|---|---|---|
options | object |
{} |
Build options. |
options.unsafeUseDocumentWrite | boolean |
false |
Use document.write() to inject <script> . This variant supports defer scripts, but some browsers can restrict document.write() calls. |
options.debug | boolean |
process.env.NODE_ENV !== 'production' |
Print debug info. |
Returns string
.
Assets to browser matcher.
Argument | Type | Default | Description |
---|---|---|---|
options | object |
— | Options to create matcher. |
options.assets | object |
— | Assets collection object. |
options.assetsFile | string |
— | Path to JSON file with assets collection. |
options.fs | object |
require('fs') |
NodeJS's FS compatible module. |
Get assets for browser by useragent.
Argument | Type | Default | Description |
---|---|---|---|
userAgent | string |
— | UserAgent to match assets. |
Returns SSRAssetsContainer
.
SSR Assets Container.
Get HTML-elements objects.
Returns HTMLElementObject[]
.
Get HTML-elements tags strings.
Returns string[]
.
Get HTML-elements string from container.
Argument | Type | Default | Description |
---|---|---|---|
beautify | boolean |
false |
Beautify output. |
Returns string
.
Get HTML-elements string from container.
Returns string
.