├── CHANGELOG.md └── README.md /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # Craft Plugin Vite Buildchain 2 | 3 | ## 1.1.0 - 2023.02.12 4 | ### Changed 5 | * Updated the buildchain to use Vite `^4.0.0` 6 | * Use dynamic docker container name & port for the `buildchain` 7 | * Move the frontend `src/` dir from `../src/web/assets/src/` to the buildchain root, to avoid issues with various packages like eslint, stylelint, etc. from finding our source properly 8 | 9 | ## 1.0.12 - 2022.10.25 10 | ### Changed 11 | * Fixed HMR in local dev with explicit alias that resolves to the actual directory 12 | * Add `optimizeDeps` for non-ESM modules 13 | 14 | ## 1.0.11 - 2022.09.14 15 | ### Changed 16 | * Use Vite `^3.1.0` 17 | * Add comments to Makefile for Fig 18 | * Remove `vite-plugin-manifest-sri` & `vite-plugin-eslint` 19 | 20 | ## 1.0.10 - 2022.05.02 21 | ### Changed 22 | * Ignore `max-line-length` rule 23 | 24 | ### Fixed 25 | * Fix eslint errors pinning `vite-plugin-eslint` to `1.3.0` 26 | 27 | ## 1.0.9 - 2022.02.13 28 | ### Added 29 | 30 | * Add `.gitattributes` & `CODEOWNERS` 31 | * Add linting to build 32 | * Add compression of assets 33 | * Add bundle visualizer 34 | 35 | ## 1.0.8 - 2021.12.21 36 | ### Changed 37 | * Update to Tailwind CSS `^3.0.0` 38 | 39 | ## 1.0.7 - 2021.12.20 40 | ### Changed 41 | * Switch to Node 16 via `16-alpine` Docker tag by default 42 | 43 | ### Fixed 44 | * Use `${CURDIR}` instead of `pwd` to be cross-platform compatible with Windows WSL2 45 | 46 | ## 1.0.6 - 2021.12.06 47 | ### Changed 48 | * Update to use Vite `^2.7.0-beta.10` 49 | 50 | ## 1.0.5 - 2021.10.20 51 | ### Changed 52 | * Remove Static Asset Fixer plugin, use server.origin in Vite ^2.6.0 53 | 54 | ## 1.0.4 - 2021.08.24 55 | ### Fixed 56 | * Updated to work with CommonJS imports via `input: ./` 57 | 58 | ## 1.0.3 - 2021.07.22 59 | ### Added 60 | * Added the Static Asset Fixer plugin (https://github.com/vitejs/vite/issues/2394) 61 | 62 | ## 1.0.2 - 2021.05.14 63 | ### Changed 64 | * Refactored to a more flexible directory structure 65 | 66 | ## 1.0.1 - 2021.05.11 67 | ### Changed 68 | * Updated to Vite 2.3.0 69 | * Removed the no longer needed `vite/dynamic-import-polyfill` from the Entries 70 | * Set `server.host` to `0.0.0.0` so it works in Docker/VM environments 71 | 72 | ## 1.0.0 - 2021.05.09 73 | ### Added 74 | * Initial release 75 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | [![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/nystudio107/craft-plugin-vite-buildchain/badges/quality-score.png?b=v1)](https://scrutinizer-ci.com/g/nystudio107/craft-plugin-vite-buildchain/?branch=v1) [![Code Coverage](https://scrutinizer-ci.com/g/nystudio107/craft-plugin-vite-buildchain/badges/coverage.png?b=v1)](https://scrutinizer-ci.com/g/nystudio107/craft-plugin-vite-buildchain/?branch=v1) [![Build Status](https://scrutinizer-ci.com/g/nystudio107/craft-plugin-vite-buildchain/badges/build.png?b=v1)](https://scrutinizer-ci.com/g/nystudio107/craft-plugin-vite-buildchain/build-status/v1) [![Code Intelligence Status](https://scrutinizer-ci.com/g/nystudio107/craft-plugin-vite-buildchain/badges/code-intelligence.svg?b=v1)](https://scrutinizer-ci.com/code-intelligence) 2 | 3 | # Craft Plugin Vite Buildchain 4 | 5 | Related Articles: 6 | 7 | [Vite.js Next Generation Frontend Tooling + Craft CMS](https://nystudio107.com/blog/using-vite-js-next-generation-frontend-tooling-with-craft-cms) 8 | 9 | [A Vite Buildchain for Craft CMS Plugins](https://nystudio107.com/blog/a-vite-buildchain-for-craft-cms-plugins) 10 | 11 | ## Requirements 12 | 13 | * Craft CMS 3.0.0 or later 14 | 15 | ## Installation 16 | 17 | Clone this repo, and then copy the contents (including the hidden `.gitignore` file) into the root directory of your plugin via: 18 | 19 | ``` 20 | git clone https://github.com/nystudio107/craft-plugin-vite-buildchain.git 21 | ``` 22 | 23 | It's done this way as a "starter" rather than as a package, because every plugin/module will make bespoke changes to it. 24 | 25 | **N.B.:** If you won't be using this buildchain with the [plugindev](https://github.com/nystudio107/plugindev) local development environment, you'll need to delete this line from the `Makefile`: 26 | ``` 27 | --network plugindev_default \ 28 | ``` 29 | ...so that it won't be looking for the `plugindev_default` Docker network. 30 | 31 | ## Craft Plugin Vite Buildchain Overview 32 | 33 | Craft Plugin Vite Buildchain is a drop-in buildchain you can use in your Craft CMS plugins and modules, giving you Hot Module Replacement, Tailwind CSS, and optimized production builds. 34 | 35 | You shouldn't need to install this yourself unless you're using it in a Craft CMS plugin or Module. 36 | 37 | Brought to you by [nystudio107](https://nystudio107.com) 38 | --------------------------------------------------------------------------------