`embark eject-webpack` command
This commit is contained in:
parent
35f92f2ae8
commit
2670476d5e
10
cmd/cmd.js
10
cmd/cmd.js
|
@ -18,6 +18,7 @@ class Cmd {
|
|||
this.simulator();
|
||||
this.test();
|
||||
this.reset();
|
||||
this.ejectWebpack();
|
||||
this.graph();
|
||||
this.upload();
|
||||
this.versionCmd();
|
||||
|
@ -280,6 +281,15 @@ class Cmd {
|
|||
});
|
||||
}
|
||||
|
||||
ejectWebpack() {
|
||||
program
|
||||
.command('eject-webpack')
|
||||
.description(__('copy the default webpack config into your dapp for customization'))
|
||||
.action(function () {
|
||||
embark.ejectWebpack();
|
||||
});
|
||||
}
|
||||
|
||||
versionCmd() {
|
||||
program
|
||||
.command('version')
|
||||
|
|
|
@ -411,6 +411,22 @@ class EmbarkController {
|
|||
console.log(__("reset done!").green);
|
||||
}
|
||||
|
||||
ejectWebpack() {
|
||||
var fs = require('../lib/core/fs.js');
|
||||
var dappConfig = fs.dappPath('webpack.config.js');
|
||||
var embarkConfig = fs.embarkPath('webpack.config.js');
|
||||
if (fs.existsSync(dappConfig)) {
|
||||
console.error(`${dappConfig} ${__('already exists')}`.bold.red);
|
||||
console.error(__('not overwritten, rename or re/move the file and re-run this command').yellow);
|
||||
process.exit(1);
|
||||
} else {
|
||||
fs.copySync(embarkConfig, dappConfig);
|
||||
console.log(`${embarkConfig}`.green);
|
||||
console.log(__('copied to').dim.green);
|
||||
console.log(`${dappConfig}`.green);
|
||||
}
|
||||
}
|
||||
|
||||
upload(options) {
|
||||
this.context = options.context || [constants.contexts.upload, constants.contexts.build];
|
||||
|
||||
|
|
Loading…
Reference in New Issue