-
-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathRakefile
32 lines (23 loc) · 786 Bytes
/
Rakefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
# frozen_string_literal: true
require "autoprefixer-rails"
require "bootstrap"
require "bundler/gem_tasks"
require "fileutils"
require "rspec/core/rake_task"
require "sassc"
require "structured_changelog/tasks"
RSpec::Core::RakeTask.new(:spec)
task default: :spec
task build: :assets
desc "Preprocess assets"
task :assets do
puts "Preprocessing SCSS and JS files"
puts "Copying over bootstrap"
FileUtils.cp_r Gem::Specification.find_by_name("bootstrap").gem_dir, "tmp"
sass = File.read(File.expand_path("./src/stylesheets/main.scss"))
css = SassC::Engine.new(sass, style: :compressed).render
prefixed = AutoprefixerRails.process(css)
File.write(File.expand_path("./app/assets/stylesheets/main.css"), prefixed)
npm_output = `npm run build`
puts npm_output
end