class Lanes::Command::Webpack

Attributes

config[RW]
process[R]
wpd_config[R]

Public Instance Methods

configure() click to toggle source
# 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() click to toggle source
# File lib/lanes/command/webpack.rb, line 21
def make_config
    return if @config
    @config = ClientConfig.new
    config.invoke_all
end
startup() click to toggle source
# File lib/lanes/command/webpack.rb, line 45
def startup
    @process = ::WebpackDriver::DevServer.new(wpd_config)
    @process.start
    @process.wait if options[:wait]
end