Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

extract-loader

Package Overview
Dependencies
Maintainers
11
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 4.0.3 to 5.0.0

12

CHANGELOG.md

@@ -0,1 +1,13 @@

# [5.0.0](https://github.com/peerigon/extract-loader/compare/v4.0.3...v5.0.0) (2020-03-05)
### Features
* Add support for ECMAScript modules ([#69](https://github.com/peerigon/extract-loader/issues/69)) ([6034f23](https://github.com/peerigon/extract-loader/commit/6034f23))
### BREAKING CHANGES
* The extract-loader now uses Babel to transpile the bundle code for the current Node version. This is required in order to support the new file-loader which produces ECMAScript modules. This *should not* be a breaking change but since Babel is also known to be kind of brittle in regards of configuration we cannot guarantee that there might be unknown/unwanted side-effects in your project setup.
## [4.0.3](https://github.com/peerigon/extract-loader/compare/v4.0.2...v4.0.3) (2020-01-29)

@@ -2,0 +14,0 @@

16

lib/extractLoader.js

@@ -7,2 +7,3 @@ "use strict";Object.defineProperty(exports, "__esModule", { value: true });var _assign = require("babel-runtime/core-js/object/assign");var _assign2 = _interopRequireDefault(_assign);var _promise = require("babel-runtime/core-js/promise");var _promise2 = _interopRequireDefault(_promise);var _map = require("babel-runtime/core-js/map");var _map2 = _interopRequireDefault(_map);var _asyncToGenerator2 = require("babel-runtime/helpers/asyncToGenerator");var _asyncToGenerator3 = _interopRequireDefault(_asyncToGenerator2);

/**

@@ -42,3 +43,3 @@ * @typedef {Object} LoaderContext

}
});return function extractLoader(_x) {return _ref.apply(this, arguments);};})();var _vm = require("vm");var _vm2 = _interopRequireDefault(_vm);var _path = require("path");var _path2 = _interopRequireDefault(_path);var _loaderUtils = require("loader-utils");var _resolve = require("resolve");var _resolve2 = _interopRequireDefault(_resolve);var _btoa = require("btoa");var _btoa2 = _interopRequireDefault(_btoa);function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { default: obj };}
});return function extractLoader(_x) {return _ref.apply(this, arguments);};})();var _vm = require("vm");var _vm2 = _interopRequireDefault(_vm);var _path = require("path");var _path2 = _interopRequireDefault(_path);var _loaderUtils = require("loader-utils");var _resolve = require("resolve");var _resolve2 = _interopRequireDefault(_resolve);var _btoa = require("btoa");var _btoa2 = _interopRequireDefault(_btoa);var _babelCore = require("babel-core");var babel = _interopRequireWildcard(_babelCore);function _interopRequireWildcard(obj) {if (obj && obj.__esModule) {return obj;} else {var newObj = {};if (obj != null) {for (var key in obj) {if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key];}}newObj.default = obj;return newObj;}}function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { default: obj };}

@@ -100,2 +101,15 @@ function evalDependencyGraph({ loaderContext, src, filename, publicPath = "" }) {let evalModule = (() => {var _ref2 = (0, _asyncToGenerator3.default)(

const rndPlaceholderPattern = new RegExp(rndPlaceholder, "g");
src = babel.transform(src, {
babelrc: false,
presets: [
[
"env", {
modules: "commonjs" }]],
plugins: ["add-module-exports"] }).
code;
const script = new _vm2.default.Script(src, {

@@ -102,0 +116,0 @@ filename,

6

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

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

"eslint-config-peerigon": "^15.0.2",
"file-loader": "^2.0.0",
"file-loader": "^5.0.2",
"html-loader": "^0.5.5",

@@ -57,2 +57,4 @@ "mocha": "^5.2.0",

"dependencies": {
"babel-core": "^6.26.3",
"babel-plugin-add-module-exports": "^1.0.2",
"babel-runtime": "^6.26.0",

@@ -59,0 +61,0 @@ "btoa": "^1.2.1",

@@ -76,3 +76,3 @@ extract-loader

You can even add your `index.html` as `entry` and just reference your stylesheets from there. You just need to tell the html-loader to also pick up `link:href`:
You can even add your `index.html` as `entry` and reference your stylesheets from there. In that case, tell the html-loader to also pick up `link:href`:

@@ -257,3 +257,3 @@ ```js

From opening a bug report to creating a pull request: **every contribution is appreciated and welcome**. If you're planing to implement a new feature or change the api please create an issue first. This way we can ensure that your precious work is not in vain.
From opening a bug report to creating a pull request: **every contribution is appreciated and welcome**. If you're planning to implement a new feature or change the api please create an issue first. This way we can ensure that your precious work is not in vain.

@@ -260,0 +260,0 @@ All pull requests should have 100% test coverage (with notable exceptions) and need to pass all tests.

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