forked from josefarias/hotwire_combobox
-
Notifications
You must be signed in to change notification settings - Fork 0
/
rollup.config.mjs
47 lines (45 loc) · 1.13 KB
/
rollup.config.mjs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
import * as url from "url"
import alias from "@rollup/plugin-alias"
import resolve from "@rollup/plugin-node-resolve"
import config from "./package.json" assert { type: "json" }
const __dirname = url.fileURLToPath(new URL(".", import.meta.url))
const banner = `/*!\nHotwireCombobox ${config.version}\n*/`
export default [
{
input: "app/assets/javascripts/controllers/hw_combobox_controller.js",
output: [
{
name: "HotwireCombobox",
file: "app/assets/javascripts/hotwire_combobox.umd.js",
format: "umd",
globals: {
"@hotwired/stimulus": "Stimulus"
},
banner
},
{
name: "HotwireCombobox",
file: "app/assets/javascripts/hotwire_combobox.esm.js",
format: "es",
globals: {
"@hotwired/stimulus": "Stimulus"
},
banner
}
],
plugins: [
alias({
entries: {
"hw_combobox": `${__dirname}/app/assets/javascripts/hw_combobox`,
}
}),
resolve()
],
external: [
"@hotwired/stimulus"
],
watch: {
include: "app/assets/javascripts/**"
}
}
]