forked from phc/website
Aggiunte tante cose relative al profilo utente
This commit is contained in:
+4
-8
@@ -1,14 +1,10 @@
|
||||
|
||||
JS_SOURCES = src/utenti.js
|
||||
JS_BUNDLES = $(patsubst src/%.js, dist/%.min.js, $(JS_SOURCES))
|
||||
JS_SOURCES = src/utenti.js src/profilo.js
|
||||
|
||||
.PHONY: all
|
||||
all: $(JS_BUNDLES)
|
||||
|
||||
dist/%.min.js: src/%.js
|
||||
rollup -c rollup.config.js $<
|
||||
all: $(JS_SOURCES)
|
||||
rollup -c
|
||||
|
||||
.PHONY: debug
|
||||
debug:
|
||||
@echo "JS_SOURCES = $(JS_SOURCES)"
|
||||
@echo "JS_BUNDLES = $(JS_BUNDLES)"
|
||||
@echo "JS_SOURCES = $(JS_SOURCES)"
|
||||
@@ -1,6 +1,4 @@
|
||||
import { defineConfig } from 'rollup'
|
||||
|
||||
// import resolve from '@rollup/plugin-node-resolve'
|
||||
import { terser } from 'rollup-plugin-terser'
|
||||
|
||||
export default defineConfig([
|
||||
@@ -16,9 +14,18 @@ export default defineConfig([
|
||||
'fuse.js': 'Fuse',
|
||||
},
|
||||
},
|
||||
plugins: [
|
||||
// resolve(),
|
||||
terser(),
|
||||
],
|
||||
plugins: [terser()],
|
||||
},
|
||||
{
|
||||
input: 'src/profilo.js',
|
||||
external: ['alpinejs'],
|
||||
output: {
|
||||
file: 'dist/profilo.min.js',
|
||||
format: 'iife',
|
||||
globals: {
|
||||
alpinejs: 'Alpine',
|
||||
},
|
||||
},
|
||||
plugins: [terser()],
|
||||
},
|
||||
])
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
import Alpine from 'alpinejs'
|
||||
|
||||
Alpine.data('profilo', () => ({
|
||||
init() {
|
||||
console.log('Profilo!')
|
||||
},
|
||||
}))
|
||||
|
||||
Alpine.data('passwordForm', () => ({
|
||||
password: '',
|
||||
passwordAgain: '',
|
||||
passwordSame: true,
|
||||
onUpdate() {
|
||||
this.passwordSame = this.password === this.passwordAgain
|
||||
},
|
||||
}))
|
||||
Reference in New Issue
Block a user