diff --git a/.github/workflows/browser-tests.yml b/.github/workflows/browser-tests.yml
index 896ca3b..b40e4fc 100644
--- a/.github/workflows/browser-tests.yml
+++ b/.github/workflows/browser-tests.yml
@@ -1,6 +1,8 @@
name: browser-tests
on:
+ pull_request:
+ branches: [development, main]
workflow_run:
workflows: [tests]
types: [completed]
diff --git a/composer.json b/composer.json
index 38eb72d..38cce54 100644
--- a/composer.json
+++ b/composer.json
@@ -78,7 +78,8 @@
"cd ./workbench && npm ci",
"ln -sf $PWD/workbench/jsconfig.json ./vendor/orchestra/testbench-core/laravel",
"ln -sf $PWD/workbench/node_modules/ ./vendor/orchestra/testbench-core/laravel",
- "ln -sf $PWD/workbench/resources/js/ ./vendor/orchestra/testbench-core/laravel/resources"
+ "ln -sf $PWD/workbench/resources/js/ ./vendor/orchestra/testbench-core/laravel/resources",
+ "ln -sf $PWD/workbench/resources/css/ ./vendor/orchestra/testbench-core/laravel/resources"
],
"serve": [
diff --git a/config/bundle.php b/config/bundle.php
index d830d3a..e50f667 100644
--- a/config/bundle.php
+++ b/config/bundle.php
@@ -11,7 +11,7 @@
| and disable this on your local development environment.
|
*/
- 'caching_enabled' => env('BUNDLE_CACHING_ENABLED', app()->isProduction()),
+ 'caching' => env('BUNDLE_CACHING', true),
/*
|--------------------------------------------------------------------------
@@ -47,7 +47,7 @@
| won't impact performance when your imports are build for prod.
|
*/
- 'sourcemaps_enabled' => env('BUNDLE_SOURCEMAPS_ENABLED', false),
+ 'sourcemaps' => env('BUNDLE_SOURCEMAPS', false),
/*
|--------------------------------------------------------------------------
diff --git a/docs/advanced-usage.md b/docs/advanced-usage.md
index 3b3b968..5fdd917 100644
--- a/docs/advanced-usage.md
+++ b/docs/advanced-usage.md
@@ -95,13 +95,13 @@ All code is minified by default. This can make issues harder to debug at times.
## Sourcemaps
-Sourcemaps are disabled by default. You may enable this by setting `BUNDLE_SOURCEMAPS_ENABLED` to true in your env file or by publishing and updating the bundle config.
+Sourcemaps are disabled by default. You may enable this by setting `BUNDLE_SOURCEMAPS` to true in your env file or by publishing and updating the bundle config.
Sourcemaps will be generated in a separate file so this won't affect performance for the end user.
{: .note }
-> If your project stored previously bundled files you need to run the [bundle:clear](https://laravel-bundle.dev/advanced-usage.html#artisan-bundleclear) command
+> If your project stored previously bundled files you need to run the [bundle:clear](https://laravel-bundle.dev/advanced-usage.html#artisan-bundleclear) command after enabling/disabling this feature.
## Cache-Control headers
@@ -148,9 +148,3 @@ BundleManager::fake();
```
When you'd like to use Dusk for browser testing you need to run Bundle in order for your tests not to blow up. Simply don't fake the BundleManager in your DuskTestCase.
-
-## CSS Loader
-
-Bun doesn't ship with a css loader. They have it on [the roadmap](https://github.com/oven-sh/bun/issues/159){:target="\_blank"} but no release date is known at this time. We plan to support css loading out-of-the-box as soon as Bun does!
-
-We'd like to experiment with Bun plugin support soon. If that is released before Bun's builtin css loader does, it might be possible to write your own plugin to achieve this.
diff --git a/docs/caveats.md b/docs/caveats.md
index 419ac7f..3c9362c 100644
--- a/docs/caveats.md
+++ b/docs/caveats.md
@@ -1,5 +1,5 @@
---
-nav_order: 7
+nav_order: 8
title: Caveats
image: "/assets/social-square.png"
---
diff --git a/docs/css-loading.md b/docs/css-loading.md
new file mode 100644
index 0000000..5b495a8
--- /dev/null
+++ b/docs/css-loading.md
@@ -0,0 +1,74 @@
+---
+nav_order: 5
+title: CSS loading
+image: "/assets/social-square.png"
+---
+
+## CSS Loading
+
+**Beta**
+
+Bun doesn't ship with a CSS loader. They have it on [the roadmap](https://github.com/oven-sh/bun/issues/159){:target="\_blank"} but no release date is known at this time.
+
+We provide a custom CSS loader plugin that just works™. Built on top of [Lightning CSS](https://lightningcss.dev/). Just use the `x-import` directive to load a css file directly. Bundle transpiles them and injects it on your page with zero effort.
+
+```html
+
+
+```
+
+Because we use Bun as a runtime when processing your files there is no need to install Lightning CSS as a dependency. When Bun encounters a import that is not installed it will fall back to it's on internal [module resolution algorithm](https://bun.sh/docs/runtime/autoimport) & install the dependency on the fly.
+
+That being said; We do recommend installing Lightning CSS in your project.
+
+```bash
+npm install lightningcss --save-dev
+```
+
+### Sass
+
+[Sass](https://sass-lang.com/) is supported out of the box. Just like with Lightning CSS you don't have to install Sass as a dependency, but it is recommended.
+
+```bash
+npm install lightningcss --save-dev
+```
+
+Note that compiled Sass is processed with LightningCSS afterwards, so if you plan on only processing scss files it is recommended to install both Lightning CSS & Sass.
+
+### Local CSS loading
+
+This works similar to [local modules](https://laravel-bundle.dev/local-modules.html). Simply add a new path alias to your `jsconfig.json` file.
+
+```json
+{
+ "compilerOptions": {
+ "paths": {
+ "~/css": ["./resources/css/*"]
+ }
+ }
+}
+```
+
+Now you can load css from your resources directory.
+
+```html
+
+```
+
+### Browser targeting
+
+Bundle automatically compiles many modern CSS syntax features to more compatible output that is supported in your target browsers. This includes some features that are not supported by browsers yet, like nested selectors & media queries, without using a preprocessor like Sass. [Check here](https://lightningcss.dev/transpilation.html#syntax-lowering) for the list of the many cool new syntaxes Lightning CSS supports.
+
+You can define what browsers to target using your `package.json` file:
+
+```json
+{
+ "browserslist": ["last 2 versions", ">= 1%", "IE 11"]
+}
+```
+
+
+
+{: .note }
+
+> Bundle currently only supports browserslist using your `package.json` file. A dedicated `.browserslistrc` is not suppported at this time.
diff --git a/docs/integrations/index.md b/docs/integrations/index.md
index 006ea8c..0112e3b 100644
--- a/docs/integrations/index.md
+++ b/docs/integrations/index.md
@@ -1,5 +1,5 @@
---
-nav_order: 6
+nav_order: 7
has_children: true
title: Integration examples
image: "/assets/social-square.png"
diff --git a/docs/production-builds.md b/docs/production-builds.md
index 3c65b4c..4b63249 100644
--- a/docs/production-builds.md
+++ b/docs/production-builds.md
@@ -1,5 +1,5 @@
---
-nav_order: 5
+nav_order: 6
title: Production builds
image: "/assets/social-square.png"
---
diff --git a/docs/roadmap.md b/docs/roadmap.md
index ab01a23..1a9285f 100644
--- a/docs/roadmap.md
+++ b/docs/roadmap.md
@@ -1,5 +1,5 @@
---
-nav_order: 8
+nav_order: 9
title: Roadmap
image: "/assets/social-square.png"
---
@@ -8,7 +8,15 @@ image: "/assets/social-square.png"
Bundle is under active development. If you feel there are features missing or you've got a great idea that's not on on the roadmap please [open a discussion](https://github.com/gwleuverink/bundle/discussions/categories/ideas){:target="\_blank"} on GitHub.
-## CSS loader
+## ✅ Injecting Bundle's core on every page
+
+**_Added in [v0.1.3](https://github.com/gwleuverink/bundle/releases/tag/v0.1.3)_**
+
+This will reduce every import's size slightly. But more importantly; it will greatly decrease the chance of unexpected behaviour caused by race conditions, since the Bundle's core is available on pageload.
+
+## ✅ CSS loader
+
+**_Added in [v0.1.4](https://github.com/gwleuverink/bundle/releases/tag/v0.1.4)_**
Bun doesn't ship with a CSS loader. They have it on [the roadmap](https://github.com/oven-sh/bun/issues/159){:target="\_blank"} but no release date is known at this time. We plan to support CSS loading out-of-the-box as soon as Bun does!
@@ -98,12 +106,6 @@ It would be incredible if this object could be forwarded to Alpine directly like
```
-## ✅ Injecting Bundle's core on every page
-
-**_Added in [v0.1.3](https://github.com/gwleuverink/bundle/releases/tag/v0.1.3)_**
-
-This will reduce every import's size slightly. But more importantly; it will greatly decrease the chance of unexpected behaviour caused by race conditions, since the Bundle's core is available on pageload.
-
## Optionally assigning a import to the window scope
It could be convenient to provide an api to assign imports to a window variable by use of a prop. This idea is still settling in so might change.
diff --git a/phpunit.xml b/phpunit.xml
index 7d0904f..950f805 100644
--- a/phpunit.xml
+++ b/phpunit.xml
@@ -4,11 +4,18 @@
bootstrap="vendor/autoload.php"
colors="true"
>
+
+
+
+
+
+
./tests
+