Skip to content

Commit

Permalink
Update references to rollup-plugin-json (#3297)
Browse files Browse the repository at this point in the history
  • Loading branch information
cprecioso authored and lukastaegert committed Dec 22, 2019
1 parent 21cbb0f commit 43b7c44
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
10 changes: 5 additions & 5 deletions docs/04-tutorial.md
Expand Up @@ -173,7 +173,7 @@ So far, we've created a simple bundle from an entry point and a module imported

For that, we use *plugins*, which change the behaviour of Rollup at key points in the bundling process. A list of awesome plugins is maintained on [the Rollup Awesome List](https://github.com/rollup/awesome).

For this tutorial, we'll use [rollup-plugin-json](https://github.com/rollup/rollup-plugin-json), which allows Rollup to import data from a JSON file.
For this tutorial, we'll use [@rollup/plugin-json](https://github.com/rollup/plugins/tree/master/packages/json), which allows Rollup to import data from a JSON file.

Create a file in the project root called `package.json`, and add the following content:

Expand All @@ -187,10 +187,10 @@ Create a file in the project root called `package.json`, and add the following c
}
```

Install rollup-plugin-json as a development dependency:
Install @rollup/plugin-json as a development dependency:

```
npm install --save-dev rollup-plugin-json
npm install --save-dev @rollup/plugin-json
```

(We're using `--save-dev` rather than `--save` because our code doesn't actually depend on the plugin when it runs – only when we're building the bundle.)
Expand All @@ -210,7 +210,7 @@ Edit your `rollup.config.js` file to include the JSON plugin:

```js
// rollup.config.js
import json from 'rollup-plugin-json';
import json from '@rollup/plugin-json';

export default {
input: 'src/main.js',
Expand Down Expand Up @@ -252,7 +252,7 @@ Edit your `rollup.config.js` file to add a second minified output. As format, we

```js
// rollup.config.js
import json from 'rollup-plugin-json';
import json from '@rollup/plugin-json';
import {terser} from 'rollup-plugin-terser';

export default {
Expand Down
2 changes: 1 addition & 1 deletion src/Module.ts
Expand Up @@ -131,7 +131,7 @@ function tryParse(module: Module, Parser: typeof acorn.Parser, acornOptions: aco
} catch (err) {
let message = err.message.replace(/ \(\d+:\d+\)$/, '');
if (module.id.endsWith('.json')) {
message += ' (Note that you need rollup-plugin-json to import JSON files)';
message += ' (Note that you need @rollup/plugin-json to import JSON files)';
} else if (!module.id.endsWith('.js')) {
message += ' (Note that you need plugins to import files that are not JavaScript)';
}
Expand Down
2 changes: 1 addition & 1 deletion test/function/samples/error-parse-json/_config.js
Expand Up @@ -5,7 +5,7 @@ module.exports = {
'throws with an extended error message when failing to parse a file with ".json" extension',
error: {
code: 'PARSE_ERROR',
message: 'Unexpected token (Note that you need rollup-plugin-json to import JSON files)',
message: 'Unexpected token (Note that you need @rollup/plugin-json to import JSON files)',
parserError: {
loc: {
column: 8,
Expand Down

0 comments on commit 43b7c44

Please sign in to comment.