Skip to content

Commit f847280

Browse files
committed
feat: add useWebpack
1 parent daf21ca commit f847280

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

src/Html/Builder.php

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,13 +74,21 @@ public function __construct(public Repository $config, public Factory $view, pub
7474
}
7575

7676
/**
77-
* Set the default type to module or the DataTables javascript.
77+
* Set the default type to module for the DataTables javascript.
7878
*/
7979
public static function useVite(): void
8080
{
8181
static::$jsType = 'module';
8282
}
8383

84+
/**
85+
* Set the default type to text/javascript for the DataTables javascript.
86+
*/
87+
public static function useWebpack(): void
88+
{
89+
static::$jsType = 'text/javascript';
90+
}
91+
8492
/**
8593
* Generate DataTable javascript.
8694
*

tests/BuilderTest.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ public function it_can_use_vitejs_module_script()
1717
Builder::useVite();
1818

1919
$this->assertStringContainsString('type="module"', $this->getHtmlBuilder()->scripts()->toHtml());
20+
21+
Builder::useWebpack();
2022
}
2123

2224
/** @test */

0 commit comments

Comments
 (0)