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

refactor: drop support for webpack < 4 #303

Merged
merged 1 commit into from
Dec 20, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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