README.md in jekyll-webpack-0.2.2 vs README.md in jekyll-webpack-0.2.3
- old
+ new
@@ -4,13 +4,11 @@
## Why?
This adds Webpack at a sane point in the build pipeline and will also allow you to parameterize your webpack and other JS config files by prepending them with front matter, before the compilation occurs. You can see a functioning example in the `spec/fixtures` folder:-
-There is a `_data/tailwind.yml` file in the fixure site that's picked up by adding a frontmatter declaration in `tailwind.config.js`. This Tailwind config is in turn picked up by the outputted webpack config and parsed when webpack runs.
-
## Installation
Add this line to your application's Gemfile:
```ruby
@@ -50,9 +48,31 @@
`yarn add webpack webpack-cli --dev`
And the basic JS entrypoint `mkdir src && touch src/index.js`
And you're away! Just run the `jekyll serve` or `jekyll build` commands with whatever env you need.
+
+### Configuring JS config files
+
+There is a `_data/tailwind.yml` file in the fixure site that's picked up by adding a frontmatter declaration in `tailwind.config.js`. This Tailwind config is in turn picked up by the outputted webpack config and parsed when webpack runs.
+
+### Cleanup
+If you wish to clean out unused source files after webpack has run that got included in the compiled site, you need to add an entry into your `_config.yml` like:
+
+``` yml
+// _config.yml
+
+webpack:
+ cleanup_files: src
+
+// or an array
+
+webpack:
+ cleanup_files:
+ - src
+ - node_modules
+```
+
## Development
After checking out the repo, run `bin/setup` to install dependencies. Then `cd spec/fixtures && yarn` to install required JS dependencies for specs. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.