0.0.3 • Published 3 years ago

snowpack-plugin-run v0.0.3

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

npm size libera manifesto

snowpack-plugin-run

Snowpack plugin that executes shell commands sequentially when the bundle is generated.

Requirements

This plugin requires an LTS Node version (v8.0.0+) and Snowpack v2.0.0+.

Install

Using npm:

npm install --save-dev snowpack-plugin-run

Usage

Create a snowpack.config.js configuration file and execute a single shell command when the bundle is generated by setting the value of cmd to a single string:

const dsv = require('snowpack-plugin-run');

module.exports = {
  mount: {
    public: { url: '/', static: true },
    src: { url: '/dist' },
  },
  plugins: [
    [
      'snowpack-plugin-run',
      {
        cmd: 'echo "this is a single command" >> file.txt',
      },
    ],
  ],
};

Execute multiple shell commands sequential when the bundle is generated by setting the value of cmd to an array of strings:

const dsv = require('snowpack-plugin-run');

module.exports = {
  mount: { ... },
  plugins: [
    [
      'snowpack-plugin-run',
      {
        cmd: [
          'echo "this is a line"',
          'echo "this is the second line"'
        ],
      },
    ],
  ],
};

Meta

LICENSE (MIT)

0.0.3

3 years ago

0.0.1

3 years ago

0.0.0

3 years ago