JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 1875
  • Score
    100M100P100Q116842F
  • License MIT

Package Exports

  • @snowpack/plugin-build-script

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@snowpack/plugin-build-script) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

@snowpack/plugin-build-script

A Snowpack plugin to build files in your application using any CLI tool. This plugin passes matching files as input to a custom CLI command and returns the output response as the build result. This is useful for connecting a custom CLI or when no Snowpack plugin exists for a favorite build tool.

Note: All Snowpack < v2.6 build:* scripts now use this plugin behind the scenes.

Usage:

npm install @snowpack/plugin-build-script

Then add the plugin to your Snowpack config:

// snowpack.config.js

module.exports = {
  plugins: [
    [
      '@snowpack/plugin-build-script',
      {
        input: ['.tsx'], // files to watch
        output: ['.tsx'], // files to export
        cmd: 'babel --filename $FILE', // cmd to run
      },
    ],
  ],
};

Plugin Options

Name Type Description
input string[] Array of extensions to watch for.
output string[] Array of extensions this plugin will output.
cmd string Command to run on every file matching input. Accepts the $FILE env var.