npm init
, install needed packages, and define your script in package.json
.npm run [script-name]
and embed the generated output into Webflow via Custom Code or external hosting.To run a specific script in Webflow using npm, you’ll need to understand that Webflow itself doesn’t natively run npm packages—you’ll be using a local development environment alongside Webflow.
Here’s how to run an npm script that affects your Webflow project, such as a build tool or asset generator.
npm init -y
to generate a package.json
file.npm install [package-name] --save-dev
to add any needed package.npm install -D tailwindcss
.package.json
package.json
file."scripts"
section, add your desired script."build": "tailwindcss build src/input.css -o dist/output.css"
npm run [script-name]
:npm run build
"scripts"
.<link>
or <script>
in Webflow’s Page Settings → Custom Code.To run a script with npm for Webflow, set up a local project with npm init
, install your dependencies, define scripts in package.json
, run them with npm run [script]
, and connect the output to Webflow using Custom Code or hosted files. While Webflow doesn’t directly support npm, you can integrate external tools through this workflow.