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

ember-cli-deploy-adonis

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ember-cli-deploy-adonis

Build and publish your ember frontend app into an adonis backend app.

  • 1.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

ember-cli-deploy-adonis

This plugin is an ember-cli-deploy plugin that copies your application assets and index.html to your directory of choice.

Intended to be used with AdonisJS but can be used where copying your project files to a directory is required.

Installation

pnpm add -D ember-cli-deploy-adonis

Usage

Add an adonis section to your deploy config ENV:

// config/deploy.js
const ENV = {
  build: {},
  adonis: {
    destDir: "../server/public/web/",
    indexFileLocation: "../server/resources/views/ember-web-index.edge",
    filePattern: [
      "**/*.{js,css,png,gif,ico,jpg,webp,mp3,map,xml,txt,svg,swf,eot,ttf,woff,woff2,otf,wasm,json}",
      "!**/ember-electron/*",
    ],
  },
};

In ember-cli-build.js update your fingerprinting options to include the prepend option:

function isProduction() {
  return EmberApp.env() === "production";
}

function getPublicAssetsUrl() {
  if (isProduction()) {
    if (process.env.ADONIS_BUILD) return "/web/";
    return "https://cdn.ekto.tv/ekto-web/";
  }

  return "/";
}

const app = new EmberApp(defaults, {
  fingerprint: {
    prepend: getPublicAssetsUrl(),
  },
  // ... other options
});

If you're using embroider set your publicAssetsUrl

// ... other options
packagerOptions: {
  publicAssetURL: getPublicAssetsUrl(),
  // ... other options
},
// ... other options

AdonisJS

Add a wildcard route to your adonis application

Route.get("*", "EmberWebController.index");

Create a controller to serve your index file

// app/Controllers/Http/EmberWebController.js
import type { HttpContextContract } from '@ioc:Adonis/Core/HttpContext';

export default class EmberWebController {
  public async index({ view }: HttpContextContract) {
    return view.render('ember-web-index');
  }
}

Contributing

See the Contributing guide for details.

License

This project is licensed under the MIT License.

Keywords

FAQs

Package last updated on 11 Jan 2024

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