webpack_native 0.5.2 → 0.5.6
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/lib/generators/webpack_native/dev_generator.rb +1 -0
- data/lib/generators/webpack_native/install_generator.rb +0 -0
- data/lib/generators/webpack_native/prod_generator.rb +0 -0
- data/lib/generators/webpack_native/templates/webpack_native/package.json +0 -0
- data/lib/generators/webpack_native/templates/webpack_native/src/javascripts/application.js +1 -0
- data/lib/generators/webpack_native/templates/webpack_native/src/stylesheets/application.scss +0 -0
- data/lib/generators/webpack_native/templates/webpack_native/webpack.config.js +22 -1
- data/lib/webpack_native/railtie.rb +4 -1
- data/lib/webpack_native/runner.rb +0 -0
- data/lib/webpack_native/version.rb +1 -1
- data/lib/webpack_native/webpack_native_helper.rb +11 -8
- data/lib/webpack_native.rb +0 -0
- metadata +3 -3
    
        checksums.yaml
    CHANGED
    
    | @@ -1,7 +1,7 @@ | |
| 1 1 | 
             
            ---
         | 
| 2 2 | 
             
            SHA256:
         | 
| 3 | 
            -
              metadata.gz:  | 
| 4 | 
            -
              data.tar.gz:  | 
| 3 | 
            +
              metadata.gz: 7b93ddd0722f2ab122f7bb3b1b4fe6cc344c4116b49dd4e6a019cf29521261b6
         | 
| 4 | 
            +
              data.tar.gz: fe3a8b69f0a30afc3efbf0d1d80a896347c428a399f5a60da8d6c19a0bd24a32
         | 
| 5 5 | 
             
            SHA512:
         | 
| 6 | 
            -
              metadata.gz:  | 
| 7 | 
            -
              data.tar.gz:  | 
| 6 | 
            +
              metadata.gz: 4770127594190d0ccf690f9750bfa711f912ffe028d876dab6db23ffb154fa25a80d4357f5a6b2d343564eceb0454173f3fdcdda6fa03e500e334d926cbad805
         | 
| 7 | 
            +
              data.tar.gz: eadd74a3f7dd00170d2f66d05a9964baeb5219df5f09e12974d380600c688128b9531d8a6c8eddd9ebf1d5f56c0c8af46733108be4730dd38f915139a14857cd
         | 
| @@ -7,6 +7,7 @@ class WebpackNative::DevGenerator < Rails::Generators::Base | |
| 7 7 | 
             
                Mutex.new.synchronize do
         | 
| 8 8 | 
             
                  Dir.chdir "#{Rails.root}/app/webpack_native" do
         | 
| 9 9 | 
             
                    Dir.mkdir('src/images') unless Dir.exist?('src/images')
         | 
| 10 | 
            +
                    Dir.mkdir('src/favicons') unless Dir.exist?('src/favicons')
         | 
| 10 11 | 
             
                    %x{ yarn install }
         | 
| 11 12 | 
             
                    result = %x{ npm run build:dev }
         | 
| 12 13 | 
             
                    puts "\n"
         | 
| 
            File without changes
         | 
| 
            File without changes
         | 
| 
            File without changes
         | 
| @@ -2,6 +2,7 @@ | |
| 2 2 | 
             
            import '../stylesheets/application.scss';
         | 
| 3 3 | 
             
            // the following line requires that images folder exists
         | 
| 4 4 | 
             
            require.context('../images', true, /\.(gif|jpeg|jpg|png|svg)$/i);
         | 
| 5 | 
            +
            require.context('../favicons', true);
         | 
| 5 6 |  | 
| 6 7 | 
             
            require("@rails/ujs").start();
         | 
| 7 8 | 
             
            require("turbolinks").start();
         | 
    
        data/lib/generators/webpack_native/templates/webpack_native/src/stylesheets/application.scss
    CHANGED
    
    | 
            File without changes
         | 
| @@ -57,7 +57,10 @@ module.exports = (env, options) => { | |
| 57 57 | 
             
                      ],
         | 
| 58 58 | 
             
                    },
         | 
