A simple and efficient build tool for copying and renaming HTML files from your dist folder
BS Build Tool is a lightweight Node.js utility that simplifies the process of copying HTML files from your dist directory and organizing them in a separate bsdist folder with custom naming to load onto a brightsign player without using the BrightAuthor software. Perfect for build workflows where you need to process built assets for brightsign.
- 🚀 Auto-configuration: Automatically adds scripts and config to your existing
package.json - 📁 Smart file handling: Copies files from
disttobsdistwith custom renaming - ⚙️ Configurable: Customize source filename, destination filename, and build commands
- 🔧 Build integration: Optional build command execution before file processing
- 🛡️ Error handling: Graceful handling of missing files and build failures
- 📦 Zero dependencies: Lightweight with no external dependencies
Install the package in your project:
npm install bs-build-toolOr use it directly with npx:
npx bs-build-toolAfter installation, run the tool in your project directory:
npx bs-buildOn first run, the tool will automatically:
- Add a
bs-buildscript to yourpackage.json - Add configuration options to your
package.json. You MUST include the correct destination file name before running the package. - Copy and rename your file according to the configuration
After the initial setup, you can use the script that was added to your package.json:
npm run bs-buildSkip the build step entirely:
npx bs-build --skip-build
# or
npx bs-build -sThe tool automatically adds a config section to your package.json. You can customize these settings:
{
"config": {
"filename": "index.html",
"newfile": "bs",
"buildCommand": ""
}
}The tool works with this file structure:
your-project/
├── dist/
│ └── index.html # Source file
├── bsdist/ # Created by the tool
│ └── bs # Renamed output file
└── package.json # Auto-configured
- Build Phase (optional): Runs the configured build command
- Copy Phase: Copies the specified file from
dist/folder - Rename Phase: Renames the file to the configured new filename
- Output: File is available in
bsdist/folder
- Node.js (any recent version)
- An existing
package.jsonin your project - A
distfolder with the source file
- Make sure you're running the command in a directory with a
package.jsonfile
- Check that your
distfolder contains the specified filename - Verify the
filenameconfig matches your actual file
- The tool will continue with file copying even if the build fails
- Set
buildCommandto""to skip the build step entirely
Run with more verbose output:
DEBUG=* npx bs-buildHere's a complete example of using bs-build-tool in a Vite project:
{
"name": "my-project",
"scripts": {
"build": "vite build",
"bs-build": "node node_modules/bs-build-tool/index.js"
},
"config": {
"filename": "index.html",
"newfile": "production",
"buildCommand": ""
}
}Run the tool:
npm run bs-buildResult:
- Copies
dist/index.html→bsdist/production
Contributions are welcome! Please feel free to submit a Pull Request.
This project is licensed under the MIT License - see the LICENSE file for details.
Jackb
Made with ❤️ for the people who have the unfortunate task of designing AV ui's that run on a BrightSign player.