-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
/
index.js
37 lines (30 loc) · 1.13 KB
/
index.js
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
/**
* Alpine CSP Build.
*
* Alpine allows you to use JavaScript directly inside your HTML. This is an
* incredibly powerful features. However, it violates the "unsafe-eval"
* Content Security Policy. This alternate Alpine build provides a
* more constrained API for Alpine that is also CSP-friendly...
*/
import Alpine from 'alpinejs/src/alpine'
/**
* _______________________________________________________
* The Evaluator
* -------------------------------------------------------
*
* By default, Alpine's evaluator "eval"-like utilties to
* interpret strings as runtime JS. We're going to use
* a more CSP-friendly evaluator for this instead.
*/
import { cspEvaluator } from './evaluator'
Alpine.setEvaluator(cspEvaluator)
/**
* The rest of this file bootstraps Alpine the way it is
* normally bootstrapped in the default build. We will
* set and define it's directives, magics, etc...
*/
import { reactive, effect, stop, toRaw } from '@vue/reactivity'
Alpine.setReactivityEngine({ reactive, effect, release: stop, raw: toRaw })
import 'alpinejs/src/magics/index'
import 'alpinejs/src/directives/index'
export default Alpine