| 59 59 | 
             
                    {
         | 
| 60 | 
            -
                      test: /\.(png|jpg|jpeg|gif|svg|ttf|woff2|woff|eot | 
| 60 | 
            +
                      test: /\.(png|jpg|jpeg|gif|svg|ttf|woff2|woff|eot)$/i,
         | 
| 61 | 
            +
                      exclude: [
         | 
| 62 | 
            +
                        path.resolve(__dirname, "src/favicons")
         | 
| 63 | 
            +
                      ],
         | 
| 61 64 | 
             
                      use: [
         | 
| 62 65 | 
             
                        {
         | 
| 63 66 | 
             
                          loader: 'url-loader',
         | 
| @@ -68,6 +71,24 @@ module.exports = (env, options) => { | |
| 68 71 | 
             
                        },
         | 
| 69 72 | 
             
                        // { loader: 'image-webpack-loader' }
         | 
| 70 73 | 
             
                      ],
         | 
| 74 | 
            +
                    },
         | 
| 75 | 
            +
                    {
         | 
| 76 | 
            +
                      test: /\.(png|jpg|jpeg|svg|ttf|ico|webmanifest)$/i,
         | 
| 77 | 
            +
                      exclude: [
         | 
| 78 | 
            +
                        path.resolve(__dirname, "src/images"),
         | 
| 79 | 
            +
                        path.resolve(__dirname, 'node_modules')
         | 
| 80 | 
            +
                      ],
         | 
| 81 | 
            +
                      use: [
         | 
| 82 | 
            +
                        {
         | 
| 83 | 
            +
                          loader: 'url-loader',
         | 
| 84 | 
            +
                          options: {
         | 
| 85 | 
            +
                            limit: false, //8192,
         | 
| 86 | 
            +
                            name: '[name].[ext]',
         | 
| 87 | 
            +
                            outputPath: '../../public'
         | 
| 88 | 
            +
                          },
         | 
| 89 | 
            +
                        },
         | 
| 90 | 
            +
                        // { loader: 'image-webpack-loader' }
         | 
| 91 | 
            +
                      ],
         | 
| 71 92 | 
             
                    }
         | 
| 72 93 | 
             
                  ]
         | 
| 73 94 | 
             
                },
         | 
| @@ -56,7 +56,10 @@ class WebpackNative::Railtie < ::Rails::Railtie | |
| 56 56 | 
             
              initializer "run_webpack_build_cmd" do
         | 
| 57 57 | 
             
                config.after_initialize do
         | 
| 58 58 | 
             
                  if defined?(Rails::Server) && Rails.env.development?
         | 
| 59 | 
            -
                     | 
| 59 | 
            +
                    # starting this in new thread is causing bug in ruby 3.0.2
         | 
| 60 | 
            +
                    # conflicting chdir during another chdir block
         | 
| 61 | 
            +
                    #Thread.new { start_webpack }
         | 
| 62 | 
            +
                    fork { start_webpack }
         | 
| 60 63 | 
             
                  end
         | 
| 61 64 | 
             
                end
         | 
| 62 65 | 
             
              end
         | 
| 
            File without changes
         | 
| @@ -5,7 +5,9 @@ module WebpackNative::WebpackNativeHelper | |
| 5 5 | 
             
                  href: webpack_stylesheet_path(asset),
         | 
| 6 6 | 
             
                  rel: "stylesheet"
         | 
| 7 7 | 
             
                )
         | 
| 8 | 
            -
                tag.link( | 
| 8 | 
            +
                #tag.link is not working correctly on (Rails 6.1.4.1 + ruby3)
         | 
| 9 | 
            +
                #tag.link(html_options).html_safe
         | 
| 10 | 
            +
                content_tag("link".freeze, nil, html_options).html_safe
         | 
| 9 11 | 
             
              end
         | 
| 10 12 |  | 
| 11 13 | 
             
              def webpack_stylesheet_path(asset, **options)
         | 
| @@ -50,10 +52,10 @@ module WebpackNative::WebpackNativeHelper | |
| 50 52 | 
             
              # <%= webpack_webmanifest('manifest.webmanifest') %>
         | 
| 51 53 |  | 
| 52 54 | 
             
              # result:
         | 
| 53 | 
            -
              #<link rel="apple-touch-icon" sizes="180x180" href="/ | 
| 54 | 
            -
              #<link rel="icon" type="image/png" sizes="32x32" href="/ | 
| 55 | 
            -
              #<link rel="icon" type="image/png" sizes="16x16" href="/ | 
| 56 | 
            -
              #<link rel="manifest" href="/ | 
| 55 | 
            +
              #<link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon.png">
         | 
| 56 | 
            +
              #<link rel="icon" type="image/png" sizes="32x32" href="/favicon-32x32.png">
         | 
| 57 | 
            +
              #<link rel="icon" type="image/png" sizes="16x16" href="/favicon-16x16.png">
         | 
| 58 | 
            +
              #<link rel="manifest" href="/site.webmanifest">
         | 
| 57 59 |  | 
| 58 60 | 
             
              def webpack_favicons(*args)
         | 
| 59 61 | 
             
                tags = []
         | 
| @@ -66,7 +68,7 @@ module WebpackNative::WebpackNativeHelper | |
| 66 68 | 
             
                    manifest = favicon
         | 
| 67 69 | 
             
                    html_options = {
         | 
| 68 70 | 
             
                      rel: 'manifest',
         | 
| 69 | 
            -
                      href:  | 
| 71 | 
            +
                      href: "/#{manifest}"
         | 
| 70 72 | 
             
                    }
         | 
| 71 73 |  | 
| 72 74 | 
             
                  else
         | 
| @@ -83,7 +85,7 @@ module WebpackNative::WebpackNativeHelper | |
| 83 85 | 
             
                    html_options = {
         | 
| 84 86 | 
             
                      rel: filename == 'apple-touch-icon' ? 'apple-touch-icon' : 'icon',
         | 
| 85 87 | 
             
                      type: mimetypes[ext],
         | 
| 86 | 
            -
                      href:  | 
| 88 | 
            +
                      href: "/#{favicon}"
         | 
| 87 89 | 
             
                    }
         | 
| 88 90 |  | 
| 89 91 | 
             
                    sizes = filename[/(.+)?([0-9]{2,3}x[0-9]{2,3})(.+)?/, 2]
         | 
| @@ -94,7 +96,8 @@ module WebpackNative::WebpackNativeHelper | |
| 94 96 |  | 
| 95 97 | 
             
                  end
         | 
| 96 98 |  | 
| 97 | 
            -
                  tags << tag.link(html_options)
         | 
| 99 | 
            +
                  # tags << tag.link(html_options)
         | 
| 100 | 
            +
                  tags << content_tag("link".freeze, nil, html_options)
         | 
| 98 101 |  | 
| 99 102 | 
             
                end
         | 
| 100 103 |  | 
    
        data/lib/webpack_native.rb
    CHANGED
    
    | 
            File without changes
         | 
    
        metadata
    CHANGED
    
    | @@ -1,14 +1,14 @@ | |
| 1 1 | 
             
            --- !ruby/object:Gem::Specification
         | 
| 2 2 | 
             
            name: webpack_native
         | 
| 3 3 | 
             
            version: !ruby/object:Gem::Version
         | 
| 4 | 
            -
              version: 0.5. | 
| 4 | 
            +
              version: 0.5.6
         | 
| 5 5 | 
             
            platform: ruby
         | 
| 6 6 | 
             
            authors:
         | 
| 7 7 | 
             
            - scratchoo
         | 
| 8 8 | 
             
            autorequire: 
         | 
| 9 9 | 
             
            bindir: bin
         | 
| 10 10 | 
             
            cert_chain: []
         | 
| 11 | 
            -
            date: 2021- | 
| 11 | 
            +
            date: 2021-10-27 00:00:00.000000000 Z
         | 
| 12 12 | 
             
            dependencies: []
         | 
| 13 13 | 
             
            description: Use vanilla webpack to manage your assets efficiently, no webpacker or
         | 
| 14 14 | 
             
              asset pipeline anymore!
         | 
| @@ -49,7 +49,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement | |
| 49 49 | 
             
                - !ruby/object:Gem::Version
         | 
| 50 50 | 
             
                  version: '0'
         | 
| 51 51 | 
             
            requirements: []
         | 
| 52 | 
            -
            rubygems_version: 3. | 
| 52 | 
            +
            rubygems_version: 3.2.22
         | 
| 53 53 | 
             
            signing_key: 
         | 
| 54 54 | 
             
            specification_version: 4
         | 
| 55 55 | 
             
            summary: Vanilla Webpack For Rails Applications
         |