Reorganized app directory to better separate backend and frontend code

This commit is contained in:
Chris Kankiewicz
2020-01-26 01:50:51 -07:00
parent f1bc3736cc
commit 1b52c3404f
29 changed files with 10 additions and 10 deletions

View File

@@ -5,7 +5,7 @@ namespace App\ViewFunctions;
class Asset extends ViewFunction
{
/** @const Constant description */
protected const ASSET_PATH = '/app/dist/';
protected const ASSET_PATH = '/app/assets/';
/** @var string The function name */
protected $name = 'asset';

View File

@@ -30,7 +30,7 @@
},
"autoload": {
"psr-4": {
"App\\": "app/"
"App\\": "app/src/"
}
},
"autoload-dev": {

View File

@@ -18,7 +18,7 @@
<UndefinedInterfaceMethod>
<errorLevel type="suppress">
<referencedMethod name="Twig\Extension\ExtensionInterface::setdateformat" />
<file name="app/Providers/TwigProvider.php" />
<file name="app/src/Providers/TwigProvider.php" />
</errorLevel>
</UndefinedInterfaceMethod>

View File

@@ -11,8 +11,8 @@ class AssetTest extends TestCase
{
$asset = new Asset($this->container, $this->config);
$this->assertEquals('/app/dist/css/app.css', $asset('css/app.css'));
$this->assertEquals('/app/dist/js/app.js', $asset('js/app.js'));
$this->assertEquals('/app/assets/css/app.css', $asset('css/app.css'));
$this->assertEquals('/app/assets/js/app.js', $asset('js/app.js'));
}
public function test_it_can_return_an_asset_with_a_subdirectory(): void
@@ -21,7 +21,7 @@ class AssetTest extends TestCase
$asset = new Asset($this->container, $this->config);
$this->assertEquals('/some/dir/app/dist/css/app.css', $asset('css/app.css'));
$this->assertEquals('/some/dir/app/dist/js/app.js', $asset('js/app.js'));
$this->assertEquals('/some/dir/app/assets/css/app.css', $asset('css/app.css'));
$this->assertEquals('/some/dir/app/assets/js/app.js', $asset('js/app.js'));
}
}

View File

@@ -8,16 +8,16 @@ mix.webpackConfig({
watchOptions: { ignored: ['node_modules', 'vendor'] }
});
mix.sass('app/resources/sass/app.scss', 'app/dist/app.css').options({
mix.sass('app/resources/sass/app.scss', 'app/assets/app.css').options({
processCssUrls: false,
postCss: [tailwindcss('tailwind.config.js')]
});
mix.js('app/resources/js/app.js', 'app/dist/app.js');
mix.js('app/resources/js/app.js', 'app/assets/app.js');
mix.copyDirectory(
'node_modules/@fortawesome/fontawesome-free/webfonts',
'app/dist/webfonts'
'app/assets/webfonts'
);
mix.purgeCss({