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

Commit

Permalink
refactor: drop support for webpack < 4 (#303)
Browse files Browse the repository at this point in the history
BREAKING CHANGE: drop support for webpack < 4
  • Loading branch information
evilebottnawi authored Dec 20, 2018
1 parent e5fe4e8 commit 203a4ee
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 16 deletions.
4 changes: 0 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,6 @@

A file loader module for webpack

## Requirements

This module requires a minimum of Node v6.9.0 and works with Webpack v3 and Webpack v4.

## Getting Started

To begin, you'll need to install `file-loader`:
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
"dist"
],
"peerDependencies": {
"webpack": "^2.0.0 || ^3.0.0 || ^4.0.0"
"webpack": "^4.0.0"
},
"dependencies": {
"loader-utils": "^1.0.2",
Expand Down
12 changes: 1 addition & 11 deletions src/index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
/* eslint-disable
multiline-ternary,
*/
import path from 'path';

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

export default function loader(content) {
if (!this.emitFile) {
throw new Error('File Loader\n\nemitFile is required from module system');
}

const options = loaderUtils.getOptions(this) || {};

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

const context =
options.context ||
this.rootContext ||
(this.options && this.options.context);
const context = options.context || this.rootContext;

const url = loaderUtils.interpolateName(this, options.name, {
context,
Expand Down

0 comments on commit 203a4ee

Please sign in to comment.