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"'
],
},
],
],
};