Class: Lanes::Command::Webpack
- Inherits:
-
Thor::Group
- Object
- Thor::Group
- Lanes::Command::Webpack
- Includes:
- Thor::Actions
- Defined in:
- lib/lanes/command/webpack.rb
Instance Attribute Summary collapse
-
#config ⇒ Object
Returns the value of attribute config.
-
#process ⇒ Object
readonly
Returns the value of attribute process.
-
#wpd_config ⇒ Object
readonly
Returns the value of attribute wpd_config.
Instance Method Summary collapse
Instance Attribute Details
#config ⇒ Object
Returns the value of attribute config.
14 15 16 |
# File 'lib/lanes/command/webpack.rb', line 14 def config @config end |
#process ⇒ Object (readonly)
Returns the value of attribute process.
12 13 14 |
# File 'lib/lanes/command/webpack.rb', line 12 def process @process end |
#wpd_config ⇒ Object (readonly)
Returns the value of attribute wpd_config.
16 17 18 |
# File 'lib/lanes/command/webpack.rb', line 16 def wpd_config @wpd_config end |
Instance Method Details
#configure ⇒ Object
27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 |
# File 'lib/lanes/command/webpack.rb', line 27 def configure @wpd_config = WebpackDriver::Configuration.new( config.extension_path.join('config', 'webpack.config.js'), cmd_line_flags: ['--hot', '--inline'], logger: Lanes.logger, directory: config.controlling_extension.root_path ) wpd_config.environment.merge!( EXTENSION_ID: config.controlling_extension.identifier, LANES_MODULES: config.module_paths.join(':'), ENTRY: 'show-maker/index.js', GENERATED_CONFIG_DIR: config.directory.to_s ) self end |
#make_config ⇒ Object
21 22 23 24 25 |
# File 'lib/lanes/command/webpack.rb', line 21 def make_config return if @config @config = ClientConfig.new config.invoke_all end |
#startup ⇒ Object
45 46 47 48 49 |
# File 'lib/lanes/command/webpack.rb', line 45 def startup @process = ::WebpackDriver::DevServer.new(wpd_config) @process.start @process.wait if [:wait] end |