mirror of
https://github.com/status-im/embark-area-51.git
synced 2025-02-17 09:46:37 +00:00
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.simulator();
|
||||||
this.test();
|
this.test();
|
||||||
this.reset();
|
this.reset();
|
||||||
|
this.ejectWebpack();
|
||||||
this.graph();
|
this.graph();
|
||||||
this.upload();
|
this.upload();
|
||||||
this.versionCmd();
|
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() {
|
versionCmd() {
|
||||||
program
|
program
|
||||||
.command('version')
|
.command('version')
|
||||||
|
@ -411,6 +411,22 @@ class EmbarkController {
|
|||||||
console.log(__("reset done!").green);
|
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) {
|
upload(options) {
|
||||||
this.context = options.context || [constants.contexts.upload, constants.contexts.build];
|
this.context = options.context || [constants.contexts.upload, constants.contexts.build];
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user