summaryrefslogtreecommitdiff
path: root/assets/script
diff options
context:
space:
mode:
authorhref <href@random.sh>2021-09-02 08:06:50 +0200
committerhref <href@random.sh>2021-09-02 08:06:50 +0200
commit1fbd63419355e8ddd482c3cb62641bed1366763b (patch)
tree370ce63fcf19f2fd8b1f5136fc19a317050ba0f3 /assets/script
parenttxt: don't search in files with dot, display them below in web (diff)
Phoenix 1.6rc0 & Use proper Esbuild/Tailwind/Npm
Diffstat (limited to 'assets/script')
-rw-r--r--assets/script/build.alcoolog.js11
-rw-r--r--assets/script/build.site.js11
-rwxr-xr-xassets/script/check-freshness4
-rw-r--r--assets/script/watch.site.js13
4 files changed, 39 insertions, 0 deletions
diff --git a/assets/script/build.alcoolog.js b/assets/script/build.alcoolog.js
new file mode 100644
index 0000000..fca8633
--- /dev/null
+++ b/assets/script/build.alcoolog.js
@@ -0,0 +1,11 @@
+const esbuild = require('esbuild');
+const { stimulusPlugin } = require('esbuild-plugin-stimulus');
+
+esbuild.build({
+ entryPoints: ['alcoolog.js'],
+ bundle: true,
+ outfile: '../priv/static/assets/alcoolog.js',
+ minify: true,
+ sourcemap: false,
+ plugins: [stimulusPlugin()],
+}).catch(() => process.exit(1));
diff --git a/assets/script/build.site.js b/assets/script/build.site.js
new file mode 100644
index 0000000..fe3cd79
--- /dev/null
+++ b/assets/script/build.site.js
@@ -0,0 +1,11 @@
+const esbuild = require('esbuild');
+const { stimulusPlugin } = require('esbuild-plugin-stimulus');
+
+esbuild.build({
+ entryPoints: ['site.js'],
+ bundle: true,
+ outfile: '../priv/static/assets/site.js',
+ minify: true,
+ sourcemap: false,
+ plugins: [stimulusPlugin()],
+}).catch(() => process.exit(1));
diff --git a/assets/script/check-freshness b/assets/script/check-freshness
new file mode 100755
index 0000000..8971238
--- /dev/null
+++ b/assets/script/check-freshness
@@ -0,0 +1,4 @@
+#!/usr/bin/env sh
+
+make -q
+exit $?
diff --git a/assets/script/watch.site.js b/assets/script/watch.site.js
new file mode 100644
index 0000000..c7a3a3a
--- /dev/null
+++ b/assets/script/watch.site.js
@@ -0,0 +1,13 @@
+const esbuild = require('esbuild');
+const { stimulusPlugin } = require('esbuild-plugin-stimulus');
+//site.js --bundle --sourcemap=inline --watch --outfile=assets/site.js
+
+esbuild.build({
+ entryPoints: ['site.js'],
+ bundle: true,
+ outfile: 'assets/site.js',
+ minify: true,
+ sourcemap: "inline",
+ watch: true,
+ plugins: [stimulusPlugin()],
+}).catch(() => process.exit(1));