Paperclip works with Webpack 4 and 5. To get started, install these dependencies:
Next, in the same directory as
webpack.config.js, copy this content to
sourceDirectoryis where your
*.pcfiles go. More docs on this config can be found here.
Next, update your Webpack config to look something like this:
If you want to see an example of this, check out the Paperclip playground webpack.config.js
Paperclip requires that you use css-loader in order to work, and either the style-loader, or mini-css-extract-plugin to go with that. It's also recommended that you include url-loader or file-loader in your webpack config so that you can import images, and other assets into your Paperclip files.