Socket
Socket
Sign inDemoInstall

extract-loader

Package Overview
Dependencies
Maintainers
1
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 0.0.2 to 0.1.0

6

lib/extractLoader.js

@@ -15,2 +15,4 @@ "use strict";

var _loaderUtils = require("loader-utils");
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

@@ -45,2 +47,4 @@

var callback = this.async();
var query = (0, _loaderUtils.parseQuery)(this.query);
var publicPath = typeof query.publicPath !== "undefined" ? query.publicPath : this.options.output.publicPath;
var dependencies = [];

@@ -91,3 +95,3 @@ var script = new _vm2.default.Script(content, {

function (src, i) {
return runModule(src, dependencies[i], _this.options.output.publicPath);
return runModule(src, dependencies[i], publicPath);
});

@@ -94,0 +98,0 @@ }).then(function (results) {

5

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

@@ -47,3 +47,6 @@ "main": "lib/extractLoader.js",

"webpack": "^1.12.13"
},
"dependencies": {
"loader-utils": "^0.2.16"
}
}

@@ -131,5 +131,31 @@ extract-loader

The are currently no options.<br>
You need one? Then you should think about:
There is currently exactly one option: `publicPath`.
If you are using a relative `publicPath` in webpack's [output options](http://webpack.github.io/docs/configuration.html#output-publicpath) and extracting to a file with the `file-loader`, you might need this to account for the location of your extracted file.
Example:
```js
module.exports = {
output: {
path: path.resolve( './dist' ),
publicPath: 'dist/'
},
module: {
loaders: [
{
test: /\.css$/,
loaders: [
// target file: dist/assets/file.css
"file?name=assets/[name].[ext]",
// back up one directory to reach "dist/"
"extract?publicPath=../",
"css"
]
}
]
}
};
```
You need another option? Then you should think about:
<br>

@@ -136,0 +162,0 @@

import vm from "vm";
import path from "path";
import { parseQuery } from "loader-utils";

@@ -29,2 +30,4 @@ /**

const callback = this.async();
const query = parseQuery(this.query);
const publicPath = typeof query.publicPath !== "undefined" ? query.publicPath : this.options.output.publicPath;
const dependencies = [];

@@ -64,3 +67,3 @@ const script = new vm.Script(content, {

// runModule may throw an error, so it's important that our promise is rejected in this case
(src, i) => runModule(src, dependencies[i], this.options.output.publicPath)
(src, i) => runModule(src, dependencies[i], publicPath)
))

@@ -67,0 +70,0 @@ .then(results => sandbox.module.exports.toString()

Sorry, the diff of this file is not supported yet

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