public final class RequireJS extends Object
| Modifier and Type | Field and Description |
|---|---|
static String |
WEBJARS_MAVEN_PREFIX |
| Modifier and Type | Method and Description |
|---|---|
static String |
generateSetupJavaScript(Collection<String> prefixes)
Returns the JavaScript that is used to setup the RequireJS config.
|
static String |
generateSetupJavaScript(Collection<String> prefixes,
Map<String,String> webJars)
Generate the JavaScript that is used to setup the RequireJS config.
|
static Map<String,com.fasterxml.jackson.databind.node.ObjectNode> |
generateSetupJson(List<Map.Entry<String,Boolean>> prefixes)
Returns the JSON used to setup the RequireJS config for each WebJar in the CLASSPATH.
|
static com.fasterxml.jackson.databind.node.ObjectNode |
getBowerWebJarRequireJsConfig(Map.Entry<String,String> webJar,
List<Map.Entry<String,Boolean>> prefixes)
Returns the JSON RequireJS config for a given Bower WebJar
|
static com.fasterxml.jackson.databind.node.ObjectNode |
getNpmWebJarRequireJsConfig(Map.Entry<String,String> webJar,
List<Map.Entry<String,Boolean>> prefixes)
Returns the JSON RequireJS config for a given Bower WebJar
|
static String |
getRawWebJarRequireJsConfig(Map.Entry<String,String> webJar) |
static String |
getSetupJavaScript(String urlPrefix)
Returns the JavaScript that is used to setup the RequireJS config.
|
static String |
getSetupJavaScript(String cdnPrefix,
String urlPrefix)
Returns the JavaScript that is used to setup the RequireJS config.
|
static Map<String,com.fasterxml.jackson.databind.node.ObjectNode> |
getSetupJson(String urlPrefix)
Returns the JSON that is used to setup the RequireJS config.
|
static Map<String,com.fasterxml.jackson.databind.node.ObjectNode> |
getSetupJson(String cdnPrefix,
String urlPrefix)
Returns the JSON that is used to setup the RequireJS config.
|
static String |
getWebJarConfig(Map.Entry<String,String> webJar)
Deprecated.
|
static com.fasterxml.jackson.databind.node.ObjectNode |
getWebJarRequireJsConfig(Map.Entry<String,String> webJar,
List<Map.Entry<String,Boolean>> prefixes)
Returns the JSON RequireJS config for a given WebJar
|
public static final String WEBJARS_MAVEN_PREFIX
@Nonnull public static String getSetupJavaScript(@Nullable String urlPrefix)
urlPrefix - The URL prefix where the WebJars can be downloaded from with a trailing slash, e.g. /webJars/@Nonnull public static String getSetupJavaScript(@Nullable String cdnPrefix, @Nullable String urlPrefix)
urlPrefix - The URL prefix where the WebJars can be downloaded from with a trailing slash, e.g. /webJars/cdnPrefix - The optional CDN prefix where the WebJars can be downloaded from@Nonnull public static String generateSetupJavaScript(@Nonnull Collection<String> prefixes)
prefixes - A list of the prefixes to use in the `paths` part of the RequireJS config.@Nonnull public static String generateSetupJavaScript(@Nonnull Collection<String> prefixes, @Nonnull Map<String,String> webJars)
prefixes - A list of the prefixes to use in the `paths` part of the RequireJS config.webJars - The WebJars (artifactId -> version) to use@Nonnull public static Map<String,com.fasterxml.jackson.databind.node.ObjectNode> getSetupJson(@Nullable String urlPrefix)
urlPrefix - The URL prefix where the WebJars can be downloaded from with a trailing slash, e.g. /webJars/@Nonnull public static Map<String,com.fasterxml.jackson.databind.node.ObjectNode> getSetupJson(@Nullable String cdnPrefix, @Nullable String urlPrefix)
cdnPrefix - The CDN prefix where the WebJars can be downloaded fromurlPrefix - The URL prefix where the WebJars can be downloaded from with a trailing slash, e.g. /webJars/@Nonnull public static Map<String,com.fasterxml.jackson.databind.node.ObjectNode> generateSetupJson(@Nonnull List<Map.Entry<String,Boolean>> prefixes)
prefixes - A list of the prefixes to use in the `paths` part of the RequireJS config with a boolean flag indicating whether or not to include the version.public static com.fasterxml.jackson.databind.node.ObjectNode getWebJarRequireJsConfig(Map.Entry<String,String> webJar, List<Map.Entry<String,Boolean>> prefixes)
webJar - A tuple (artifactId -> version) representing the WebJar.prefixes - A list of the prefixes to use in the `paths` part of the RequireJS config.public static com.fasterxml.jackson.databind.node.ObjectNode getBowerWebJarRequireJsConfig(Map.Entry<String,String> webJar, List<Map.Entry<String,Boolean>> prefixes)
webJar - A tuple (artifactId -> version) representing the WebJar.prefixes - A list of the prefixes to use in the `paths` part of the RequireJS config.public static com.fasterxml.jackson.databind.node.ObjectNode getNpmWebJarRequireJsConfig(Map.Entry<String,String> webJar, List<Map.Entry<String,Boolean>> prefixes)
webJar - A tuple (artifactId -> version) representing the WebJar.prefixes - A list of the prefixes to use in the `paths` part of the RequireJS config.@Nonnull public static String getRawWebJarRequireJsConfig(@Nonnull Map.Entry<String,String> webJar)
webJar - A tuple (artifactId -> version) representing the WebJar.@Deprecated @Nullable public static String getWebJarConfig(@Nonnull Map.Entry<String,String> webJar)
webJar - A tuple (artifactId -> version) representing the WebJar.Copyright © 2012–2022. All rights reserved.