You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: examples/component/template.md
+5Lines changed: 5 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,3 +1,8 @@
1
+
This example demonstrates the usage of [component](https://github.com/component/component) built with webpack.
2
+
3
+
Components declare scripts and styles in a special `component.json` file. This file is handled by the plugin. In addition to that there is a different resolution algorithm for components.
4
+
5
+
You can see that the component-webpack-plugin handles these components including scripts, styles and other assets.
Copy file name to clipboardExpand all lines: examples/externals/README.md
+35-21Lines changed: 35 additions & 21 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,3 +1,19 @@
1
+
This example demonstrate how to build a library with webpack that has dependencies to other libraries which should not be included in the compiled version.
2
+
3
+
We use the `libraryTarget: "umd"` option to build a UMD module that is consumable in CommonJs, AMD and with script tags. We don't specify the `library` option so the library is exported to the root namespace.
4
+
5
+
We use the `externals` option to define dependencies that should be resolved in the target environment.
6
+
7
+
In the simple case we just need to specify a string (`"add"`). Than it's resolved as `"add"` module in CommonJs and AMD, and as global `add` when used with script tag.
8
+
9
+
In the complex case we specify different values for each environment:
Copy file name to clipboardExpand all lines: examples/externals/template.md
+16Lines changed: 16 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,3 +1,19 @@
1
+
This example demonstrate how to build a library with webpack that has dependencies to other libraries which should not be included in the compiled version.
2
+
3
+
We use the `libraryTarget: "umd"` option to build a UMD module that is consumable in CommonJs, AMD and with script tags. We don't specify the `library` option so the library is exported to the root namespace.
4
+
5
+
We use the `externals` option to define dependencies that should be resolved in the target environment.
6
+
7
+
In the simple case we just need to specify a string (`"add"`). Than it's resolved as `"add"` module in CommonJs and AMD, and as global `add` when used with script tag.
8
+
9
+
In the complex case we specify different values for each environment:
0 commit comments