You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/content/contribute/writing-a-loader.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -209,7 +209,7 @@ For instance, the `sass-loader` [specifies `node-sass`](https://github.com/webpa
209
209
So you've written a loader, followed the guidelines above, and have it set up to run locally. What's next? Let's go through a simple unit testing example to ensure our loader is working the way we expect. We'll be using the [Jest](https://facebook.github.io/jest/) framework to do this. We'll also install `babel-jest` and some presets that will allow us to use the `import` / `export` and `async` / `await`. Let's start by installing and saving these as a `devDependencies`:
210
210
211
211
```bash
212
-
npm i --save-dev jest babel-jest babel-preset-env
212
+
npm install --save-dev jest babel-jest babel-preset-env
213
213
```
214
214
215
215
__.babelrc__
@@ -254,7 +254,7 @@ Hey [name]!
254
254
Pay close attention to this next step as we'll be using the [Node.js API](/api/node) and [`memory-fs`](https://github.com/webpack/memory-fs) to execute webpack. This lets us avoid emitting `output` to disk and will give us access to the `stats` data which we can use to grab our transformed module:
Copy file name to clipboardExpand all lines: src/content/guides/integrations.md
+4-4Lines changed: 4 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -27,7 +27,7 @@ So while webpack's core focus is bundling, there are a variety of extensions tha
27
27
For those using Grunt, we recommend the [`grunt-webpack`](https://www.npmjs.com/package/grunt-webpack) package. With `grunt-webpack` you can run webpack or [webpack-dev-server](https://github.com/webpack/webpack-dev-server) as a task, get access to stats within [template tags](https://gruntjs.com/api/grunt.template), split development and production configurations and more. Start by installing `grunt-webpack` as well as `webpack` itself if you haven't already:
28
28
29
29
```bash
30
-
npm i --save-dev grunt-webpack webpack
30
+
npm install --save-dev grunt-webpack webpack
31
31
```
32
32
33
33
Then register a configuration and load the task:
@@ -60,7 +60,7 @@ For more information, please visit the [repository](https://github.com/webpack-c
60
60
Gulp is also a fairly straightforward integration with the help of the [`webpack-stream`](https://github.com/shama/webpack-stream) package (a.k.a. `gulp-webpack`). In this case, it is unnecessary to install `webpack` separately as it is a direct dependency of `webpack-stream`:
61
61
62
62
```bash
63
-
npm i --save-dev webpack-stream
63
+
npm install --save-dev webpack-stream
64
64
```
65
65
66
66
Just `require('webpack-stream')` instead of `webpack` and optionally pass it an configuration:
@@ -87,7 +87,7 @@ For more information, please visit the [repository](https://github.com/shama/web
87
87
The [`mocha-webpack`](https://github.com/zinserjan/mocha-webpack) utility can be used for a clean integration with Mocha. The repository offers more details on the pros and cons but essentially `mocha-webpack` is a simple wrapper that provides almost the same CLI as Mocha itself and provides various webpack functionality like an improved watch mode and improved path resolution. Here is a small example of how you would install it and use it to run a test suite (found within `./test`):
@@ -99,7 +99,7 @@ For more information, please visit the [repository](https://github.com/zinserjan
99
99
The [`karma-webpack`](https://github.com/webpack-contrib/karma-webpack) package allows you to use webpack to pre-process files in [Karma](http://karma-runner.github.io/1.0/index.html). It also makes use of [`webpack-dev-middleware`](https://github.com/webpack/webpack-dev-middleware) and allows passing configurations for both. A simple example may look something like this:
0 commit comments