Socket
Socket
Sign inDemoInstall

extract-loader

Package Overview
Dependencies
Maintainers
8
Versions
18
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

extract-loader - npm Package Compare versions

Comparing version 3.0.0 to 3.1.0

10

CHANGELOG.md

@@ -5,2 +5,12 @@ # Change Log

<a name="3.1.0"></a>
# [3.1.0](https://github.com/peerigon/extract-loader/compare/v3.0.0...v3.1.0) (2018-11-26)
### Features
* Accept function as publicPath option ([#51](https://github.com/peerigon/extract-loader/issues/51)) ([678933e](https://github.com/peerigon/extract-loader/commit/678933e))
<a name="3.0.0"></a>

@@ -7,0 +17,0 @@ # [3.0.0](https://github.com/peerigon/extract-loader/compare/v2.0.1...v3.0.0) (2018-08-31)

2

package.json
{
"name": "extract-loader",
"version": "3.0.0",
"version": "3.1.0",
"description": "webpack loader to extract HTML and CSS from the bundle",

@@ -5,0 +5,0 @@ "main": "lib/extractLoader.js",

@@ -174,5 +174,5 @@ extract-loader

There is currently exactly one option: `publicPath`.
If you are using a relative `publicPath` in webpack's [output options](https://webpack.js.org/configuration/output/#output-publicpath) and extracting to a file with the `file-loader`, you might need this to account for the location of your extracted file.
If you are using a relative `publicPath` in webpack's [output options](https://webpack.js.org/configuration/output/#output-publicpath) and extracting to a file with the `file-loader`, you might need this to account for the location of your extracted file. `publicPath` may be defined as a string or a function that accepts current [loader context](https://webpack.js.org/api/loaders/#the-loader-context) as single argument.
Example:
Example with publicPath option as a string:

@@ -212,2 +212,38 @@ ```js

Example with publicPath option as a function:
```js
module.exports = {
output: {
path: path.resolve("./dist"),
publicPath: "dist/"
},
module: {
rules: [
{
test: /\.css$/,
use: [
{
loader: "file-loader",
options: {
name: "assets/[name].[ext]",
},
},
{
loader: "extract-loader",
options: {
// dynamically return a relative publicPath based on how deep in directory structure the loaded file is in /src/ directory
publicPath: (context) => '../'.repeat(path.relative(path.resolve('src'), context.context).split('/').length),
}
},
{
loader: "css-loader",
},
],
}
]
}
};
```
You need another option? Then you should think about:

@@ -214,0 +250,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