This repository was archived by the owner on Mar 17, 2021. It is now read-only.
File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1414
1515A 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
2319To begin, you'll need to install ` file-loader ` :
Original file line number Diff line number Diff line change 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" ,
Original file line number Diff line number Diff line change 1- /* eslint-disable
2- multiline-ternary,
3- */
41import path from 'path' ;
52
63import loaderUtils from 'loader-utils' ;
@@ -9,18 +6,11 @@ import validateOptions from 'schema-utils';
96import schema from './options.json' ;
107
118export 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,
You can’t perform that action at this time.
0 commit comments