Socket
Socket
Sign inDemoInstall

file-loader

Package Overview
Dependencies
Maintainers
7
Versions
52
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

file-loader - npm Package Compare versions

Comparing version 4.2.0 to 4.3.0

7

CHANGELOG.md

@@ -5,2 +5,9 @@ # Changelog

## [4.3.0](https://github.com/webpack-contrib/file-loader/compare/v4.2.0...v4.3.0) (2019-11-21)
### Features
* new `esModules` option to output ES modules ([#340](https://github.com/webpack-contrib/file-loader/issues/340)) ([9b9cd8d](https://github.com/webpack-contrib/file-loader/commit/9b9cd8d22b3dbe4677be9bdd0bf5fbe07815df54))
## [4.2.0](https://github.com/webpack-contrib/file-loader/compare/v4.1.0...v4.2.0) (2019-08-07)

@@ -7,0 +14,0 @@

5

dist/index.js

@@ -61,6 +61,5 @@ "use strict";

this.emitFile(outputPath, content);
} // TODO revert to ES2015 Module export, when new CSS Pipeline is in place
}
return `module.exports = ${publicPath};`;
return `${options.esModules ? 'export default' : 'module.exports ='} ${publicPath};`;
}

@@ -67,0 +66,0 @@

3

dist/options.json

@@ -59,2 +59,5 @@ {

]
},
"esModules": {
"type": "boolean"
}

@@ -61,0 +64,0 @@ },

{
"name": "file-loader",
"version": "4.2.0",
"version": "4.3.0",
"description": "A file loader module for webpack",

@@ -41,30 +41,30 @@ "license": "MIT",

"loader-utils": "^1.2.3",
"schema-utils": "^2.0.0"
"schema-utils": "^2.5.0"
},
"devDependencies": {
"@babel/cli": "^7.5.5",
"@babel/core": "^7.5.5",
"@babel/preset-env": "^7.5.5",
"@commitlint/cli": "^8.1.0",
"@commitlint/config-conventional": "^8.1.0",
"@babel/cli": "^7.7.0",
"@babel/core": "^7.7.2",
"@babel/preset-env": "^7.7.1",
"@commitlint/cli": "^8.2.0",
"@commitlint/config-conventional": "^8.2.0",
"@webpack-contrib/defaults": "^5.0.2",
"@webpack-contrib/eslint-config-webpack": "^3.0.0",
"babel-jest": "^24.8.0",
"babel-jest": "^24.9.0",
"commitlint-azure-pipelines-cli": "^1.0.2",
"cross-env": "^5.2.0",
"del": "^5.0.0",
"del-cli": "^2.0.0",
"eslint": "^6.0.1",
"eslint-config-prettier": "^6.0.0",
"eslint-plugin-import": "^2.18.0",
"husky": "^3.0.0",
"jest": "^24.8.0",
"jest-junit": "^6.4.0",
"lint-staged": "^9.2.0",
"memory-fs": "^0.4.1",
"cross-env": "^6.0.3",
"del": "^5.1.0",
"del-cli": "^3.0.0",
"eslint": "^6.6.0",
"eslint-config-prettier": "^6.7.0",
"eslint-plugin-import": "^2.18.2",
"husky": "^3.1.0",
"jest": "^24.9.0",
"jest-junit": "^9.0.0",
"lint-staged": "^9.4.3",
"memory-fs": "^0.5.0",
"npm-run-all": "^4.1.5",
"prettier": "^1.18.2",
"standard-version": "^6.0.1",
"url-loader": "^2.0.1",
"webpack": "^4.36.1"
"prettier": "^1.19.1",
"standard-version": "^7.0.1",
"url-loader": "^2.2.0",
"webpack": "^4.41.2"
},

@@ -71,0 +71,0 @@ "keywords": [

@@ -378,2 +378,31 @@ <div align="center">

### `esModules`
Type: `Boolean`
Default: `false`
By default, `file-loader` generates JS modules that use the CommonJS syntax. However, there are some cases in which using ES2015 modules is beneficial, like in the case of [module concatenation](https://webpack.js.org/plugins/module-concatenation-plugin/) and [tree shaking](https://webpack.js.org/guides/tree-shaking/).
**webpack.config.js**
```js
module.exports = {
module: {
rules: [
{
test: /\.css$/,
use: [
{
loader: 'file-loader',
options: {
esModules: true,
},
},
],
},
],
},
};
```
## Placeholders

@@ -380,0 +409,0 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc