Merge pull request #46 from dod-ccpo/asset-precompilation
Compile assets to versioned file for production
This commit is contained in:
commit
bee2217269
16
atst/assets.py
Normal file
16
atst/assets.py
Normal file
@ -0,0 +1,16 @@
|
||||
from webassets import Environment, Bundle
|
||||
from atst.home import home
|
||||
|
||||
environment = Environment(
|
||||
directory=home.child("scss"),
|
||||
url="/static"
|
||||
)
|
||||
|
||||
css = Bundle(
|
||||
"atat.scss",
|
||||
filters="scss",
|
||||
output="../static/assets/out.%(version)s.css",
|
||||
depends=("**/*.scss"),
|
||||
)
|
||||
|
||||
environment.register("css", css)
|
@ -1,18 +1,8 @@
|
||||
from webassets import Environment, Bundle
|
||||
import tornado.web
|
||||
from atst.home import home
|
||||
from atst.assets import environment
|
||||
from atst.sessions import SessionNotFoundError
|
||||
|
||||
assets = Environment(directory=home.child("scss"), url="/static")
|
||||
css = Bundle(
|
||||
"atat.scss",
|
||||
filters="scss",
|
||||
output="../static/assets/out.css",
|
||||
depends=("**/*.scss"),
|
||||
)
|
||||
|
||||
assets.register("css", css)
|
||||
helpers = {"assets": assets}
|
||||
helpers = {"assets": environment}
|
||||
|
||||
|
||||
class BaseHandler(tornado.web.RequestHandler):
|
||||
|
@ -1,5 +1,8 @@
|
||||
#!/bin/bash
|
||||
|
||||
# script/bootstrap: Resolve all dependencies that the application requires to
|
||||
# run.
|
||||
|
||||
# If a command fails, exit the script
|
||||
set -e
|
||||
|
||||
@ -13,3 +16,6 @@ pipenv install --dev
|
||||
|
||||
# Install uswds node module and dependencies
|
||||
npm install
|
||||
|
||||
# Precompile assets for deployment
|
||||
pipenv run webassets -m atst.assets build
|
||||
|
@ -1,5 +1,8 @@
|
||||
#!/bin/bash
|
||||
|
||||
# script/setup: Set up application for the first time after cloning, or set it
|
||||
# back to the initial first unused state.
|
||||
|
||||
# If a command fails, exit the script
|
||||
set -e
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user