No commit activity in last 3 years
No release in over 3 years
compile webpack bundles in sprockets
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Runtime

 Project Readme

Sprockets Webpackit

This is a simple gem which will call webpack-cli to compile designated js files ( including dependent modules ) within the standard sprockets asset pipeline.

Installation

gem install sprockets-webpackit

requires node.js to be installed along with webpack, webpack-cli and any other node modules you require. ( eg coffeescript , truescript , etc )

npm install webpack webpack-cli --save-dev

create a webpack.config.js to control the compilation process.

tested with:

webpack:  version 4.44.1
node:     version 12.13.0

Configuration

require 'sprockets/webpackit'

Sprockets::Webpackit.pattern = /^*.js$/   # optional - override the default matcher
Sprockets::Webpackit.mode = 'production'  # optional - default is RACK_ENV or 'development'

map '/assets' do
   ...
end

Use

to process a file the name must match the given pattern. The default is a suffix of .webpack.js , .webpack.coffee etc.

eg: in your application.js

//= require application.webpack.coffee

you could also set the pattern to eg /.*/to accept all javascript files.