Skip to content
This repository was archived by the owner on Mar 17, 2021. It is now read-only.

Commit 203a4ee

Browse files
refactor: drop support for webpack < 4 (#303)
BREAKING CHANGE: drop support for webpack < 4
1 parent e5fe4e8 commit 203a4ee

File tree

3 files changed

+2
-16
lines changed

3 files changed

+2
-16
lines changed

Diff for: README.md

-4
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,6 @@
1414

1515
A file loader module for webpack
1616

17-
## Requirements
18-
19-
This module requires a minimum of Node v6.9.0 and works with Webpack v3 and Webpack v4.
20-
2117
## Getting Started
2218

2319
To begin, you'll need to install `file-loader`:

Diff for: package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
"dist"
3636
],
3737
"peerDependencies": {
38-
"webpack": "^2.0.0 || ^3.0.0 || ^4.0.0"
38+
"webpack": "^4.0.0"
3939
},
4040
"dependencies": {
4141
"loader-utils": "^1.0.2",

Diff for: src/index.js

+1-11
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
/* eslint-disable
2-
multiline-ternary,
3-
*/
41
import path from 'path';
52

63
import loaderUtils from 'loader-utils';
@@ -9,18 +6,11 @@ import validateOptions from 'schema-utils';
96
import schema from './options.json';
107

118
export default function loader(content) {
12-
if (!this.emitFile) {
13-
throw new Error('File Loader\n\nemitFile is required from module system');
14-
}
15-
169
const options = loaderUtils.getOptions(this) || {};
1710

1811
validateOptions(schema, options, 'File Loader');
1912

20-
const context =
21-
options.context ||
22-
this.rootContext ||
23-
(this.options && this.options.context);
13+
const context = options.context || this.rootContext;
2414

2515
const url = loaderUtils.interpolateName(this, options.name, {
2616
context,

0 commit comments

Comments
 (0)