Stimulus Discourse

Can Stimulus be used as an ES Module without a build system?

#1

To use Stimulus without a build system, the handbook mentions adding a HTML script tag pointing at a UMD JavaScript file on unpkg.

Is (or could) Stimulus be provided such that it can be imported directly in ES6 code without using a build system?

import { Application, Controller } from "https://somecdn.com/x/stimulus.esm.js"

i.e. the module name mentioned in ES6 code is a real, full URL, as opposed to "stimulus" which requires a build system to resolve at compile-time.

0 Likes