Skip to content

Make package easier to compile for web-extensions #231

@christian-bromann

Description

@christian-bromann

Currently the package always requires streamroller and the RollingFileTransport which uses fs-extra as dependency. This is less ideal when bundling an extension for the web. I would suggest to either document how to set up a bundler to allow strip out these dependencies or make it so that they won't be included by tree shaking.

My current Webpack setup for this is:

webpack.config.ts#L87-L91

    alias: {
      ...stdLibBrowser,
      streamroller: false,
      './transports/rolling-file': false
    },

And to ensure that no RollingFileTransport is used I do this:

logger.ts#L26-L30

      level: this.logLevel, // See LogLevel type in @vscode-logging/types for possible logLevels
      ...(IS_WEB_BUNDLE
        ? {}
        : { logPath: context.logUri.fsPath }
      ),

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions