Top Menu

Jump to content
Home
    Modules
      • Projects
      • Activity
      • Work packages
      • Gantt charts
      • Calendars
      • Team planners
      • Boards
      • News
    • Getting started
    • Introduction video
      Welcome to OpenProject Community
      Get a quick overview of project management and team collaboration with OpenProject. You can restart this video from the help menu.

    • Help and support
    • Upgrade to Enterprise edition
    • User guides
    • Videos
    • Shortcuts
    • Community forum
    • Enterprise support

    • Additional resources
    • Data privacy and security policy
    • Digital accessibility (DE)
    • OpenProject website
    • Security alerts / Newsletter
    • OpenProject blog
    • Release notes
    • Report a bug
    • Development roadmap
    • Add and edit translations
    • API documentation
  • Sign in
      Forgot your password?

      or sign in with your existing account

      Google

Side Menu

  • Overview
  • Activity
    Activity
  • Roadmap
  • Work packages
    Work packages
  • Gantt charts
    Gantt charts
  • Calendars
    Calendars
  • Team planners
    Team planners
  • Boards
    Boards
  • News
  • Forums

Content

Development
  1. OpenProject
  2. Forums
  3. Development
  4. Webpack: Non-Angular js/ts files in plugins

Webpack: Non-Angular js/ts files in plugins

Added by Niclas UNIBE about 1 year ago

I would like the webpack to serve ts files defined in my plugin.
These files are not part of an angular app, I use them for stimulus.

The only solution I found so far was to create a "fake" angular app by creating a file frontend/module/main.ts in my plugin.
This gets linked and imported when executing  ./bin/rake openproject:plugins:register_frontend.

This is not a very nice solution and I was wondering if there is a better way to tell webpack about my js/ts files.

Thats the main.ts I'm currently using.

import {
  Injector,
  NgModule,
} from '@angular/core';

// Do custom imports here
// (I think you might actually need to "use" the imported objects in this file, otherwise they are considered "unused" and not served by webpack)

@NgModule({})
export class PluginModule {}

Loading...