From 1dc32b1b026262f361c1f61d5227b169dd0986fd Mon Sep 17 00:00:00 2001 From: Gerry Date: Tue, 22 Mar 2016 22:54:07 +1100 Subject: [PATCH] Adding coffee-script to the installed modules The coffee-loader module requires coffee-script. --- source/posts/2015/2015-01-15-how-to-use-webpack-with-rails.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/posts/2015/2015-01-15-how-to-use-webpack-with-rails.md b/source/posts/2015/2015-01-15-how-to-use-webpack-with-rails.md index 7121e30..d4d98b8 100644 --- a/source/posts/2015/2015-01-15-how-to-use-webpack-with-rails.md +++ b/source/posts/2015/2015-01-15-how-to-use-webpack-with-rails.md @@ -352,9 +352,9 @@ Now your 'virtual' source files will appear under the `domain > assets` director We can use a loader to automatically transpile modules written in CoffeeScript or similar. As with the `expose` loader (explained above), this can be done inside the `require` statement, but it's far nicer to add this loader to the webpack config so we can then require CoffeeScript modules as though they were ordinary JS. -First, install and add the `coffee-loader` module to your `package.json`, like this: +First, install and add the `coffee-script` and `coffee-loader` modules to your `package.json`, like this: - $ npm install coffee-loader@0.7.2 --save-dev + $ npm install coffee-script coffee-loader@0.7.2 --save-dev Now, in our webpack config, update the `config.resolve.extensions` list so we can require `.coffee` files without specifying an extension: