This repository was archived by the owner on Mar 17, 2021. It is now read-only.
File tree 3 files changed +2
-16
lines changed
3 files changed +2
-16
lines changed Original file line number Diff line number Diff line change 14
14
15
15
A file loader module for webpack
16
16
17
- ## Requirements
18
-
19
- This module requires a minimum of Node v6.9.0 and works with Webpack v3 and Webpack v4.
20
-
21
17
## Getting Started
22
18
23
19
To begin, you'll need to install ` file-loader ` :
Original file line number Diff line number Diff line change 35
35
" dist"
36
36
],
37
37
"peerDependencies" : {
38
- "webpack" : " ^2.0.0 || ^3.0.0 || ^ 4.0.0"
38
+ "webpack" : " ^4.0.0"
39
39
},
40
40
"dependencies" : {
41
41
"loader-utils" : " ^1.0.2" ,
Original file line number Diff line number Diff line change 1
- /* eslint-disable
2
- multiline-ternary,
3
- */
4
1
import path from 'path' ;
5
2
6
3
import loaderUtils from 'loader-utils' ;
@@ -9,18 +6,11 @@ import validateOptions from 'schema-utils';
9
6
import schema from './options.json' ;
10
7
11
8
export default function loader ( content ) {
12
- if ( ! this . emitFile ) {
13
- throw new Error ( 'File Loader\n\nemitFile is required from module system' ) ;
14
- }
15
-
16
9
const options = loaderUtils . getOptions ( this ) || { } ;
17
10
18
11
validateOptions ( schema , options , 'File Loader' ) ;
19
12
20
- const context =
21
- options . context ||
22
- this . rootContext ||
23
- ( this . options && this . options . context ) ;
13
+ const context = options . context || this . rootContext ;
24
14
25
15
const url = loaderUtils . interpolateName ( this , options . name , {
26
16
context,
You can’t perform that action at this time.
0 commit comments