snowpack-plugin-run

0.0.3 • Public • Published

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)

Package Sidebar

Install

npm i snowpack-plugin-run

Weekly Downloads

1

Version

0.0.3

License

MIT

Unpacked Size

4.48 kB

Total Files

4

Last publish

Collaborators

  • samparsons