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

README.md

Lines changed: 0 additions & 4 deletions
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`:

package.json

Lines changed: 1 addition & 1 deletion
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",

src/index.js

Lines changed: 1 addition & 11 deletions
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)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy