1.1.3 • Published 4 years ago

@hackney/webpack-import-map-plugin v1.1.3

Weekly downloads
-
License
MIT
Repository
github
Last release
4 years ago

@hackney/webpack-import-map-plugin

Import Map Webpack Plugin will produce an import-map of built files.

Usage

const { ImportMapWebpackPlugin } = require("@hackney/webpack-import-map-plugin");

const webpackConfig = {
  entry: {
    main: "./src/index.js",
  },
  output: {
    filename: "[name].[contenthash:8].js",
  },
  plugins: [
    new ImportMapWebpackPlugin({
      basePath: process.env.CDN_URL || "http://localhost:8000",
      namespace: "@mtfh",
      outputFilename: `import-map.${process.env.APP_ENV || "development"}`,
    }),
  ],
};

The above will produce an import-map with the following output:

// dist/import-map.development.json
{
  "imports": {
    "@mtfh/main": "http://localhost:8000/main.74284023.js"
  }
}

Options

basePath *

Must be a valid URL domain

namespace *

The namespace the outputted files belong to. e.g. @mtfh

outputFilename

The name of json file to be generated. Defaults to import-map.json

1.1.3

4 years ago

1.1.1

4 years ago

1.1.2

4 years ago

1.1.0

4 years ago

1.0.1

4 years ago