This is a proposal to simplify our frontend workflow.
- Work on JS source code in
client/
folder. - Run
gulp watch
, which will:
- Compile Angular and Handlebars templates.
- Copy
client/**/*
topublic/client/app/,
so source + compiled templates can be served through Rails.
- No-pipe sets
client/app
as thebaseUrl
for RequireJS. - Third-party components are installed to
public/client/bower_components/
(seebower.json
).
- When a new component is installed via
bower
, add new entry to the application'srequire.config.js
.require.config({ ember: '../bower_components/ember' // The relative path from client/app as per no-pipe });
- Run
gulp release
, which concatenates, uglifies JS source, and writes them topublic/client-built/app
. - No-pipe is configured to serve from
client-built/app
instead ofclient/app
(whenRAILS_ENV=production
).
- Work on JS source code in
client/
folder. - Run
gulp watch
to compile Angular and Handlebars templates. - Mount the
client/
folder as a public folder instead. - No-pipe sets
client
as thebaseUrl
for RequireJS. - Install third-party components to
client/bower_components
.
- When new component is installed, add new entry to the application's
require.config.js
.require.config({ ember: 'bower_components/ember' });
- Run
gulp release
, which concatenates, uglifies JS source, and writes them topublic/client
.