Skip to content

Document webpack change: refactor: migrate on acorn-import-attributes #7280

@webpack-bot

Description

@webpack-bot

A pull request by @alexander-akait was merged and maintainers requested a documentation change.

See pull request: webpack/webpack#18251


What kind of change does this PR introduce?

xtuc/acorn-import-attributes#31

Did you add tests for your changes?

Existing

Does this PR introduce a breaking change?

No

What needs to be documented once your changes are merged?

Added with ruleset rule, like assert, i.e.:

/** @type {import("../../../../").Configuration} */
module.exports = {
	module: {
		rules: [
			{
                                // will handle `pkg-1.json`
				assert: { type: "json" },
				loader: require.resolve("./loader-assert.js")
			},
			{
			        // will handle `pkg-2.json`
				with: { type: "json" },
				loader: require.resolve("./loader-with.js")
			}
		]
	}
};

```js
import one from "./pkg-1.json" assert { type: "json" };
import two from "./pkg-2.json" with { type: "json" };

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions