Sha256: 984e15d6d9109a8f5d7791593a4036469a3b2ce81247b73dcf6dae54298d0c62

Contents?: true

Size: 1.41 KB

Versions: 3

Compression:

Stored size: 1.41 KB

Contents

run 'bundle install'

system "yarn add materialize-css jquery moment"

insert_into_file "#{@project_path}/app/assets/stylesheets/application.css",
before: "\n *= require_tree ." do <<-TXT

*= require materialize-css/dist/css/materialize
TXT
end

insert_into_file "#{@project_path}/app/assets/javascripts/application.js",
before: "\n//= require_tree ." do <<-TXT

//= require materialize-css/dist/js/materialize
//= require moment/min/moment-with-locales
TXT
end

insert_into_file "#{@project_path}/app/javascript/packs/application.js",
                 after: "console.log('Hello World from Webpacker')" do <<-JS
                 
import jQuery from 'jquery'
window.jQuery = jQuery

let ready;
ready = function() {
  $(".datepicker").datetimepicker({locale: 'cs', format: 'D. M. YYYY'});
};
// Fire javascript after turbolinks event
$(document).on('turbolinks:load', ready);
JS
end

insert_into_file "#{@project_path}/config/webpack/shared.js",
                 after: "new ManifestPlugin({ fileName: paths.manifest, publicPath, writeToFileEmit: true })
  ]," do <<-JS

  resolve: {
    alias: {
      jquery: "jquery/src/jquery"
    }
  },
JS
end

insert_into_file "#{@project_path}/config/webpack/shared.js",
                 after: "new ExtractTextPlugin(env.NODE_ENV === 'production' ? '[name]-[hash].css' : '[name].css')," do <<-JS

  new webpack.ProvidePlugin({
    $: 'jquery',
    jQuery: 'jquery',
    jquery: 'jquery'
  }),
JS
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
r5-0.4.0.2 lib/r5/recipes/materialize.rb
r5-0.4.0.1 lib/r5/recipes/materialize.rb
r5-0.4.0.0 lib/r5/recipes/materialize.rb