Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update references to @rollup/plugin-json #3297

Merged
merged 1 commit into from Dec 22, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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