webpack_driver 0.2.0 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +1 -1
- data/README.md +24 -16
- data/Rakefile +8 -0
- data/lib/webpack_driver/configuration.rb +2 -0
- data/lib/webpack_driver/process.rb +0 -2
- data/lib/webpack_driver/version.rb +1 -1
- data/webpack_driver.gemspec +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 44ba342eead35d1724a2bca92475e051e606bdcc
|
4
|
+
data.tar.gz: 01bf6577333fd5b749a815812ed840d000cca105
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e1fe4ad83a82af9fdc95258a0f22575bb2841f26c0ce4edf0caf8d71e8a79827f84467da153e0e45294b9c675b0b7e180252a06c85f215261f790227f5f0a63f
|
7
|
+
data.tar.gz: 40356b5bab34e82640968b84048a3b25a023f923eed7268c9ea697bf52b144a301053b65d2d9fa70c1e01b0e415bdac99abe4b44549cf51b95c7205e5557c2d9
|
data/Gemfile
CHANGED
data/README.md
CHANGED
@@ -29,30 +29,38 @@ Or install it yourself as:
|
|
29
29
|
Initialization will create a `package.json`, `yarn.lock`, a bare-bones `webpack.config.js` and then run yarn install (via the [Knitter](https://github.com/nathanstitt/knitter) gem).
|
30
30
|
|
31
31
|
```ruby
|
32
|
-
|
33
|
-
config = WebpackDriver::Configuration.new(
|
34
|
-
WebpackDriver::Configuration.new('/path/to/my/webpack.config.js')
|
35
|
-
)
|
32
|
+
config = WebpackDriver::Configuration.new('/path/to/my/webpack.config.js')
|
36
33
|
config.generate!
|
37
34
|
```
|
38
35
|
|
39
|
-
Production compilation
|
36
|
+
Production compilation:
|
40
37
|
```ruby
|
41
|
-
|
42
|
-
compiler.
|
43
|
-
|
38
|
+
config = WebpackDriver::Configuration.new('/path/to/my/webpack.config.js')
|
39
|
+
compiler = WebpackDriver::Compile.new(config)
|
40
|
+
compiler.start
|
41
|
+
sleep 1 while compiler.alive?
|
42
|
+
p compiler.assets
|
44
43
|
```
|
45
44
|
|
46
45
|
Dev server:
|
47
|
-
|
48
46
|
```ruby
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
47
|
+
config = WebpackDriver::Configuration.new('/path/to/my/webpack.config.js', {
|
48
|
+
port: 8333
|
49
|
+
})
|
50
|
+
server = WebpackDriver::DevServer.new(config)
|
51
|
+
server.start
|
52
|
+
fail("failed to start webpack #{server.output}") unless server.alive?
|
53
|
+
|
54
|
+
# wait for server to compile startup assets
|
55
|
+
sleep 1 until server.valid?
|
56
|
+
|
57
|
+
puts "Webpack dev server running on port #{server.port} url=#{server.url}"
|
58
|
+
|
59
|
+
p server.assets.map{|asset| asset.file }
|
60
|
+
sleep 30 # do other stuff
|
61
|
+
server.stop
|
62
|
+
fail("failed to stop webpack #{server.output}") if server.alive?
|
63
|
+
|
56
64
|
```
|
57
65
|
|
58
66
|
|
data/Rakefile
CHANGED
data/webpack_driver.gemspec
CHANGED
@@ -30,7 +30,7 @@ Gem::Specification.new do |spec|
|
|
30
30
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
31
31
|
spec.require_paths = ["lib"]
|
32
32
|
|
33
|
-
spec.add_dependency 'knitter', '~> 0.
|
33
|
+
spec.add_dependency 'knitter', '~> 0.2.0'
|
34
34
|
spec.add_dependency 'thor', '~> 0.19'
|
35
35
|
spec.add_dependency 'concurrent-ruby', '~> 1.0.4'
|
36
36
|
spec.add_dependency 'childprocess', '~> 0.5'
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: webpack_driver
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nathan Stitt
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 0.
|
19
|
+
version: 0.2.0
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: 0.
|
26
|
+
version: 0.2.0
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: thor
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|