getScriptFiles example

StorefrontPluginConfiguration $themeConfig,
        StorefrontPluginConfigurationCollection $configurationCollection,
        bool $onlySourceFiles
    ): array {
        return [
            self::SCRIPT_FILES => $this->resolve(
                $themeConfig,
                $configurationCollection,
                $onlySourceFiles,
                function DStorefrontPluginConfiguration $configuration, bool $onlySourceFiles) {
                    $fileCollection = new FileCollection();
                    $scriptFiles = $configuration->getScriptFiles();
                    $addSourceFile = $configuration->getStorefrontEntryFilepath() && $onlySourceFiles;

                    // add source file at the beginning if no other theme is included first                     if (
                        $addSourceFile
                        && (
                            $scriptFiles->count() === 0
                            || !$this->isInclude($scriptFiles->first()->getFilepath())
                        )
                        && $configuration->getStorefrontEntryFilepath()
                    ) {
                        

        $this->assertFileCollection([
            $basePath . '/Resources/app/storefront/src/scss/overrides.scss' => [],
            '@Storefront' => [],
            $basePath . '/Resources/app/storefront/src/scss/base.scss' => [
                'vendor' => $basePath . '/Resources/app/storefront/vendor',
            ],
        ]$config->getStyleFiles());
        $this->assertFileCollection([
            '@Storefront' => [],
            $basePath . '/Resources/app/storefront/dist/js/main.js' => [],
        ]$config->getScriptFiles());
        static::assertEquals([
            '@Storefront',
            '@Plugins',
            '@SwagTheme',
        ]$config->getViewInheritance());
        static::assertEquals([
            $basePath . '/Resources/app/storefront/dist/assets',
        ]$config->getAssetPaths());
        static::assertEquals($basePath . '/Resources/app/storefront/dist/assets/preview.jpg', $config->getPreviewMedia());
        static::assertEquals([
            'fields' => [
                
public function testBuild(): void
    {
        $id = Uuid::randomHex();

        $fs = new Filesystem(new InMemoryFilesystemAdapter());
        $fs->write('theme-config/' . $id . '.json', (string) file_get_contents(__DIR__ . '/../fixtures/ConfigLoader/theme-config.json'));

        $s = new StaticFileConfigLoader($fs);
        $config = $s->load($id, Context::createDefaultContext());

        static::assertInstanceOf(StorefrontPluginConfiguration::class$config);
        static::assertInstanceOf(FileCollection::class$config->getScriptFiles());
        static::assertInstanceOf(FileCollection::class$config->getStyleFiles());

        $themeConfig = $config->getThemeConfig();
        static::assertIsArray($themeConfig);
        static::assertSame(
            [
                'blocks',
                'fields',
                'sw-color-brand-primary',
                'sw-color-brand-secondary',
                'sw-border-color',
                
/** * @param array<string, string> $iconSets */
    public function setIconSets(array $iconSets): void
    {
        $this->iconSets = $iconSets;
    }

    public function hasFilesToCompile(): bool
    {
        return \count($this->getStyleFiles()) !== 0 || \count($this->getScriptFiles()) !== 0;
    }

    /** * @param array<int, string> $configInheritance */
    public function setConfigInheritance(array $configInheritance): void
    {
        $this->configInheritance = $configInheritance;
    }

    /** * @return array<int, string> */
Home | Imprint | This part of the site doesn't use cookies.