diff --git a/README.md b/README.md index c292994f552..e020332c5a2 100644 --- a/README.md +++ b/README.md @@ -109,11 +109,6 @@ Rollup can import existing CommonJS modules [through a plugin](https://github.co To make sure your ES modules are immediately usable by tools that work with CommonJS such as Node.js and webpack, you can use Rollup to compile to UMD or CommonJS format, and then point to that compiled version with the `main` property in your `package.json` file. If your `package.json` file also has a `module` field, ES-module-aware tools like Rollup and [webpack 2](https://webpack.js.org/) will [import the ES module version](https://github.com/rollup/rollup/wiki/pkg.module) directly. -## Links - -- step-by-step [tutorial video series](https://code.lengstorf.com/learn-rollup-js/), with accompanying written walkthrough -- miscellaneous issues in the [wiki](https://github.com/rollup/rollup/wiki) - ## Contributors This project exists thanks to all the people who contribute. [[Contribute](CONTRIBUTING.md)]. diff --git a/bin/src/run/batchWarnings.ts b/bin/src/run/batchWarnings.ts index 3d96a6a030c..98f9c91d350 100644 --- a/bin/src/run/batchWarnings.ts +++ b/bin/src/run/batchWarnings.ts @@ -143,9 +143,7 @@ const deferredHandlers: { priority: 1, fn: warnings => { title('Unresolved dependencies'); - info( - 'https://github.com/rollup/rollup/wiki/Troubleshooting#treating-module-as-external-dependency' - ); + info('https://rollupjs.org/guide/en#warning-treating-module-as-external-dependency'); const dependencies = new Map(); warnings.forEach(warning => { @@ -164,7 +162,7 @@ const deferredHandlers: { priority: 1, fn: warnings => { title('Missing exports'); - info('https://github.com/rollup/rollup/wiki/Troubleshooting#name-is-not-exported-by-module'); + info('https://rollupjs.org/guide/en#error-name-is-not-exported-by-module-'); warnings.forEach(warning => { stderr(tc.bold(warning.importer)); @@ -178,7 +176,7 @@ const deferredHandlers: { priority: 1, fn: warnings => { title('`this` has been rewritten to `undefined`'); - info('https://github.com/rollup/rollup/wiki/Troubleshooting#this-is-undefined'); + info('https://rollupjs.org/guide/en#error-this-is-undefined'); showTruncatedWarnings(warnings); } }, @@ -187,7 +185,7 @@ const deferredHandlers: { priority: 1, fn: warnings => { title('Use of eval is strongly discouraged'); - info('https://github.com/rollup/rollup/wiki/Troubleshooting#avoiding-eval'); + info('https://rollupjs.org/guide/en#avoiding-eval'); showTruncatedWarnings(warnings); } }, @@ -233,9 +231,7 @@ const deferredHandlers: { priority: 1, fn: warnings => { title(`Broken sourcemap`); - info( - 'https://github.com/rollup/rollup/wiki/Troubleshooting#sourcemap-is-likely-to-be-incorrect' - ); + info('https://rollupjs.org/guide/en#warning-sourcemap-is-likely-to-be-incorrect'); const plugins = Array.from(new Set(warnings.map(w => w.plugin).filter(Boolean))); const detail = diff --git a/bin/src/run/loadConfigFile.ts b/bin/src/run/loadConfigFile.ts index 3343dbb4bca..9b2013ad574 100644 --- a/bin/src/run/loadConfigFile.ts +++ b/bin/src/run/loadConfigFile.ts @@ -60,7 +60,7 @@ export default function loadConfigFile( handleError({ code: 'MISSING_CONFIG', message: 'Config file must export an options object, or an array of options objects', - url: 'https://rollupjs.org/#using-config-files' + url: 'https://rollupjs.org/guide/en#configuration-files' }); } diff --git a/src/Graph.ts b/src/Graph.ts index 928153f41d0..036cd5fb050 100644 --- a/src/Graph.ts +++ b/src/Graph.ts @@ -812,7 +812,7 @@ Try defining "${chunkName}" first in the manualChunks definitions of the Rollup module.id )}, but could not be resolved – treating it as an external dependency`, url: - 'https://github.com/rollup/rollup/wiki/Troubleshooting#treating-module-as-external-dependency' + 'https://rollupjs.org/guide/en#warning-treating-module-as-external-dependency' }); } isExternal = true; diff --git a/src/Module.ts b/src/Module.ts index 9421c9e02aa..8c86ca6a151 100644 --- a/src/Module.ts +++ b/src/Module.ts @@ -159,7 +159,7 @@ function handleMissingExport( { code: 'MISSING_EXPORT', message: `'${exportName}' is not exported by ${relativeId(importedModule)}`, - url: `https://github.com/rollup/rollup/wiki/Troubleshooting#name-is-not-exported-by-module` + url: `https://rollupjs.org/guide/en#error-name-is-not-exported-by-module-` }, importerStart ); diff --git a/src/ast/nodes/CallExpression.ts b/src/ast/nodes/CallExpression.ts index 2c88d4a9171..a6351ac8116 100644 --- a/src/ast/nodes/CallExpression.ts +++ b/src/ast/nodes/CallExpression.ts @@ -51,7 +51,7 @@ export default class CallExpression extends NodeBase implements DeoptimizableEnt { code: 'EVAL', message: `Use of eval is strongly discouraged, as it poses security risks and may cause issues with minification`, - url: 'https://github.com/rollup/rollup/wiki/Troubleshooting#avoiding-eval' + url: 'https://rollupjs.org/guide/en#avoiding-eval' }, this.start ); diff --git a/src/ast/nodes/MemberExpression.ts b/src/ast/nodes/MemberExpression.ts index 0320eb580a3..e981cf5fbf2 100644 --- a/src/ast/nodes/MemberExpression.ts +++ b/src/ast/nodes/MemberExpression.ts @@ -266,7 +266,7 @@ export default class MemberExpression extends NodeBase implements DeoptimizableE importer: relativeId(this.context.fileName), exporter: relativeId(fileName), message: `'${exportName}' is not exported by '${relativeId(fileName)}'`, - url: `https://github.com/rollup/rollup/wiki/Troubleshooting#name-is-not-exported-by-module` + url: `https://rollupjs.org/guide/en#error-name-is-not-exported-by-module-` }, path[0].pos ); diff --git a/src/ast/nodes/TaggedTemplateExpression.ts b/src/ast/nodes/TaggedTemplateExpression.ts index d1d37d4fb7e..5e8be02709f 100644 --- a/src/ast/nodes/TaggedTemplateExpression.ts +++ b/src/ast/nodes/TaggedTemplateExpression.ts @@ -33,7 +33,7 @@ export default class TaggedTemplateExpression extends NodeBase { { code: 'EVAL', message: `Use of eval is strongly discouraged, as it poses security risks and may cause issues with minification`, - url: 'https://github.com/rollup/rollup/wiki/Troubleshooting#avoiding-eval' + url: 'https://rollupjs.org/guide/en#avoiding-eval' }, this.start ); diff --git a/src/ast/nodes/ThisExpression.ts b/src/ast/nodes/ThisExpression.ts index 00b2baf3bae..1501e441f37 100644 --- a/src/ast/nodes/ThisExpression.ts +++ b/src/ast/nodes/ThisExpression.ts @@ -34,7 +34,7 @@ export default class ThisExpression extends NodeBase { { code: 'THIS_IS_UNDEFINED', message: `The 'this' keyword is equivalent to 'undefined' at the top level of an ES module, and has been rewritten`, - url: `https://github.com/rollup/rollup/wiki/Troubleshooting#this-is-undefined` + url: `https://rollupjs.org/guide/en#error-this-is-undefined` }, this.start ); diff --git a/src/rollup/index.ts b/src/rollup/index.ts index 0aa7ed63ff8..c17b7598406 100644 --- a/src/rollup/index.ts +++ b/src/rollup/index.ts @@ -39,7 +39,7 @@ function addDeprecations(deprecations: Deprecation[], warn: WarningHandler) { function checkInputOptions(options: InputOptions) { if (options.transform || options.load || options.resolveId || options.resolveExternal) { throw new Error( - 'The `transform`, `load`, `resolveId` and `resolveExternal` options are deprecated in favour of a unified plugin API. See https://github.com/rollup/rollup/wiki/Plugins for details' + 'The `transform`, `load`, `resolveId` and `resolveExternal` options are deprecated in favour of a unified plugin API. See https://rollupjs.org/guide/en#plugins' ); } } @@ -48,14 +48,14 @@ function checkOutputOptions(options: OutputOptions) { if (options.format === 'es6') { error({ message: 'The `es6` output format is deprecated – use `es` instead', - url: `https://rollupjs.org/#format-f-output-format-` + url: `https://rollupjs.org/guide/en#output-format-f-format` }); } if (!options.format) { error({ message: `You must specify output.format, which can be one of 'amd', 'cjs', 'system', 'esm', 'iife' or 'umd'`, - url: `https://rollupjs.org/#format-f-output-format-` + url: `https://rollupjs.org/guide/en#output-format-f-format` }); } diff --git a/src/utils/collapseSourcemaps.ts b/src/utils/collapseSourcemaps.ts index a4e86c6769d..bab774d2d2b 100644 --- a/src/utils/collapseSourcemaps.ts +++ b/src/utils/collapseSourcemaps.ts @@ -177,7 +177,7 @@ export default function collapseSourcemaps( message: `Sourcemap is likely to be incorrect: a plugin${ map.plugin ? ` ('${map.plugin}')` : `` } was used to transform files, but didn't generate a sourcemap for the transformation. Consult the plugin documentation for help`, - url: `https://github.com/rollup/rollup/wiki/Troubleshooting#sourcemap-is-likely-to-be-incorrect` + url: `https://rollupjs.org/guide/en#warning-sourcemap-is-likely-to-be-incorrect` }); map = { diff --git a/src/utils/default-plugin.ts b/src/utils/default-plugin.ts index ceebc95fba4..f607d04122d 100644 --- a/src/utils/default-plugin.ts +++ b/src/utils/default-plugin.ts @@ -49,7 +49,7 @@ function createResolveId(options: InputOptions) { error({ code: 'MISSING_PROCESS', message: `It looks like you're using Rollup in a non-Node.js environment. This means you must supply a plugin with custom resolveId and load functions`, - url: 'https://github.com/rollup/rollup/wiki/Plugins' + url: 'https://rollupjs.org/guide/en#a-simple-example' }); } diff --git a/src/utils/getExportMode.ts b/src/utils/getExportMode.ts index 358c177f572..8a20416a61d 100644 --- a/src/utils/getExportMode.ts +++ b/src/utils/getExportMode.ts @@ -35,8 +35,8 @@ export default function getExportMode( chunk.graph.warn({ code: 'MIXED_EXPORTS', message: `Using named and default exports together. Consumers of your bundle will have to use ${name || - 'bundle'}['default'] to access the default export, which may not be what you want. Use \`exports: 'named'\` to disable this warning`, - url: `https://rollupjs.org/#exports` + 'bundle'}['default'] to access the default export, which may not be what you want. Use \`output.exports: 'named'\` to disable this warning`, + url: `https://rollupjs.org/guide/en#output-exports-exports` }); } exportMode = 'named'; @@ -46,7 +46,8 @@ export default function getExportMode( if (!/(?:default|named|none)/.test(exportMode)) { error({ code: 'INVALID_EXPORT_OPTION', - message: `output.exports must be 'default', 'named', 'none', 'auto', or left unspecified (defaults to 'auto')` + message: `output.exports must be 'default', 'named', 'none', 'auto', or left unspecified (defaults to 'auto')`, + url: `https://rollupjs.org/guide/en#output-exports-exports` }); } diff --git a/test/function/samples/default-not-reexported/_config.js b/test/function/samples/default-not-reexported/_config.js index 5bdb02adf08..34bfa2647fb 100644 --- a/test/function/samples/default-not-reexported/_config.js +++ b/test/function/samples/default-not-reexported/_config.js @@ -17,6 +17,6 @@ module.exports = { 2: 3: console.log( def ); `, - url: `https://github.com/rollup/rollup/wiki/Troubleshooting#name-is-not-exported-by-module` + url: `https://rollupjs.org/guide/en#error-name-is-not-exported-by-module-` } }; diff --git a/test/function/samples/does-not-hang-on-missing-module/_config.js b/test/function/samples/does-not-hang-on-missing-module/_config.js index d99a1b42faf..b074580ea90 100644 --- a/test/function/samples/does-not-hang-on-missing-module/_config.js +++ b/test/function/samples/does-not-hang-on-missing-module/_config.js @@ -8,7 +8,7 @@ module.exports = { importer: 'main.js', source: 'unlessYouCreatedThisFileForSomeReason', message: `'unlessYouCreatedThisFileForSomeReason' is imported by main.js, but could not be resolved – treating it as an external dependency`, - url: `https://github.com/rollup/rollup/wiki/Troubleshooting#treating-module-as-external-dependency` + url: `https://rollupjs.org/guide/en#warning-treating-module-as-external-dependency` } ], runtimeError(error) { diff --git a/test/function/samples/error-after-transform-should-throw-correct-location/_config.js b/test/function/samples/error-after-transform-should-throw-correct-location/_config.js index 0b39a2dc841..14d0b0ab6fe 100644 --- a/test/function/samples/error-after-transform-should-throw-correct-location/_config.js +++ b/test/function/samples/error-after-transform-should-throw-correct-location/_config.js @@ -33,6 +33,6 @@ module.exports = { 2: 3: Object.assign({}, a); `, - url: `https://github.com/rollup/rollup/wiki/Troubleshooting#name-is-not-exported-by-module` + url: `https://rollupjs.org/guide/en#error-name-is-not-exported-by-module-` } }; diff --git a/test/function/samples/export-type-mismatch-b/_config.js b/test/function/samples/export-type-mismatch-b/_config.js index a618bc92142..530090a1449 100644 --- a/test/function/samples/export-type-mismatch-b/_config.js +++ b/test/function/samples/export-type-mismatch-b/_config.js @@ -3,6 +3,7 @@ module.exports = { options: { output: { exports: 'blah' } }, generateError: { code: 'INVALID_EXPORT_OPTION', - message: `output.exports must be 'default', 'named', 'none', 'auto', or left unspecified (defaults to 'auto')` + message: `output.exports must be 'default', 'named', 'none', 'auto', or left unspecified (defaults to 'auto')`, + url: 'https://rollupjs.org/guide/en#output-exports-exports' } }; diff --git a/test/function/samples/import-of-unexported-fails/_config.js b/test/function/samples/import-of-unexported-fails/_config.js index 103fe59c4d6..ed29243fe7e 100644 --- a/test/function/samples/import-of-unexported-fails/_config.js +++ b/test/function/samples/import-of-unexported-fails/_config.js @@ -17,6 +17,6 @@ module.exports = { 2: 3: a(); `, - url: `https://github.com/rollup/rollup/wiki/Troubleshooting#name-is-not-exported-by-module` + url: `https://rollupjs.org/guide/en#error-name-is-not-exported-by-module-` } }; diff --git a/test/function/samples/namespace-missing-export/_config.js b/test/function/samples/namespace-missing-export/_config.js index 75163b5ab00..e996462328f 100644 --- a/test/function/samples/namespace-missing-export/_config.js +++ b/test/function/samples/namespace-missing-export/_config.js @@ -21,7 +21,7 @@ module.exports = { 3: assert.equal( typeof mod.foo, 'undefined' ); ^ `, - url: `https://github.com/rollup/rollup/wiki/Troubleshooting#name-is-not-exported-by-module` + url: `https://rollupjs.org/guide/en#error-name-is-not-exported-by-module-` } ] }; diff --git a/test/function/samples/reexport-missing-error/_config.js b/test/function/samples/reexport-missing-error/_config.js index 445d8eff345..86630835e2e 100644 --- a/test/function/samples/reexport-missing-error/_config.js +++ b/test/function/samples/reexport-missing-error/_config.js @@ -15,6 +15,6 @@ module.exports = { 1: export { foo as bar } from './empty.js'; ^ `, - url: 'https://github.com/rollup/rollup/wiki/Troubleshooting#name-is-not-exported-by-module' + url: 'https://rollupjs.org/guide/en#error-name-is-not-exported-by-module-' } }; diff --git a/test/function/samples/unused-import/_config.js b/test/function/samples/unused-import/_config.js index c2960460cb8..ad7e533d0ce 100644 --- a/test/function/samples/unused-import/_config.js +++ b/test/function/samples/unused-import/_config.js @@ -6,7 +6,7 @@ module.exports = { importer: 'main.js', source: 'external', message: `'external' is imported by main.js, but could not be resolved – treating it as an external dependency`, - url: `https://github.com/rollup/rollup/wiki/Troubleshooting#treating-module-as-external-dependency` + url: `https://rollupjs.org/guide/en#warning-treating-module-as-external-dependency` }, { code: 'UNUSED_EXTERNAL_IMPORT', diff --git a/test/function/samples/warn-on-auto-named-default-exports/_config.js b/test/function/samples/warn-on-auto-named-default-exports/_config.js index 1464c646161..89e044000af 100644 --- a/test/function/samples/warn-on-auto-named-default-exports/_config.js +++ b/test/function/samples/warn-on-auto-named-default-exports/_config.js @@ -3,8 +3,8 @@ module.exports = { warnings: [ { code: 'MIXED_EXPORTS', - message: `Using named and default exports together. Consumers of your bundle will have to use bundle['default'] to access the default export, which may not be what you want. Use \`exports: 'named'\` to disable this warning`, - url: `https://rollupjs.org/#exports` + message: `Using named and default exports together. Consumers of your bundle will have to use bundle['default'] to access the default export, which may not be what you want. Use \`output.exports: 'named'\` to disable this warning`, + url: `https://rollupjs.org/guide/en#output-exports-exports` } ] }; diff --git a/test/function/samples/warn-on-eval/_config.js b/test/function/samples/warn-on-eval/_config.js index 0a22e99b450..346b6e58a0a 100644 --- a/test/function/samples/warn-on-eval/_config.js +++ b/test/function/samples/warn-on-eval/_config.js @@ -17,7 +17,7 @@ module.exports = { 1: var result = eval( '1 + 1' ); ^ `, - url: 'https://github.com/rollup/rollup/wiki/Troubleshooting#avoiding-eval' + url: 'https://rollupjs.org/guide/en#avoiding-eval' } ] }; diff --git a/test/function/samples/warn-on-top-level-this/_config.js b/test/function/samples/warn-on-top-level-this/_config.js index 0ec7ab9b4f9..040f1472d8b 100644 --- a/test/function/samples/warn-on-top-level-this/_config.js +++ b/test/function/samples/warn-on-top-level-this/_config.js @@ -20,7 +20,7 @@ module.exports = { 3: this.foo = 'bar'; ^ `, - url: `https://github.com/rollup/rollup/wiki/Troubleshooting#this-is-undefined` + url: `https://rollupjs.org/guide/en#error-this-is-undefined` } ], runtimeError: err => { diff --git a/test/sourcemaps/samples/transform-without-sourcemap-render-chunk/_config.js b/test/sourcemaps/samples/transform-without-sourcemap-render-chunk/_config.js index d450f61032a..7e16dfb2d61 100644 --- a/test/sourcemaps/samples/transform-without-sourcemap-render-chunk/_config.js +++ b/test/sourcemaps/samples/transform-without-sourcemap-render-chunk/_config.js @@ -24,7 +24,7 @@ module.exports = { code: `SOURCEMAP_BROKEN`, plugin: 'fake plugin 1', message: `Sourcemap is likely to be incorrect: a plugin ('fake plugin 1') was used to transform files, but didn't generate a sourcemap for the transformation. Consult the plugin documentation for help`, - url: `https://github.com/rollup/rollup/wiki/Troubleshooting#sourcemap-is-likely-to-be-incorrect` + url: `https://rollupjs.org/guide/en#warning-sourcemap-is-likely-to-be-incorrect` } ] }; diff --git a/test/sourcemaps/samples/transform-without-sourcemap/_config.js b/test/sourcemaps/samples/transform-without-sourcemap/_config.js index 91056715a8f..62f1b3ac8c8 100644 --- a/test/sourcemaps/samples/transform-without-sourcemap/_config.js +++ b/test/sourcemaps/samples/transform-without-sourcemap/_config.js @@ -24,7 +24,7 @@ module.exports = { code: `SOURCEMAP_BROKEN`, plugin: 'fake plugin 1', message: `Sourcemap is likely to be incorrect: a plugin ('fake plugin 1') was used to transform files, but didn't generate a sourcemap for the transformation. Consult the plugin documentation for help`, - url: `https://github.com/rollup/rollup/wiki/Troubleshooting#sourcemap-is-likely-to-be-incorrect` + url: `https://rollupjs.org/guide/en#warning-sourcemap-is-likely-to-be-incorrect` } ] };