2.1.0 • Published 3 years ago

@snowpack/plugin-build-script v2.1.0

Weekly downloads
6,543
License
MIT
Repository
github
Last release
3 years ago

@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

NameTypeDescription
inputstring[]Array of extensions to watch for.
outputstring[]Array of extensions this plugin will output.
cmdstringCommand to run on every file matching input. Accepts the $FILE env var.
2.1.0

3 years ago

2.0.12

3 years ago

2.0.11

4 years ago

2.0.10

4 years ago

2.0.9

4 years ago

2.0.8

4 years ago

2.0.7

4 years ago

2.0.6

4 years ago

2.0.5

4 years ago

2.0.4

4 years ago

2.0.3

4 years ago

2.0.2

4 years ago

2.0.1

4 years ago

2.0.0

4 years ago