Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

nuxt-typo3-config

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

nuxt-typo3-config

Setup your nuxt-typo3 application with .env, .json or TYPO3 API.

  • 1.0.0
  • npm
  • Socket score

Version published
Weekly downloads
42
increased by35.48%
Maintainers
1
Weekly downloads
 
Created
Source

Nuxt-TYPO3 configuration loader

Setup your nuxt-typo3 application with .env, .json or TYPO3 API.

Create .env file

Create your .env file

mkdir config
touch config/.env.stage

Run build with selected config file

It runs building process with .env.stage file

ENV_CONFIG=stage yarn build

Initial config

To configure TYPO3 multisites we can fetch initialConfig from TYPO3 API. You have to specify endpoint to get specific configuration:

.env.test:

#### NUXT-TYPO3 #######################################
#
# Connect to TYPO3 backend by API host
#
TYPO3_CONFIG_API=https://typo3instance.com/api?type=835
#
#######################################################

You can mockup initialConfig by json file - for example - env.test.json is the file for local environment.

{
    "typo3": {
      "domains": [
        {
          "name": "localhost",
          "baseURL": "https://www.mydomain.com",
          "api": {
            "baseURL": "https://api.mydomain.com"
          },
          "layouts": {
            "blank-page": "blank-page"
          },
          "i18n": {
            "defaultLocale": "uk"
          }
        }
  
      ]
    }
  }

Setup Nuxt app

loadConfiguration(config, dir)

Read .env files + .json with multidomains configuration

config - configuration key (for .env.production key will be "production", default: "production")

dir - your configuration directory (default: "config")

import loadConfiguration from 'nuxt-typo3-config'
const env = loadConfiguration()

export default {
    ...
    typo3: env.typo3
    ...
}

async getConfiguration(config, dir)

Read .env files and get configuration from API. To get configuration you have to specify TYPO3 endpoint by variable:

TYPO3_CONFIG_API=https://yourtypo3.com/?type=835

config - configuration key (for .env.production key will be "production", default: "production")

dir - your configuration directory (default: "config")

import { getConfiguration } from 'nuxt-typo3-config'

setupConfig = (env) => ({
    ...
    typo3: env.typo3
    ...
})

export default async () => {
  const env = await getConfiguration()

  return setupConfig(env)
}

FAQs

Package last updated on 09 Sep 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc