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

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: webpack-contrib/url-loader
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 1b9dbd1cb406d221877237a6712b8bb4c9b194af
Choose a base ref
...
head repository: webpack-contrib/url-loader
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 8828d64dbd6cea392a277360dcd1db7297c07451
Choose a head ref
  • 13 commits
  • 37 files changed
  • 4 contributors

Commits on Oct 3, 2019

  1. Unverified

    This commit is not signed, but one or more authors requires that any commit attributed to them is signed.
    Copy the full SHA
    2bffcfd View commit details
  2. Copy the full SHA
    a251a23 View commit details

Commits on Oct 4, 2019

  1. Copy the full SHA
    9431124 View commit details
  2. Copy the full SHA
    196110e View commit details
  3. Copy the full SHA
    cbd1950 View commit details

Commits on Nov 21, 2019

  1. Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    0ee2b99 View commit details
  2. chore(release): 2.3.0

    alexander-akait committed Nov 21, 2019
    Copy the full SHA
    2451157 View commit details

Commits on Nov 26, 2019

  1. refactor: next (#198)

    evilebottnawi authored Nov 26, 2019

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    3f0bbc5 View commit details
  2. chore(release): 3.0.0

    alexander-akait committed Nov 26, 2019
    Copy the full SHA
    4301f87 View commit details

Commits on Jan 6, 2020

  1. Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    a2f127d View commit details

Commits on Mar 17, 2020

  1. Copy the full SHA
    f13757a View commit details
  2. chore(deps): migrate on mime-types package (#209)

    BREAKING CHANGE: migrate on `mime-types` package, some rare types may have other mimetype
    evilebottnawi authored Mar 17, 2020

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    fc8721f View commit details
  3. chore(release): 4.0.0

    alexander-akait committed Mar 17, 2020
    Copy the full SHA
    8828d64 View commit details
1 change: 0 additions & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
@@ -9,5 +9,4 @@ insert_final_newline = true
trim_trailing_whitespace = true

[*.md]
insert_final_newline = true
trim_trailing_whitespace = false
39 changes: 39 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -2,6 +2,45 @@

All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.

## [4.0.0](https://github.com/webpack-contrib/url-loader/compare/v3.0.0...v4.0.0) (2020-03-17)


### ⚠ BREAKING CHANGES

* **deps:** migrate on `mime-types` package, some rare types may have other mimetype

### Bug Fixes

* description on the `esModule` option ([#204](https://github.com/webpack-contrib/url-loader/issues/204)) ([a2f127d](https://github.com/webpack-contrib/url-loader/commit/a2f127d16b88cda3c38509821a51487a89827c28))


* **deps:** migrate on `mime-types` package ([#209](https://github.com/webpack-contrib/url-loader/issues/209)) ([fc8721f](https://github.com/webpack-contrib/url-loader/commit/fc8721f49626360dd81300085a747b3afa5acd38))

## [3.0.0](https://github.com/webpack-contrib/url-loader/compare/v2.0.0...v3.0.0) (2019-11-26)


### BREAKING CHANGES

* minimum required nodejs version is `10.13.0`
* rename the `esModules` option to `esModule`
* switch to ES modules by default (the option `esModule` is `true` by default)


## [2.3.0](https://github.com/webpack-contrib/url-loader/compare/v2.2.0...v2.3.0) (2019-11-21)


### Features

* new `esModules` option to output ES modules ([0ee2b99](https://github.com/webpack-contrib/url-loader/commit/0ee2b9964f37f4d7c5dd6ea09f8526525e0fab91))

### [2.2.0](https://github.com/webpack-contrib/url-loader/compare/v2.1.0...v2.2.0) (2019-10-04)


### Features

* limit allow using `Infinity` and `Number` ([#192](https://github.com/webpack-contrib/url-loader/issues/192)) ([2bffcfd](https://github.com/webpack-contrib/url-loader/commit/2bffcfd))
* pnp support ([#195](https://github.com/webpack-contrib/url-loader/issues/195)) ([196110e](https://github.com/webpack-contrib/url-loader/commit/196110e))

## [2.1.0](https://github.com/webpack-contrib/url-loader/compare/v2.0.1...v2.1.0) (2019-07-18)


43 changes: 37 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -79,7 +79,7 @@ module.exports = {
{
loader: 'url-loader',
options: {
fallback: 'responsive-loader',
fallback: require.resolve('responsive-loader'),
},
},
],
@@ -105,7 +105,7 @@ module.exports = {
{
loader: 'url-loader',
options: {
fallback: 'responsive-loader',
fallback: require.resolve('responsive-loader'),
quality: 85,
},
},
@@ -123,9 +123,9 @@ Default: `undefined`

The limit can be specified via loader options and defaults to no limit.

#### `Number`
#### `Number|String`

A `Number` specifying the maximum size of a file in bytes. If the file size is
A `Number` or `String` specifying the maximum size of a file in bytes. If the file size is
**equal** or **greater** than the limit [`file-loader`](https://github.com/webpack-contrib/file-loader)
will be used (by default) and all query parameters are passed to it.
Using an alternative to `file-loader` is enabled via the `fallback` option.
@@ -183,8 +183,7 @@ module.exports = {
Type: `String`
Default: `(file extension)`

Sets the MIME type for the file to be transformed. If unspecified the file
extensions will be used to lookup the MIME type.
Sets the MIME type for the file to be transformed. If unspecified the file extensions will be used to lookup the MIME type.

**webpack.config.js**

@@ -208,6 +207,38 @@ module.exports = {
};
```

### `esModule`

Type: `Boolean`
Default: `true`

By default, `file-loader` generates JS modules that use the ES modules syntax.
There are some cases in which using ES 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/).

You can enable a CommonJS module syntax using:

**webpack.config.js**

```js
module.exports = {
module: {
rules: [
{
test: /\.css$/,
use: [
{
loader: 'url-loader',
options: {
esModule: false,
},
},
],
},
],
},
};
```

## Contributing

Please take a moment to read our contributing guidelines if you haven't yet done so.
76 changes: 42 additions & 34 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
@@ -2,10 +2,13 @@ trigger:
- master
- next

variables:
npm_config_cache: $(Pipeline.Workspace)/.npm

jobs:
- job: Lint
pool:
vmImage: ubuntu-16.04
vmImage: ubuntu-latest
steps:
- task: NodeTool@0
inputs:
@@ -20,10 +23,12 @@ jobs:
node -v
npm -v
displayName: 'Print versions'
- task: Npm@1
- task: CacheBeta@1
inputs:
command: custom
customCommand: ci
key: npm | $(Agent.OS) | package-lock.json
path: $(npm_config_cache)
displayName: 'Cache npm'
- script: npm ci
displayName: 'Install dependencies'
- script: npm run lint
displayName: 'Run lint'
@@ -34,23 +39,22 @@ jobs:

- job: Linux
pool:
vmImage: ubuntu-16.04
vmImage: ubuntu-latest
strategy:
maxParallel: 4
matrix:
node-13:
node_version: ^13.0.0
webpack_version: latest
node-12:
node_version: ^12.0.0
webpack_version: latest
node-10:
node_version: ^10.13.0
webpack_version: latest
node-8:
node_version: ^8.9.0
webpack_version: latest
node-8-canary:
node_version: ^8.9.0
node-10-canary:
node_version: ^10.13.0
webpack_version: next
continue_on_error: true
steps:
- task: NodeTool@0
inputs:
@@ -65,10 +69,12 @@ jobs:
node -v
npm -v
displayName: 'Print versions'
- task: Npm@1
- task: CacheBeta@1
inputs:
command: custom
customCommand: ci
key: npm | $(Agent.OS) | package-lock.json
path: $(npm_config_cache)
displayName: 'Cache npm'
- script: npm ci
displayName: 'Install dependencies'
- script: npm i webpack@$(webpack_version)
displayName: 'Install "webpack@$(webpack_version)"'
@@ -86,23 +92,22 @@ jobs:

- job: macOS
pool:
vmImage: macOS-10.14
vmImage: macOS-latest
strategy:
maxParallel: 4
matrix:
node-13:
node_version: ^13.0.0
webpack_version: latest
node-12:
node_version: ^12.0.0
webpack_version: latest
node-10:
node_version: ^10.13.0
webpack_version: latest
node-8:
node_version: ^8.9.0
webpack_version: latest
node-8-canary:
node_version: ^8.9.0
node-10-canary:
node_version: ^10.13.0
webpack_version: next
continue_on_error: true
steps:
- task: NodeTool@0
inputs:
@@ -117,10 +122,12 @@ jobs:
node -v
npm -v
displayName: 'Print versions'
- task: Npm@1
- task: CacheBeta@1
inputs:
command: custom
customCommand: ci
key: npm | $(Agent.OS) | package-lock.json
path: $(npm_config_cache)
displayName: 'Cache npm'
- script: npm ci
displayName: 'Install dependencies'
- script: npm i webpack@$(webpack_version)
displayName: 'Install "webpack@$(webpack_version)"'
@@ -138,23 +145,22 @@ jobs:

- job: Windows
pool:
vmImage: windows-2019
vmImage: windows-latest
strategy:
maxParallel: 4
matrix:
node-13:
node_version: ^13.0.0
webpack_version: latest
node-12:
node_version: ^12.0.0
webpack_version: latest
node-10:
node_version: ^10.13.0
webpack_version: latest
node-8:
node_version: ^8.9.0
webpack_version: latest
node-8-canary:
node_version: ^8.9.0
node-10-canary:
node_version: ^10.13.0
webpack_version: next
continue_on_error: true
steps:
- script: 'git config --global core.autocrlf input'
displayName: 'Config git core.autocrlf'
@@ -172,10 +178,12 @@ jobs:
node -v
npm -v
displayName: 'Print versions'
- task: Npm@1
- task: CacheBeta@1
inputs:
command: custom
customCommand: ci
key: npm | $(Agent.OS) | package-lock.json
path: $(npm_config_cache)
displayName: 'Cache npm'
- script: npm ci
displayName: 'Install dependencies'
- script: npm i webpack@$(webpack_version)
displayName: 'Install "webpack@$(webpack_version)"'
2 changes: 1 addition & 1 deletion babel.config.js
Original file line number Diff line number Diff line change
@@ -10,7 +10,7 @@ module.exports = (api) => {
'@babel/preset-env',
{
targets: {
node: '8.9.0',
node: '10.13.0',
},
},
],
2 changes: 1 addition & 1 deletion lint-staged.config.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module.exports = {
'*.js': ['prettier --write', 'eslint --fix', 'git add'],
'*.{json,md,yml,css}': ['prettier --write', 'git add'],
'*.{json,md,yml,css,ts}': ['prettier --write', 'git add'],
};
Loading