Enable Figwheel for background and sidebar scripts in dev build

This commit is contained in:
Jeremy Dormitzer 2018-02-16 11:56:54 -05:00
parent a3bc791a19
commit d39a36988c
No known key found for this signature in database
GPG Key ID: 04F17C0F5A32C320
4 changed files with 25 additions and 20 deletions

1
.gitignore vendored
View File

@ -13,3 +13,4 @@ pom.xml.asc
dist
ext
**/js/generated
figwheel_server.log

View File

@ -1,12 +1,13 @@
dev :
lein cljsbuild once
mkdir -p ext
cp -R resources/shared/* resources/dev/* ext/
lein cljsbuild once content
lein figwheel background sidebar
prod :
lein with-profile prod cljsbuild once
mkdir -p ext
cp -R resources/shared/* resources/prod/* ext/
lein with-profile prod cljsbuild once
rm -rf ext/js/generated/out-*
package : clean prod

View File

@ -28,43 +28,46 @@
{:cljsbuild
{:builds
{:background
{:compiler {:optimizations :none
:output-to "resources/dev/js/generated/background.js"
:output-dir "resources/dev/js/generated/out-background"
{:figwheel true
:compiler {:optimizations :none
:output-to "ext/js/generated/background.js"
:output-dir "ext/js/generated/out-background"
:asset-path "js/generated/out-background"
:pretty-print true
:source-map true}}
:content
{:compiler {:optimizations :whitespace
:output-to "resources/dev/js/generated/content.js"
:output-dir "resources/dev/js/generated/out-content"
:output-to "ext/js/generated/content.js"
:output-dir "ext/js/generated/out-content"
:pretty-print true
:source-map "resources/dev/js/generated/content.js.map"}}
:source-map "ext/js/generated/content.js.map"}}
:sidebar
{:compiler {:optimizations :none
:output-to "resources/dev/js/generated/sidebar.js"
:output-dir "resources/dev/js/generated/out-sidebar"
{:figwheel true
:compiler {:optimizations :none
:output-to "ext/js/generated/sidebar.js"
:output-dir "ext/js/generated/out-sidebar"
:asset-path "js/generated/out-sidebar"
:pretty-print true
:source-map true}}}}}]
:source-map true}}}}
:plugins [[lein-figwheel "0.5.14"]]}]
:prod [:cljs-shared
{:cljsbuild
{:builds
{:background
{:compiler {:optimizations :simple
:output-to "resources/prod/js/generated/background.js"
:output-dir "resources/prod/js/generated/out-background"
:output-to "ext/js/generated/background.js"
:output-dir "ext/js/generated/out-background"
:pretty-print false
:source-map false}}
:content
{:compiler {:optimizations :simple
:output-to "resources/prod/js/generated/content.js"
:output-dir "resources/prod/js/generated/out-content"
:output-to "ext/js/generated/content.js"
:output-dir "ext/js/generated/out-content"
:pretty-print false
:source-map false}}
:sidebar
{:compiler {:optimizations :simple
:output-to "resources/prod/js/generated/sidebar.js"
:output-dir "resources/prod/js/generated/out-sidebar"
:output-to "ext/js/generated/sidebar.js"
:output-dir "ext/js/generated/out-sidebar"
:pretty-print false
:source-map false}}}}}]})

View File

@ -25,7 +25,7 @@
]
}
],
"content_security_policy": "script-src 'self' 'unsafe-eval' 'sha256-CfMPE8ys/ylJ5D9qKG0a9/UejrcczMr4/EmFCbVbgcc=' 'sha256-XsBu2nEJnS7x/Izq1v7dzy3Ze5myJMHvg4zukh/R1Yk=' 'sha256-AUCho1UyOpYFSZDg8EM9SYlysRIrUpQKZ7iE9CFSYfU=' 'sha256-vLlTaRFN8A2FPadIx711FwK9Ytd6LXkAzuEYAdC0D1k='; object-src 'self'",
"content_security_policy": "script-src 'self' 'unsafe-eval' 'sha256-CfMPE8ys/ylJ5D9qKG0a9/UejrcczMr4/EmFCbVbgcc=' 'sha256-XsBu2nEJnS7x/Izq1v7dzy3Ze5myJMHvg4zukh/R1Yk=' 'sha256-AUCho1UyOpYFSZDg8EM9SYlysRIrUpQKZ7iE9CFSYfU=' 'sha256-vLlTaRFN8A2FPadIx711FwK9Ytd6LXkAzuEYAdC0D1k=' 'sha256-pGPwkltLPS11ByeZ61wzrzfELAOibrYCIFYF/TaXVdk='; object-src 'self'",
"permissions": ["tabs", "https://hn.algolia.com/*"],
"web_accessible_resources": ["sidebar.html", "js/*.map", "js/generated/*.map", "js/generated/out/*"]
}