Annotation Interface NpmPackage
@Retention(RUNTIME)
@Target(TYPE)
@Documented
@Inherited
@Repeatable(Container.class)
public @interface NpmPackage
Annotation for defining an npm package dependency on a
Component
class which includes one or more JS modules. The JS Modules can be defined
using JsModule annotation on the same Component. For adding
multiple npm packages files for a single component, you can use this
annotation multiple times.
Declared npm packages will be bundled by flow-maven-plugin in a package.json file, making sure that only one dependency is created.
- Since:
- 2.0
- Author:
- Vaadin Ltd
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic @interfaceInternal annotation to enable use of multipleNpmPackageannotations. -
Required Element Summary
Required Elements -
Optional Element Summary
Optional Elements
-
Element Details
-
value
String valuenpm package to install before loading any JS modules declared usingJsModule.- Returns:
- an npm JavaScript package
-
version
String versionDefines the npm package version. It should meet the 'd.d.d' or the 'd.d.d-suffix' pattern.Troubleshooting: when two or more annotations with the same package value are found in the class-path, and their versions do not match, the build process will print a warning message informing about found versions and which one will be used.
- Returns:
- npm package version
-
-
-
dev
boolean devWhether the package should be installed as a dev dependency.- Returns:
trueif the package should be installed as a dev dependency,falseotherwise.
- Default:
- false
-
assets
String[] assetsAssets to copy from this npm package for static use. Format is "copyFromPathInModule:copyTargetFolderUnderFrontend", e.g. "dist/line-awesome/css/**:line-awesome/dist/line-awesome/css"- Returns:
- array of assets to copy from npm package
- Default:
- {}
-