npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

encre-webpack-plugin

v0.0.2

Published

Load Encre Workflow Handler Configuration file into web apps.

Downloads

1

Readme

encre-webpack-plugin

Load Encre Workflow Handler Configuration file into web apps.

Getting Started

To begin, you'll need to install encre-webpack-plugin:

npm install encre-webpack-plugin --save-dev

or

yarn add -D encre-webpack-plugin

or

pnpm add -D encre-webpack-plugin

Then add the plugin to your webpack config. For example:

webpack.config.js

const EncreWebpackPlugin = require("encre-webpack-plugin");

module.exports = {
  plugins: [new EncreWebpackPlugin()],
};

[!NOTE]

encre-webpack-plugin is not designed to read encre config file generated from the build process; rather, it is to read the config file that already exist in the source tree, as part of the build process.

[!NOTE]

You can get the original source config filename from Asset Objects.

Options

from

Type:

type from = string;

Default: encre.app.config.json

path from where we read the config file. The path can be a file path or a directory path.

[!NOTE]

If the config file name is not in the from, the plugin is reading the config file named encre.app.config.json on the corresponding from location.

If from path is not provided, then the plugin is reading the config file from the root context location (e.g. where the package.json is located).

[!WARNING]

On Windows, the forward slash and the backward slash are both separators. Instead please use /.

webpack.config.js

// relative directory path
module.exports = {
  plugins: [
    new EncreWebpackPlugin({
      from: "relative/path/to/dir",
    }),
  ],
};

// or absolute directory path
module.exports = {
  plugins: [
    new EncreWebpackPlugin({
      from: path.resolve(__dirname, "src", "dir"),
    }),
  ],
};

// or specific file path
module.exports = {
  plugins: [
    new EncreWebpackPlugin({
      from: "encre.app.config.json",
    }),
  ],
};

For windows

If you define from as absolute file path or absolute folder path on Windows, you can use windows path segment (\\)

module.exports = {
  plugins: [
    new EncreWebpackPlugin({
      from: path.resolve(__dirname, "encre.app.config.json"),
    }),
  ],
};

context

Type:

type context = string;

Default: options.context|compiler.options.context

A path to be (1) prepended to from and (2) removed from the start of the result path(s).

[!WARNING]

Don't use directly \\ in context (i.e path\to\context) option because on UNIX the backslash is a valid character inside a path component, i.e., it's not a separator. On Windows, the forward slash and the backward slash are both separators. Instead please use / or path methods.

webpack.config.js

module.exports = {
  plugins: [
    new EncreWebpackPlugin({
      from: "encre.app.config.json",
      context: "app/",
    }),
  ],
};

context can be an absolute path or a relative path. If it is a relative path, then it will be converted to an absolute path based on compiler.options.context.

context should be explicitly set only when from contains a glob. Otherwise, context is automatically set, based on whether from is a file or a directory:

If from is a file, then context is its directory. The result path will be the filename alone.

If from is a directory, then context equals from. The result paths will be the paths of the directory's contents (including nested contents), relative to the directory.

noErrorOnMissing

Type:

type noErrorOnMissing = boolean;

Default: false

Doesn't generate an error on missing file(s).

module.exports = {
  plugins: [
    new EncreWebpackPlugin({
      from: path.resolve(__dirname, "encre.app.config.json"),
      noErrorOnMissing: true,
    }),
  ],
};