source_maps_fixer 0.1.1 → 0.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +43 -7
- data/lib/source_maps_fixer/version.rb +1 -1
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3f8a799250de34712f393366d9737137672e97317db20694c70a8cfb06c28b64
|
4
|
+
data.tar.gz: c9703f2a6da5e687b74a05b4a0e6eaca88cff37aa8a7400c9c92a2a3c3741ca4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f3e5a493894dd9e5641b93e7221163de5047c8169ed5d04fe0b27b3497a43e98631c65f36eec23f2e7f29726650fa26e71816525f2be40cc2ba33112515180b4
|
7
|
+
data.tar.gz: 10713cc11917307ce5cf28611ab5624617a57677a4aa0c9233e5f5565aa8d3c62e4c7c6957a066ec740a773c3d367a00515af0604dc03a4d572083878fe83e37
|
data/README.md
CHANGED
@@ -1,10 +1,40 @@
|
|
1
1
|
# SourceMapsFixer
|
2
|
-
Short description and motivation.
|
3
2
|
|
4
|
-
|
5
|
-
|
3
|
+
SourceMapsFixer is a set of [Rake](https://ruby.github.io/rake/) tasks for fixing **sourceMappingURL**s.
|
4
|
+
It is useful in [Rails](https://rubyonrails.org) apps if you like to have your main front-end code separated in `frontend` directory, for example. But you also use [Sprockets](https://github.com/rails/sprockets-rails) to process additional assets and compile them to `public/assets`. Fingerprints are added to asset filenames during compilation, by default. It is useful in conjunction with far-future headers.
|
5
|
+
|
6
|
+
Common setup looks like this:
|
7
|
+
|
8
|
+
Module bundler like [webpack](https://webpack.js.org) outputs bundles to `app/assets/bundles`, for example. By running `bin/rails assets:precompile` _Sprockets_ compiles all assets to `public/assets`
|
9
|
+
|
10
|
+
### Problem
|
11
|
+
|
12
|
+
When _webpack_ produces bundles to `app/assets/bundles`, each contains **sourceMappingURL** at the bottom (if configured). This URL links to the corresponding source map.
|
13
|
+
But when _Sprockets_ compile assets to `public/assets`, fingerprints are added to all asset filenames.
|
14
|
+
**sourceMappingURL**s are intact which makes them pointing to invalid files without fingerprints.
|
15
|
+
|
16
|
+
### Solution
|
17
|
+
|
18
|
+
_SourceMapsFixer_ fixes **sourceMappingURL**s inside bundles.
|
19
|
+
|
20
|
+
|
21
|
+
## 🎮 Usage
|
22
|
+
|
23
|
+
Instead of running
|
24
|
+
|
25
|
+
```bash
|
26
|
+
$ bin/rails assets:precompile
|
27
|
+
```
|
28
|
+
|
29
|
+
run
|
30
|
+
|
31
|
+
```bash
|
32
|
+
$ bin/rails assets:prepare
|
33
|
+
```
|
34
|
+
|
35
|
+
|
36
|
+
## 📥 Installation
|
6
37
|
|
7
|
-
## Installation
|
8
38
|
Add this line to your application's Gemfile:
|
9
39
|
|
10
40
|
```ruby
|
@@ -21,8 +51,14 @@ Or install it yourself as:
|
|
21
51
|
$ gem install source_maps_fixer
|
22
52
|
```
|
23
53
|
|
24
|
-
## Contributing
|
25
|
-
Contribution directions go here.
|
26
54
|
|
27
|
-
## License
|
55
|
+
## 📜 License
|
28
56
|
The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
|
57
|
+
|
58
|
+
|
59
|
+
## 👨🏭 Author
|
60
|
+
Zbigniew Humeniuk from [Art of Code](https://artofcode.co)
|
61
|
+
|
62
|
+
|
63
|
+
## 👀 See also
|
64
|
+
If you want to make your life easier in other areas of web app development, I strongly recommend you to take a look at my other project called [Loco framework](http://locoframework.org) 🙂. It is quite powerful and makes a front-end <-> back-end communication a breeze (among other things).
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: source_maps_fixer
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Zbigniew Humeniuk
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-
|
11
|
+
date: 2019-08-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -19,7 +19,7 @@ dependencies:
|
|
19
19
|
version: '5.0'
|
20
20
|
- - "<"
|
21
21
|
- !ruby/object:Gem::Version
|
22
|
-
version: '
|
22
|
+
version: '7.0'
|
23
23
|
type: :runtime
|
24
24
|
prerelease: false
|
25
25
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -29,7 +29,7 @@ dependencies:
|
|
29
29
|
version: '5.0'
|
30
30
|
- - "<"
|
31
31
|
- !ruby/object:Gem::Version
|
32
|
-
version: '
|
32
|
+
version: '7.0'
|
33
33
|
description: Rake tasks that fix sourceMappingURL in JavaScript and CSS bundles generated
|
34
34
|
by webpack to match the final fingerprinted names generated by Sprockets after assets'
|
35
35
|
precompilation
|
@@ -66,7 +66,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
66
66
|
- !ruby/object:Gem::Version
|
67
67
|
version: '0'
|
68
68
|
requirements: []
|
69
|
-
rubygems_version: 3.0.
|
69
|
+
rubygems_version: 3.0.3
|
70
70
|
signing_key:
|
71
71
|
specification_version: 4
|
72
72
|
summary: Rake tasks for fixing URLs to source maps
|