diff --git a/notes.md b/notes.md index 7311302..3c76716 100644 --- a/notes.md +++ b/notes.md @@ -68,10 +68,24 @@ Requirements ## Notes -Now, when you import MyImage from '../img/my-image.png', that image will be processed and added to your output directory and the MyImage variable will contain the final url of that image after processing. -When using the css-loader, as shown above, a similar process will occur for url('../img/my-image.png') within your CSS. The loader will recognize this is a local file, and replace the '../img/my-image.png' path with the final path to the image in your output directory. -The html-loader handles in the same manner. +### assets - jpgs, svgs, etc +loaded with webpack 5's asset modules. +path to asset file is relative from the source file. assets are automatically inlined or exported as a resource based on file size. this default size is 8kb. - can configure see [docs](https://webpack.js.org/guides/asset-modules/). +Now, when you import MyImage from '../img/my-image.png', that image will be processed and added to your output directory and the MyImage variable will contain the final url of that image after processing. +When using the css-loader, as shown above, a similar process will occur for url('../img/my-image.png') within your CSS. The loader will recognize this is a local file, and replace the '../img/my-image.png' path with the final path to the image in your output directory. +The html-loader handles in the same manner. +however, in the template files need to use: +``` + +``` + +javascript is the usual: +``` + +``` + + diff --git a/src/css/style.css b/src/css/style.css index ab02df2..346889a 100644 --- a/src/css/style.css +++ b/src/css/style.css @@ -2,3 +2,4 @@ @import 'variables.css'; @import 'colors.css'; @import 'base/base.css'; + diff --git a/src/img/1.jpg b/src/img/1.jpg new file mode 100755 index 0000000..21d4a55 Binary files /dev/null and b/src/img/1.jpg differ diff --git a/src/templates/partials/component.ejs b/src/templates/partials/component.ejs index 7de4565..3be03e6 100644 --- a/src/templates/partials/component.ejs +++ b/src/templates/partials/component.ejs @@ -1,4 +1,4 @@

<%= text %>

-

woot!

+