finalize design package
This commit is contained in:
@@ -37,20 +37,39 @@ gulp.task('compile_react_templates', function() {
|
||||
|
||||
// right now, build only available for design.
|
||||
gulp.task('build', function(done) {
|
||||
var config, env;
|
||||
var config, env,
|
||||
gulpCopy = require('gulp-copy');
|
||||
|
||||
if (yargs.argv.design){
|
||||
process.env.NODE_ENV = process.env.NODE_ENV || 'design';
|
||||
} else {
|
||||
throw new gutil.PluginError("webpack", "Must include '--production' or '--design' option.");
|
||||
}
|
||||
config = require(`${__dirname}/client/config/webpack.js`);
|
||||
config = require(`${__dirname}/client/config/${process.env.NODE_ENV}/webpack.js`);
|
||||
// run webpack
|
||||
webpack(config, function(err, stats) {
|
||||
if(err) throw new gutil.PluginError("webpack", err);
|
||||
gutil.log("[webpack]", stats.toString({
|
||||
// output options
|
||||
}));
|
||||
if (yargs.argv.design){
|
||||
gulp.src([
|
||||
`client/app.scss`
|
||||
]).pipe(gulpCopy(`client/build/design/dashboard`, {prefix: 1}));
|
||||
gulp.src([
|
||||
`client/dashboard/layout/layout.rt`,
|
||||
`client/dashboard/layout/layout.scss`,
|
||||
]).pipe(gulpCopy(`client/build/design/dashboard/layout`, {prefix: 3}));
|
||||
gulp.src([
|
||||
`client/dashboard/energy/energy.rt`,
|
||||
`client/dashboard/energy/energy.scss`,
|
||||
]).pipe(gulpCopy(`client/build/design/dashboard/energy`, {prefix: 3}));
|
||||
gulp.src([
|
||||
`client/dashboard/power/power.rt`,
|
||||
`client/dashboard/power/power.scss`,
|
||||
]).pipe(gulpCopy(`client/build/design/dashboard/power`, {prefix: 3}));
|
||||
}
|
||||
|
||||
done();
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user