public function getAssets()
    {
        $assets = [];
        $resources = $this->config()->getItem('meliscore/ressources');
        $useBuildAssets = (bool) $resources['build']['use_build_assets'];

        $cssBuild = $resources['build']['css'];
        $jsBuild = $resources['build']['js'];
        $webpack = file_get_contents($this->getWebPackMixFile());
        $webpackStatic = '';

        if (file_exists($this->getWebPackMixStaticFile())) {
            $webpackStatic = file_get_contents($this->getWebPackMixStaticFile());
        }

        $webpack .= $webpackStatic;

        $scripts = $this->getMergedAssets($useBuildAssets)['js'];
        $stylesheets = $this->getMergedAssets($useBuildAssets)['css'];

        $assets = [
            'css' => $stylesheets,
            'js' => $scripts,
        ];

        $nonBundledCss = $this->getMergedAssets()['css'];
        $nonBundledJs = $this->getMergedAssets()['js'];


        if ($useBuildAssets) {

            $nonBundledJs = array_map(function ($a) {
                // remove the URI query
                $a = str_replace('/', '\/', $a);

                return preg_replace('/\?(.+?)*/', '', $a);
            }, $nonBundledJs);

            $nonBundledCss = array_map(function ($a) {
                // remove the URI query
                $a = str_replace('/', '\/', $a);

                return preg_replace('/\?(.+?)*/', '', $a);
            }, $nonBundledCss);


            // check each file if it has been included in the build assets, if not then stack it
            // to the the assets
            foreach ($nonBundledJs as $key => $script) {
                if (!preg_match("/$script/", $webpack)) {
                    $jsBuild[$script] = $script;
                }
            }

            foreach ($nonBundledCss as $style) {
                if (!preg_match("/$style/", $webpack)) {
                    $cssBuild[$style] = $style;
                }
            }

            $cssBuild = array_map(function ($a) {
                return str_replace('\/', '/', $a);
            }, $cssBuild);

            $jsBuild = array_map(function ($a) {
                return str_replace('\/', '/', $a);
            }, $jsBuild);

        }

        return $assets;
    }
public function getAssets()
    {
        $assets = [];
        $resources = $this->config()->getItem('meliscore/ressources');
        $useBuildAssets = (bool) $resources['build']['use_build_assets'];

        $cssBuild = $resources['build']['css'];
        $jsBuild = $resources['build']['js'];
        $webpack = file_get_contents($this->getWebPackMixFile());
        $webpackStatic = '';

        if (file_exists($this->getWebPackMixStaticFile())) {
            $webpackStatic = file_get_contents($this->getWebPackMixStaticFile());
        }

        $webpack .= $webpackStatic;

        $scripts = $this->getMergedAssets($useBuildAssets)['js'];
        $stylesheets = $this->getMergedAssets($useBuildAssets)['css'];

        $assets = [
            'css' => $stylesheets,
            'js' => $scripts,
        ];

        $nonBundledCss = $this->getMergedAssets()['css'];
        $nonBundledJs = $this->getMergedAssets()['js'];


        if ($useBuildAssets) {

            $nonBundledJs = array_map(function ($a) {
                // remove the URI query
                $a = str_replace('/', '\/', $a);

                return preg_replace('/\?(.+?)*/', '', $a);
            }, $nonBundledJs);

            $nonBundledCss = array_map(function ($a) {
                // remove the URI query
                $a = str_replace('/', '\/', $a);

                return preg_replace('/\?(.+?)*/', '', $a);
            }, $nonBundledCss);


            // check each file if it has been included in the build assets, if not then stack it
            // to the the assets
            foreach ($nonBundledJs as $key => $script) {
                if (!preg_match("/$script/", $webpack)) {
                    $jsBuild[$script] = $script;
                }
            }

            foreach ($nonBundledCss as $style) {
                if (!preg_match("/$style/", $webpack)) {
                    $cssBuild[$style] = $style;
                }
            }

            $cssBuild = array_map(function ($a) {
                return str_replace('\/', '/', $a);
            }, $cssBuild);

            $jsBuild = array_map(function ($a) {
                return str_replace('\/', '/', $a);
            }, $jsBuild);

        }

        return $assets;
    }
public function getAssets ( ) { $ assets = [ ] ; $ resources = $ this -> config ( ) -> getItem ( 'meliscore/ressources' ) ; $ useBuildAssets = ( bool ) $ resources [ 'build' ] [ 'use_build_assets' ] ; $ cssBuild = $ resources [ 'build' ] [ 'css' ] ; $ jsBuild = $ resources [ 'build' ] [ 'js' ] ; $ webpack = file_get_contents ( $ this -> getWebPackMixFile ( ) ) ; $ webpackStatic = '' ; if ( file_exists ( $ this -> getWebPackMixStaticFile ( ) ) ) { $ webpackStatic = file_get_contents ( $ this -> getWebPackMixStaticFile ( ) ) ; } $ webpack .= $ webpackStatic ; $ scripts = $ this -> getMergedAssets ( $ useBuildAssets ) [ 'js' ] ; $ stylesheets = $ this -> getMergedAssets ( $ useBuildAssets ) [ 'css' ] ; $ assets = [ 'css' => $ stylesheets , 'js' => $ scripts , ] ; $ nonBundledCss = $ this -> getMergedAssets ( ) [ 'css' ] ; $ nonBundledJs = $ this -> getMergedAssets ( ) [ 'js' ] ; if ( $ useBuildAssets ) { $ nonBundledJs = array_map ( function ( $ a ) { // remove the URI query
 $ a = str_replace ( '/' , '\/' , $ a ) ; return preg_replace ( '/\?(.+?)*/' , '' , $ a ) ; } , $ nonBundledJs ) ; $ nonBundledCss = array_map ( function ( $ a ) { // remove the URI query
 $ a = str_replace ( '/' , '\/' , $ a ) ; return preg_replace ( '/\?(.+?)*/' , '' , $ a ) ; } , $ nonBundledCss ) ; // check each file if it has been included in the build assets, if not then stack it
 // to the the assets
 foreach ( $ nonBundledJs as $ key => $ script ) { if ( ! preg_match ( "/$script/" , $ webpack ) ) { $ jsBuild [ $ script ] = $ script ; } } foreach ( $ nonBundledCss as $ style ) { if ( ! preg_match ( "/$style/" , $ webpack ) ) { $ cssBuild [ $ style ] = $ style ; } } $ cssBuild = array_map ( function ( $ a ) { return str_replace ( '\/' , '/' , $ a ) ; } , $ cssBuild ) ; $ jsBuild = array_map ( function ( $ a ) { return str_replace ( '\/' , '/' , $ a ) ; } , $ jsBuild ) ; } return $ assets ; }
Returns the assets whether build or not

@return array
Returns the assets whether build or not