|
| 1 | +const Command = require('ember-cli/lib/models/command'); |
| 2 | +const win = require('ember-cli/lib/utilities/windows-admin'); |
| 3 | + |
| 4 | +// const Build = require('../tasks/build'); |
| 5 | +// const BuildWatch = require('../tasks/build-watch'); |
| 6 | + |
| 7 | +const WebpackBuild = require('../tasks/build-webpack'); |
| 8 | +const WebpackBuildWatch = require('../tasks/build-webpack-watch'); |
| 9 | + |
| 10 | +interface BuildOptions { |
| 11 | + environment?: string; |
| 12 | + outputPath?: string; |
| 13 | + watch?: boolean; |
| 14 | + watcher?: string; |
| 15 | + supressSizes: boolean; |
| 16 | +} |
| 17 | + |
| 18 | +module.exports = Command.extend({ |
| 19 | + name: 'build', |
| 20 | + description: 'Builds your app and places it into the output path (dist/ by default).', |
| 21 | + aliases: ['b'], |
| 22 | + |
| 23 | + availableOptions: [ |
| 24 | + { name: 'environment', type: String, default: 'development', aliases: ['e', { 'dev': 'development' }, { 'prod': 'production' }] }, |
| 25 | + { name: 'output-path', type: 'Path', default: 'dist/', aliases: ['o'] }, |
| 26 | + { name: 'watch', type: Boolean, default: false, aliases: ['w'] }, |
| 27 | + { name: 'watcher', type: String }, |
| 28 | + { name: 'suppress-sizes', type: Boolean, default: false }, |
| 29 | + |
| 30 | + // Experimental webpack build for material team |
| 31 | + { name: 'm2', type: Boolean, default: false} |
| 32 | + ], |
| 33 | + |
| 34 | + run: function(commandOptions: BuildOptions) { |
| 35 | + |
| 36 | + let buildTask = commandOptions.watch ? |
| 37 | + new WebpackBuildWatch() : |
| 38 | + new WebpackBuild(); |
| 39 | + |
| 40 | + console.log(buildTask); |
| 41 | + |
| 42 | + return buildTask.run(commandOptions); |
| 43 | + } |
| 44 | +}); |
| 45 | + |
| 46 | +module.exports.overrideCore = true; |
0 commit comments