Skip to content

Commit

Permalink
Add test vite
Browse files Browse the repository at this point in the history
  • Loading branch information
wikigods committed Sep 2, 2022
1 parent 7dabc92 commit d2d3a11
Show file tree
Hide file tree
Showing 5 changed files with 45 additions and 33 deletions.
4 changes: 2 additions & 2 deletions tests/Commands/ModuleMakeCommandTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -109,11 +109,11 @@ public function it_generates_api_route_file()
}

/** @test */
public function it_generates_webpack_file()
public function it_generates_vite_file()
{
$code = $this->artisan('module:make', ['name' => ['Blog']]);

$path = $this->modulePath . '/' . $this->app['modules']->config('stubs.files.webpack');
$path = $this->modulePath . '/' . $this->app['modules']->config('stubs.files.vite');

$this->assertMatchesSnapshot($this->finder->get($path));
$this->assertSame(0, $code);
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<?php
return 'const dotenvExpand = require(\'dotenv-expand\');
dotenvExpand(require(\'dotenv\').config({ path: \'../../.env\'/*, debug: true*/}));
import { defineConfig } from \'vite\';
//import laravel from \'laravel-vite-plugin\';
export default defineConfig({
build: {
outDir: \'../../public/build-blog\',
emptyOutDir: true,
manifest: true,
target: \'es2018\',
rollupOptions: {
input: [
__dirname + \'/Resources/assets/sass/app.scss\',
__dirname + \'/Resources/assets/js/app.js\'
]
}
},
});
';

Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
const dotenvExpand = require('dotenv-expand');
dotenvExpand(require('dotenv').config({ path: '../../.env'/*, debug: true*/}));

import { defineConfig } from 'vite';
//import laravel from 'laravel-vite-plugin';

export default defineConfig({
build: {
outDir: '../../public/build-$LOWER_NAME$',
emptyOutDir: true,
manifest: true,
target: 'es2018',
rollupOptions: {
input: [
__dirname + '/Resources/assets/sass/app.scss',
__dirname + '/Resources/assets/js/app.js'
]
}
},
});

This file was deleted.

This file was deleted.

0 comments on commit d2d3a11

Please sign in to comment.