nav tabs on admin dashboard
This commit is contained in:
31
node_modules/extract-text-webpack-plugin/CHANGELOG.md
generated
vendored
31
node_modules/extract-text-webpack-plugin/CHANGELOG.md
generated
vendored
@@ -2,6 +2,37 @@
|
||||
|
||||
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.
|
||||
|
||||
<a name="4.0.0-beta.0"></a>
|
||||
# [4.0.0-beta.0](https://github.com/webpack-contrib/extract-text-webpack-plugin/compare/v4.0.0-alpha.0...v4.0.0-beta.0) (2018-02-28)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **index:** don't crash with dynamic `import()` ([#728](https://github.com/webpack-contrib/extract-text-webpack-plugin/issues/728)) ([348b46b](https://github.com/webpack-contrib/extract-text-webpack-plugin/commit/348b46b))
|
||||
|
||||
|
||||
|
||||
<a name="4.0.0-alpha.0"></a>
|
||||
# [4.0.0-alpha.0](https://github.com/webpack-contrib/extract-text-webpack-plugin/compare/v3.0.2...v4.0.0-alpha.0) (2018-02-14)
|
||||
|
||||
|
||||
### Chores
|
||||
|
||||
* **package:** update `engines` && `peerDependencies` ([05b41f3](https://github.com/webpack-contrib/extract-text-webpack-plugin/commit/05b41f3))
|
||||
|
||||
|
||||
### Code Refactoring
|
||||
|
||||
* **ExtractTextPlugin:** update to new plugin system and API's ([#707](https://github.com/webpack-contrib/extract-text-webpack-plugin/issues/707)) ([51c56c0](https://github.com/webpack-contrib/extract-text-webpack-plugin/commit/51c56c0))
|
||||
|
||||
|
||||
### BREAKING CHANGES
|
||||
|
||||
* **ExtractTextPlugin:** requires `webpack >= v4.0.0`
|
||||
* **package:** requires `node >= v6.0.0` (`engines`)
|
||||
|
||||
|
||||
|
||||
<a name="3.0.2"></a>
|
||||
## [3.0.2](https://github.com/webpack-contrib/extract-text-webpack-plugin/compare/v3.0.1...v3.0.2) (2017-10-25)
|
||||
|
||||
|
||||
42
node_modules/extract-text-webpack-plugin/README.md
generated
vendored
42
node_modules/extract-text-webpack-plugin/README.md
generated
vendored
@@ -72,7 +72,7 @@ new ExtractTextPlugin(options: filename | object)
|
||||
|:--:|:--:|:----------|
|
||||
|**`id`**|`{String}`|Unique ident for this plugin instance. (For advanced usage only, by default automatically generated)|
|
||||
|**`filename`**|`{String\|Function}`|Name of the result file. May contain `[name]`, `[id]` and `[contenthash]`|
|
||||
|**`allChunks`**|`{Boolean}`|Extract from all additional chunks too (by default it extracts only from the initial chunk(s))<br />When using `CommonsChunkPlugin` and there are extracted chunks (from `ExtractTextPlugin.extract`) in the commons chunk, `allChunks` **must** be set to `true`|
|
||||
|**`allChunks`**|`{Boolean}`|Extract from all additional chunks too (by default it extracts only from the initial chunk(s))<br />When using `optimization.splitChunks` and there are extracted chunks (from `ExtractTextPlugin.extract`) in the commons chunk, `allChunks` **must** be set to `true`|
|
||||
|**`disable`**|`{Boolean}`|Disables the plugin|
|
||||
|**`ignoreOrder`**|`{Boolean}`|Disables order check (useful for CSS Modules!), `false` by default|
|
||||
|
||||
@@ -146,7 +146,6 @@ module.exports = {
|
||||
test: /\.scss$/,
|
||||
use: ExtractTextPlugin.extract({
|
||||
fallback: 'style-loader',
|
||||
//resolve-url-loader may be chained before sass-loader if necessary
|
||||
use: ['css-loader', 'sass-loader']
|
||||
})
|
||||
}
|
||||
@@ -162,6 +161,45 @@ module.exports = {
|
||||
}
|
||||
```
|
||||
|
||||
### `url()` Resolving
|
||||
|
||||
If you are finding that urls are not resolving properly when you run webpack. You can expand your loader functionality with options. The `url: false` property allows your paths resolved without any changes.
|
||||
|
||||
```js
|
||||
const ExtractTextPlugin = require('extract-text-webpack-plugin');
|
||||
|
||||
module.exports = {
|
||||
module: {
|
||||
rules: [
|
||||
{
|
||||
test: /\.scss$/,
|
||||
use: ExtractTextPlugin.extract({
|
||||
fallback: 'style-loader',
|
||||
use: [
|
||||
{
|
||||
loader: 'css-loader',
|
||||
options: {
|
||||
// If you are having trouble with urls not resolving add this setting.
|
||||
// See https://github.com/webpack-contrib/css-loader#url
|
||||
url: false,
|
||||
minimize: true,
|
||||
sourceMap: true
|
||||
}
|
||||
},
|
||||
{
|
||||
loader: 'sass-loader',
|
||||
options: {
|
||||
sourceMap: true
|
||||
}
|
||||
}
|
||||
]
|
||||
})
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### Modify filename
|
||||
|
||||
`filename` parameter could be `Function`. It passes `getPath` to process the format like `css/[name].css` and returns the real file name, `css/js/a.css`. You can replace `css/js` with `css` then you will get the new path `css/a.css`.
|
||||
|
||||
473
node_modules/extract-text-webpack-plugin/dist/index.js
generated
vendored
473
node_modules/extract-text-webpack-plugin/dist/index.js
generated
vendored
@@ -4,8 +4,6 @@ Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
|
||||
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
|
||||
|
||||
var _fs = require('fs');
|
||||
|
||||
var _fs2 = _interopRequireDefault(_fs);
|
||||
@@ -44,247 +42,296 @@ var _helpers = require('./lib/helpers');
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
||||
/* eslint-disable
|
||||
consistent-return,
|
||||
no-param-reassign,
|
||||
prefer-rest-params
|
||||
*/
|
||||
const NS = _path2.default.dirname(_fs2.default.realpathSync(__filename));
|
||||
const plugin = { name: 'ExtractTextPlugin' };
|
||||
|
||||
var NS = _path2.default.dirname(_fs2.default.realpathSync(__filename));
|
||||
|
||||
var nextId = 0;
|
||||
|
||||
var ExtractTextPlugin = function () {
|
||||
function ExtractTextPlugin(options) {
|
||||
_classCallCheck(this, ExtractTextPlugin);
|
||||
let nextId = 0;
|
||||
|
||||
class ExtractTextPlugin {
|
||||
constructor(options) {
|
||||
if ((0, _helpers.isString)(options)) {
|
||||
options = { filename: options };
|
||||
} else {
|
||||
(0, _schemaUtils2.default)(_path2.default.resolve(__dirname, '../schema/plugin.json'), options, 'Extract Text Plugin');
|
||||
(0, _schemaUtils2.default)(_path2.default.resolve(__dirname, './plugin.json'), options, 'Extract Text Plugin');
|
||||
}
|
||||
this.filename = options.filename;
|
||||
this.id = options.id != null ? options.id : ++nextId;
|
||||
this.id = options.id != null ? options.id : nextId += 1;
|
||||
this.options = {};
|
||||
(0, _helpers.mergeOptions)(this.options, options);
|
||||
delete this.options.filename;
|
||||
delete this.options.id;
|
||||
}
|
||||
|
||||
_createClass(ExtractTextPlugin, [{
|
||||
key: 'applyAdditionalInformation',
|
||||
value: function applyAdditionalInformation(source, info) {
|
||||
if (info) {
|
||||
return new _webpackSources.ConcatSource(`@media ${info[0]} {`, source, '}');
|
||||
}
|
||||
return source;
|
||||
}
|
||||
}, {
|
||||
key: 'loader',
|
||||
value: function loader(options) {
|
||||
return ExtractTextPlugin.loader((0, _helpers.mergeOptions)({ id: this.id }, options));
|
||||
}
|
||||
}, {
|
||||
key: 'mergeNonInitialChunks',
|
||||
value: function mergeNonInitialChunks(chunk, intoChunk, checkedChunks) {
|
||||
var _this = this;
|
||||
static loader(options) {
|
||||
return { loader: require.resolve('./loader'), options };
|
||||
}
|
||||
|
||||
if (!intoChunk) {
|
||||
checkedChunks = [];
|
||||
chunk.chunks.forEach(function (c) {
|
||||
if ((0, _helpers.isInitialOrHasNoParents)(c)) return;
|
||||
_this.mergeNonInitialChunks(c, chunk, checkedChunks);
|
||||
}, this);
|
||||
} else if (checkedChunks.indexOf(chunk) < 0) {
|
||||
checkedChunks.push(chunk);
|
||||
chunk.forEachModule(function (module) {
|
||||
intoChunk.addModule(module);
|
||||
module.addChunk(intoChunk);
|
||||
});
|
||||
chunk.chunks.forEach(function (c) {
|
||||
if ((0, _helpers.isInitialOrHasNoParents)(c)) return;
|
||||
_this.mergeNonInitialChunks(c, intoChunk, checkedChunks);
|
||||
}, this);
|
||||
}
|
||||
static applyAdditionalInformation(source, info) {
|
||||
if (info) {
|
||||
return new _webpackSources.ConcatSource(`@media ${info[0]} {`, source, '}');
|
||||
}
|
||||
}, {
|
||||
key: 'renderExtractedChunk',
|
||||
value: function renderExtractedChunk(chunk) {
|
||||
var _this2 = this;
|
||||
|
||||
var source = new _webpackSources.ConcatSource();
|
||||
chunk.forEachModule(function (module) {
|
||||
var moduleSource = module.source();
|
||||
source.add(_this2.applyAdditionalInformation(moduleSource, module.additionalInformation));
|
||||
}, this);
|
||||
return source;
|
||||
}
|
||||
}, {
|
||||
key: 'extract',
|
||||
value: function extract(options) {
|
||||
if (Array.isArray(options) || (0, _helpers.isString)(options) || typeof options.options === 'object' || typeof options.query === 'object') {
|
||||
options = { use: options };
|
||||
} else {
|
||||
(0, _schemaUtils2.default)(_path2.default.resolve(__dirname, '../schema/loader.json'), options, 'Extract Text Plugin (Loader)');
|
||||
}
|
||||
var loader = options.use;
|
||||
var before = options.fallback || [];
|
||||
if ((0, _helpers.isString)(loader)) {
|
||||
loader = loader.split('!');
|
||||
}
|
||||
if ((0, _helpers.isString)(before)) {
|
||||
before = before.split('!');
|
||||
} else if (!Array.isArray(before)) {
|
||||
before = [before];
|
||||
}
|
||||
options = (0, _helpers.mergeOptions)({ omit: before.length, remove: true }, options);
|
||||
delete options.use;
|
||||
delete options.fallback;
|
||||
return [this.loader(options)].concat(before, loader).map(_helpers.getLoaderObject);
|
||||
}
|
||||
}, {
|
||||
key: 'apply',
|
||||
value: function apply(compiler) {
|
||||
var _this3 = this;
|
||||
return source;
|
||||
}
|
||||
|
||||
var options = this.options;
|
||||
compiler.plugin('this-compilation', function (compilation) {
|
||||
var extractCompilation = new _ExtractTextPluginCompilation2.default();
|
||||
compilation.plugin('normal-module-loader', function (loaderContext, module) {
|
||||
loaderContext[NS] = function (content, opt) {
|
||||
if (options.disable) {
|
||||
return false;
|
||||
}
|
||||
if (!Array.isArray(content) && content != null) {
|
||||
throw new Error(`Exported value was not extracted as an array: ${JSON.stringify(content)}`);
|
||||
}
|
||||
module[NS] = {
|
||||
content,
|
||||
options: opt || {}
|
||||
};
|
||||
return options.allChunks || module[`${NS}/extract`]; // eslint-disable-line no-path-concat
|
||||
loader(options) {
|
||||
return ExtractTextPlugin.loader((0, _helpers.mergeOptions)({ id: this.id }, options));
|
||||
}
|
||||
|
||||
mergeNonInitialChunks(chunk, intoChunk, checkedChunks) {
|
||||
if (!intoChunk) {
|
||||
const newCheckedChunks = [];
|
||||
|
||||
for (const asyncChunk of chunk.getAllAsyncChunks()) {
|
||||
if (!asyncChunk.isOnlyInitial()) {
|
||||
this.mergeNonInitialChunks(asyncChunk, chunk, newCheckedChunks);
|
||||
}
|
||||
}
|
||||
} else if (!checkedChunks.includes(chunk)) {
|
||||
const newCheckedChunks = checkedChunks.concat(chunk);
|
||||
|
||||
for (const chunkModule of chunk.modulesIterable) {
|
||||
intoChunk.addModule(chunkModule);
|
||||
chunkModule.addChunk(intoChunk);
|
||||
}
|
||||
|
||||
for (const asyncChunk of chunk.getAllAsyncChunks()) {
|
||||
if (!asyncChunk.isOnlyInitial()) {
|
||||
this.mergeNonInitialChunks(asyncChunk, intoChunk, newCheckedChunks);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static renderExtractedChunk(compilation, chunk) {
|
||||
const source = new _webpackSources.ConcatSource();
|
||||
|
||||
for (const chunkModule of chunk.modulesIterable) {
|
||||
let moduleSource = chunkModule.source(compilation.dependencyTemplates, compilation.runtimeTemplate);
|
||||
|
||||
// This module was concatenated by the ModuleConcatenationPlugin; because the pitching loader
|
||||
// only produces commonjs results, at least for now things we want to extract can't be in them.
|
||||
// NOTE: if ESM support is added, _this workaround will break_.
|
||||
if (moduleSource instanceof _webpackSources.ConcatSource) {
|
||||
moduleSource = null;
|
||||
}
|
||||
|
||||
// Async imports (require.ensure(), import().then) are CachedSource module
|
||||
// instances caching a ReplaceSource instance, which breaks the plugin
|
||||
// because their .source() is the cached "// removed by ..." text.
|
||||
// The issue lies elsewhere, this is just a temporary fix that
|
||||
// creates a new RawSource with the extracted text. If it's
|
||||
// a CachedSource instance but there's no extracted text
|
||||
// it's "__webpack_require__();" statements. Skip it.
|
||||
if (moduleSource instanceof _webpackSources.CachedSource) {
|
||||
if (chunkModule[NS] && chunkModule[NS].content) {
|
||||
moduleSource = new _webpackSources.ConcatSource();
|
||||
if (chunkModule[NS].content.length > 1) {
|
||||
console.error(chunkModule[NS].content);
|
||||
}
|
||||
for (const content of chunkModule[NS].content) {
|
||||
moduleSource.add(new _webpackSources.RawSource(content[1]));
|
||||
}
|
||||
} else {
|
||||
moduleSource = null;
|
||||
}
|
||||
}
|
||||
|
||||
if (moduleSource) {
|
||||
source.add(ExtractTextPlugin.applyAdditionalInformation(moduleSource, chunkModule.additionalInformation));
|
||||
}
|
||||
}
|
||||
|
||||
return source;
|
||||
}
|
||||
|
||||
extract(options) {
|
||||
if (Array.isArray(options) || (0, _helpers.isString)(options) || typeof options.options === 'object' || typeof options.query === 'object') {
|
||||
options = { use: options };
|
||||
} else {
|
||||
(0, _schemaUtils2.default)(_path2.default.resolve(__dirname, './loader.json'), options, 'Extract Text Plugin (Loader)');
|
||||
}
|
||||
|
||||
let loader = options.use;
|
||||
let before = options.fallback || [];
|
||||
|
||||
if ((0, _helpers.isString)(loader)) {
|
||||
loader = loader.split('!');
|
||||
}
|
||||
|
||||
if ((0, _helpers.isString)(before)) {
|
||||
before = before.split('!');
|
||||
} else if (!Array.isArray(before)) {
|
||||
before = [before];
|
||||
}
|
||||
|
||||
options = (0, _helpers.mergeOptions)({ omit: before.length, remove: true }, options);
|
||||
delete options.use;
|
||||
delete options.fallback;
|
||||
|
||||
return [this.loader(options)].concat(before, loader).map(_helpers.getLoaderObject);
|
||||
}
|
||||
|
||||
apply(compiler) {
|
||||
const { options, filename, id } = this;
|
||||
|
||||
compiler.hooks.thisCompilation.tap(plugin, compilation => {
|
||||
const extractCompilation = new _ExtractTextPluginCompilation2.default();
|
||||
|
||||
compilation.hooks.normalModuleLoader.tap(plugin, (loaderContext, module) => {
|
||||
loaderContext[NS] = (content, opt) => {
|
||||
if (options.disable) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!Array.isArray(content) && content != null) {
|
||||
throw new Error(`Exported value was not extracted as an array: ${JSON.stringify(content)}`);
|
||||
}
|
||||
|
||||
module[NS] = {
|
||||
content,
|
||||
options: opt || {}
|
||||
};
|
||||
|
||||
return options.allChunks || module[`${NS}/extract`]; // eslint-disable-line no-path-concat
|
||||
};
|
||||
});
|
||||
|
||||
let extractedChunks;
|
||||
compilation.hooks.optimizeTree.tapAsync(plugin, (chunks, modules, callback) => {
|
||||
extractedChunks = chunks.map(() => new _Chunk2.default());
|
||||
|
||||
chunks.forEach((chunk, i) => {
|
||||
const extractedChunk = extractedChunks[i];
|
||||
extractedChunk.index = i;
|
||||
extractedChunk.originalChunk = chunk;
|
||||
extractedChunk.name = chunk.name;
|
||||
// extractedChunk.entryModule = chunk.entryModule;
|
||||
|
||||
for (const chunkGroup of chunk.groupsIterable) {
|
||||
extractedChunk.addGroup(chunkGroup);
|
||||
}
|
||||
});
|
||||
var filename = _this3.filename;
|
||||
var id = _this3.id;
|
||||
var extractedChunks = void 0;
|
||||
compilation.plugin('optimize-tree', function (chunks, modules, callback) {
|
||||
extractedChunks = chunks.map(function () {
|
||||
return new _Chunk2.default();
|
||||
});
|
||||
chunks.forEach(function (chunk, i) {
|
||||
var extractedChunk = extractedChunks[i];
|
||||
extractedChunk.index = i;
|
||||
extractedChunk.originalChunk = chunk;
|
||||
extractedChunk.name = chunk.name;
|
||||
extractedChunk.entrypoints = chunk.entrypoints;
|
||||
chunk.chunks.forEach(function (c) {
|
||||
extractedChunk.addChunk(extractedChunks[chunks.indexOf(c)]);
|
||||
});
|
||||
chunk.parents.forEach(function (c) {
|
||||
extractedChunk.addParent(extractedChunks[chunks.indexOf(c)]);
|
||||
});
|
||||
});
|
||||
_async2.default.forEach(chunks, function (chunk, callback) {
|
||||
|
||||
_async2.default.forEach(chunks, (chunk, chunkCallback) => {
|
||||
// eslint-disable-line no-shadow
|
||||
const extractedChunk = extractedChunks[chunks.indexOf(chunk)];
|
||||
const shouldExtract = !!(options.allChunks || (0, _helpers.isInitialOrHasNoParents)(chunk));
|
||||
|
||||
_async2.default.forEach(Array.from(chunk.modulesIterable).sort(
|
||||
// NOTE: .index should be .index2 once ESM support is added
|
||||
(a, b) => a.index - b.index), (module, moduleCallback) => {
|
||||
// eslint-disable-line no-shadow
|
||||
var extractedChunk = extractedChunks[chunks.indexOf(chunk)];
|
||||
var shouldExtract = !!(options.allChunks || (0, _helpers.isInitialOrHasNoParents)(chunk));
|
||||
chunk.sortModules();
|
||||
_async2.default.forEach(chunk.mapModules(function (c) {
|
||||
return c;
|
||||
}), function (module, callback) {
|
||||
// eslint-disable-line no-shadow
|
||||
var meta = module[NS];
|
||||
if (meta && (!meta.options.id || meta.options.id === id)) {
|
||||
var wasExtracted = Array.isArray(meta.content);
|
||||
// A stricter `shouldExtract !== wasExtracted` check to guard against cases where a previously extracted
|
||||
// module would be extracted twice. Happens when a module is a dependency of an initial and a non-initial
|
||||
// chunk. See issue #604
|
||||
if (shouldExtract && !wasExtracted) {
|
||||
module[`${NS}/extract`] = shouldExtract; // eslint-disable-line no-path-concat
|
||||
compilation.rebuildModule(module, function (err) {
|
||||
if (err) {
|
||||
compilation.errors.push(err);
|
||||
return callback();
|
||||
}
|
||||
meta = module[NS];
|
||||
// Error out if content is not an array and is not null
|
||||
if (!Array.isArray(meta.content) && meta.content != null) {
|
||||
err = new Error(`${module.identifier()} doesn't export content`);
|
||||
compilation.errors.push(err);
|
||||
return callback();
|
||||
}
|
||||
if (meta.content) {
|
||||
extractCompilation.addResultToChunk(module.identifier(), meta.content, module, extractedChunk);
|
||||
}
|
||||
callback();
|
||||
});
|
||||
} else {
|
||||
let meta = module[NS];
|
||||
|
||||
if (meta && (!meta.options.id || meta.options.id === id)) {
|
||||
const wasExtracted = Array.isArray(meta.content);
|
||||
|
||||
// A stricter `shouldExtract !== wasExtracted` check to guard against cases where a previously extracted
|
||||
// module would be extracted twice. Happens when a module is a dependency of an initial and a non-initial
|
||||
// chunk. See issue #604
|
||||
if (shouldExtract && !wasExtracted) {
|
||||
module[`${NS}/extract`] = shouldExtract; // eslint-disable-line no-path-concat
|
||||
|
||||
return compilation.rebuildModule(module, err => {
|
||||
if (err) {
|
||||
compilation.errors.push(err);
|
||||
|
||||
return moduleCallback();
|
||||
}
|
||||
|
||||
meta = module[NS];
|
||||
// Error out if content is not an array and is not null
|
||||
if (!Array.isArray(meta.content) && meta.content != null) {
|
||||
err = new Error(`${module.identifier()} doesn't export content`);
|
||||
compilation.errors.push(err);
|
||||
|
||||
return moduleCallback();
|
||||
}
|
||||
|
||||
if (meta.content) {
|
||||
extractCompilation.addResultToChunk(module.identifier(), meta.content, module, extractedChunk);
|
||||
}
|
||||
callback();
|
||||
}
|
||||
} else callback();
|
||||
}, function (err) {
|
||||
if (err) return callback(err);
|
||||
callback();
|
||||
});
|
||||
}, function (err) {
|
||||
if (err) return callback(err);
|
||||
extractedChunks.forEach(function (extractedChunk) {
|
||||
if ((0, _helpers.isInitialOrHasNoParents)(extractedChunk)) {
|
||||
_this3.mergeNonInitialChunks(extractedChunk);
|
||||
}
|
||||
}, _this3);
|
||||
extractedChunks.forEach(function (extractedChunk) {
|
||||
if (!(0, _helpers.isInitialOrHasNoParents)(extractedChunk)) {
|
||||
extractedChunk.forEachModule(function (module) {
|
||||
extractedChunk.removeModule(module);
|
||||
|
||||
return moduleCallback();
|
||||
});
|
||||
} else if (meta.content) {
|
||||
extractCompilation.addResultToChunk(module.identifier(), meta.content, module, extractedChunk);
|
||||
}
|
||||
});
|
||||
compilation.applyPlugins('optimize-extracted-chunks', extractedChunks);
|
||||
callback();
|
||||
});
|
||||
});
|
||||
compilation.plugin('additional-assets', function (callback) {
|
||||
extractedChunks.forEach(function (extractedChunk) {
|
||||
if (extractedChunk.getNumberOfModules()) {
|
||||
extractedChunk.sortModules(function (a, b) {
|
||||
if (!options.ignoreOrder && (0, _helpers.isInvalidOrder)(a, b)) {
|
||||
compilation.errors.push(new _OrderUndefinedError2.default(a.getOriginalModule()));
|
||||
compilation.errors.push(new _OrderUndefinedError2.default(b.getOriginalModule()));
|
||||
}
|
||||
return (0, _helpers.getOrder)(a, b);
|
||||
});
|
||||
var chunk = extractedChunk.originalChunk;
|
||||
var source = _this3.renderExtractedChunk(extractedChunk);
|
||||
|
||||
var getPath = function getPath(format) {
|
||||
return compilation.getPath(format, {
|
||||
chunk
|
||||
}).replace(/\[(?:(\w+):)?contenthash(?::([a-z]+\d*))?(?::(\d+))?\]/ig, function () {
|
||||
// eslint-disable-line func-names
|
||||
return _loaderUtils2.default.getHashDigest(source.source(), arguments[1], arguments[2], parseInt(arguments[3], 10));
|
||||
});
|
||||
};
|
||||
|
||||
var file = (0, _helpers.isFunction)(filename) ? filename(getPath) : getPath(filename);
|
||||
|
||||
compilation.assets[file] = source;
|
||||
chunk.files.push(file);
|
||||
}
|
||||
}, _this3);
|
||||
|
||||
return moduleCallback();
|
||||
}, err => {
|
||||
if (err) {
|
||||
return chunkCallback(err);
|
||||
}
|
||||
|
||||
chunkCallback();
|
||||
});
|
||||
}, err => {
|
||||
if (err) {
|
||||
return callback(err);
|
||||
}
|
||||
|
||||
extractedChunks.forEach(extractedChunk => {
|
||||
if ((0, _helpers.isInitialOrHasNoParents)(extractedChunk)) {
|
||||
this.mergeNonInitialChunks(extractedChunk);
|
||||
}
|
||||
});
|
||||
|
||||
extractedChunks.forEach(extractedChunk => {
|
||||
if (!(0, _helpers.isInitialOrHasNoParents)(extractedChunk)) {
|
||||
for (const chunkModule of extractedChunk.modulesIterable) {
|
||||
extractedChunk.removeModule(chunkModule);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
compilation.hooks.optimizeExtractedChunks.call(extractedChunks);
|
||||
callback();
|
||||
});
|
||||
});
|
||||
}
|
||||
}], [{
|
||||
key: 'loader',
|
||||
value: function loader(options) {
|
||||
return { loader: require.resolve('./loader'), options };
|
||||
}
|
||||
}]);
|
||||
|
||||
return ExtractTextPlugin;
|
||||
}();
|
||||
compilation.hooks.additionalAssets.tapAsync(plugin, assetCb => {
|
||||
extractedChunks.forEach(extractedChunk => {
|
||||
if (extractedChunk.getNumberOfModules()) {
|
||||
extractedChunk.sortModules((a, b) => {
|
||||
if (!options.ignoreOrder && (0, _helpers.isInvalidOrder)(a, b)) {
|
||||
compilation.errors.push(new _OrderUndefinedError2.default(a.getOriginalModule()));
|
||||
compilation.errors.push(new _OrderUndefinedError2.default(b.getOriginalModule()));
|
||||
}
|
||||
|
||||
return (0, _helpers.getOrder)(a, b);
|
||||
});
|
||||
|
||||
const chunk = extractedChunk.originalChunk;
|
||||
const source = ExtractTextPlugin.renderExtractedChunk(compilation, extractedChunk);
|
||||
|
||||
const getPath = format => compilation.getPath(format, {
|
||||
chunk
|
||||
}).replace(/\[(?:(\w+):)?contenthash(?::([a-z]+\d*))?(?::(\d+))?\]/gi,
|
||||
// eslint-disable-next-line func-names
|
||||
function () {
|
||||
return _loaderUtils2.default.getHashDigest(source.source(), arguments[1], arguments[2], parseInt(arguments[3], 10));
|
||||
});
|
||||
|
||||
const file = (0, _helpers.isFunction)(filename) ? filename(getPath) : getPath(filename);
|
||||
|
||||
compilation.assets[file] = source;
|
||||
chunk.files.push(file);
|
||||
}
|
||||
}, this);
|
||||
|
||||
assetCb();
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
ExtractTextPlugin.extract = ExtractTextPlugin.prototype.extract.bind(ExtractTextPlugin);
|
||||
|
||||
|
||||
78
node_modules/extract-text-webpack-plugin/dist/lib/ExtractTextPluginCompilation.js
generated
vendored
78
node_modules/extract-text-webpack-plugin/dist/lib/ExtractTextPluginCompilation.js
generated
vendored
@@ -4,61 +4,55 @@ Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
|
||||
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); /* eslint-disable no-multi-assign */
|
||||
|
||||
|
||||
var _ExtractedModule = require('./ExtractedModule');
|
||||
|
||||
var _ExtractedModule2 = _interopRequireDefault(_ExtractedModule);
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
||||
|
||||
var ExtractTextPluginCompilation = function () {
|
||||
function ExtractTextPluginCompilation() {
|
||||
_classCallCheck(this, ExtractTextPluginCompilation);
|
||||
|
||||
class ExtractTextPluginCompilation {
|
||||
constructor() {
|
||||
this.modulesByIdentifier = {};
|
||||
}
|
||||
|
||||
_createClass(ExtractTextPluginCompilation, [{
|
||||
key: 'addModule',
|
||||
value: function addModule(identifier, originalModule, source, additionalInformation, sourceMap, prevModules) {
|
||||
var m = void 0;
|
||||
if (!this.modulesByIdentifier[identifier]) {
|
||||
m = this.modulesByIdentifier[identifier] = new _ExtractedModule2.default(identifier, originalModule, source, sourceMap, additionalInformation, prevModules);
|
||||
} else {
|
||||
m = this.modulesByIdentifier[identifier];
|
||||
m.addPrevModules(prevModules);
|
||||
if (originalModule.index2 < m.getOriginalModule().index2) {
|
||||
m.setOriginalModule(originalModule);
|
||||
}
|
||||
addModule(identifier, originalModule, source, additionalInformation, sourceMap, prevModules) {
|
||||
let m;
|
||||
|
||||
if (!this.modulesByIdentifier[identifier]) {
|
||||
m = this.modulesByIdentifier[identifier] = new _ExtractedModule2.default(identifier, originalModule, source, sourceMap, additionalInformation, prevModules);
|
||||
} else {
|
||||
m = this.modulesByIdentifier[identifier];
|
||||
m.addPrevModules(prevModules);
|
||||
|
||||
if (originalModule.index2 < m.getOriginalModule().index2) {
|
||||
m.setOriginalModule(originalModule);
|
||||
}
|
||||
return m;
|
||||
}
|
||||
}, {
|
||||
key: 'addResultToChunk',
|
||||
value: function addResultToChunk(identifier, result, originalModule, extractedChunk) {
|
||||
var _this = this;
|
||||
|
||||
if (!Array.isArray(result)) {
|
||||
result = [[identifier, result]];
|
||||
}
|
||||
var counterMap = {};
|
||||
var prevModules = [];
|
||||
result.forEach(function (item) {
|
||||
var c = counterMap[item[0]];
|
||||
var module = _this.addModule.call(_this, item[0] + (c || ''), originalModule, item[1], item[2], item[3], prevModules.slice());
|
||||
extractedChunk.addModule(module);
|
||||
module.addChunk(extractedChunk);
|
||||
counterMap[item[0]] = (c || 0) + 1;
|
||||
prevModules.push(module);
|
||||
}, this);
|
||||
return m;
|
||||
}
|
||||
|
||||
addResultToChunk(identifier, result, originalModule, extractedChunk) {
|
||||
if (!Array.isArray(result)) {
|
||||
result = [[identifier, result]];
|
||||
}
|
||||
}]);
|
||||
|
||||
return ExtractTextPluginCompilation;
|
||||
}();
|
||||
const counterMap = {};
|
||||
const prevModules = [];
|
||||
|
||||
result.forEach(item => {
|
||||
const c = counterMap[item[0]];
|
||||
const module = this.addModule.call(this, item[0] + (c || ''), originalModule, item[1], item[2], item[3], prevModules.slice());
|
||||
|
||||
extractedChunk.addModule(module);
|
||||
// extractedChunk.removeModule(originalModule);
|
||||
module.addChunk(extractedChunk);
|
||||
counterMap[item[0]] = (c || 0) + 1;
|
||||
prevModules.push(module);
|
||||
}, this);
|
||||
}
|
||||
} /* eslint-disable
|
||||
no-multi-assign,
|
||||
no-param-reassign
|
||||
*/
|
||||
exports.default = ExtractTextPluginCompilation;
|
||||
133
node_modules/extract-text-webpack-plugin/dist/lib/ExtractedModule.js
generated
vendored
133
node_modules/extract-text-webpack-plugin/dist/lib/ExtractedModule.js
generated
vendored
@@ -4,97 +4,74 @@ Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
|
||||
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
|
||||
|
||||
var _webpackSources = require('webpack-sources');
|
||||
|
||||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
||||
|
||||
var ExtractedModule = function () {
|
||||
function ExtractedModule(identifier, originalModule, source, sourceMap, addtitionalInformation, prevModules) {
|
||||
_classCallCheck(this, ExtractedModule);
|
||||
|
||||
class ExtractedModule {
|
||||
constructor(identifier, originalModule, source, sourceMap, additionalInformation, prevModules) {
|
||||
this._identifier = identifier;
|
||||
this._originalModule = originalModule;
|
||||
this._source = source;
|
||||
this._sourceMap = sourceMap;
|
||||
this._prevModules = prevModules;
|
||||
this.addtitionalInformation = addtitionalInformation;
|
||||
this.additionalInformation = additionalInformation;
|
||||
this.chunks = [];
|
||||
}
|
||||
|
||||
_createClass(ExtractedModule, [{
|
||||
key: 'getOrder',
|
||||
value: function getOrder() {
|
||||
// http://stackoverflow.com/a/14676665/1458162
|
||||
return (/^@import url/.test(this._source) ? 0 : 1
|
||||
);
|
||||
}
|
||||
}, {
|
||||
key: 'addChunk',
|
||||
value: function addChunk(chunk) {
|
||||
var idx = this.chunks.indexOf(chunk);
|
||||
if (idx < 0) {
|
||||
this.chunks.push(chunk);
|
||||
}
|
||||
}
|
||||
}, {
|
||||
key: 'removeChunk',
|
||||
value: function removeChunk(chunk) {
|
||||
var idx = this.chunks.indexOf(chunk);
|
||||
if (idx >= 0) {
|
||||
this.chunks.splice(idx, 1);
|
||||
chunk.removeModule(this);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}, {
|
||||
key: 'rewriteChunkInReasons',
|
||||
value: function rewriteChunkInReasons(oldChunk, newChunks) {} // eslint-disable-line
|
||||
getOrder() {
|
||||
// http://stackoverflow.com/a/14676665/1458162
|
||||
return (/^@import url/.test(this._source) ? 0 : 1
|
||||
);
|
||||
}
|
||||
|
||||
}, {
|
||||
key: 'identifier',
|
||||
value: function identifier() {
|
||||
return this._identifier;
|
||||
addChunk(chunk) {
|
||||
const idx = this.chunks.indexOf(chunk);
|
||||
if (idx < 0) {
|
||||
this.chunks.push(chunk);
|
||||
}
|
||||
}, {
|
||||
key: 'source',
|
||||
value: function source() {
|
||||
if (this._sourceMap) {
|
||||
return new _webpackSources.SourceMapSource(this._source, null, this._sourceMap);
|
||||
}
|
||||
|
||||
removeChunk(chunk) {
|
||||
const idx = this.chunks.indexOf(chunk);
|
||||
if (idx >= 0) {
|
||||
this.chunks.splice(idx, 1);
|
||||
chunk.removeModule(this);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
rewriteChunkInReasons(oldChunk, newChunks) {} // eslint-disable-line
|
||||
|
||||
identifier() {
|
||||
return this._identifier;
|
||||
}
|
||||
|
||||
source() {
|
||||
if (this._sourceMap) {
|
||||
return new _webpackSources.SourceMapSource(this._source, null, this._sourceMap);
|
||||
}
|
||||
return new _webpackSources.RawSource(this._source);
|
||||
}
|
||||
|
||||
getOriginalModule() {
|
||||
return this._originalModule;
|
||||
}
|
||||
|
||||
getPrevModules() {
|
||||
return this._prevModules;
|
||||
}
|
||||
|
||||
addPrevModules(prevModules) {
|
||||
prevModules.forEach(m => {
|
||||
if (this._prevModules.indexOf(m) < 0) {
|
||||
this._prevModules.push(m);
|
||||
}
|
||||
return new _webpackSources.RawSource(this._source);
|
||||
}
|
||||
}, {
|
||||
key: 'getOriginalModule',
|
||||
value: function getOriginalModule() {
|
||||
return this._originalModule;
|
||||
}
|
||||
}, {
|
||||
key: 'getPrevModules',
|
||||
value: function getPrevModules() {
|
||||
return this._prevModules;
|
||||
}
|
||||
}, {
|
||||
key: 'addPrevModules',
|
||||
value: function addPrevModules(prevModules) {
|
||||
var _this = this;
|
||||
}, this);
|
||||
}
|
||||
|
||||
prevModules.forEach(function (m) {
|
||||
if (_this._prevModules.indexOf(m) < 0) {
|
||||
_this._prevModules.push(m);
|
||||
}
|
||||
}, this);
|
||||
}
|
||||
}, {
|
||||
key: 'setOriginalModule',
|
||||
value: function setOriginalModule(originalModule) {
|
||||
this._originalModule = originalModule;
|
||||
}
|
||||
}]);
|
||||
|
||||
return ExtractedModule;
|
||||
}();
|
||||
setOriginalModule(originalModule) {
|
||||
this._originalModule = originalModule;
|
||||
}
|
||||
}
|
||||
|
||||
exports.default = ExtractedModule;
|
||||
85
node_modules/extract-text-webpack-plugin/dist/lib/helpers.js
generated
vendored
85
node_modules/extract-text-webpack-plugin/dist/lib/helpers.js
generated
vendored
@@ -11,33 +11,80 @@ exports.mergeOptions = mergeOptions;
|
||||
exports.isString = isString;
|
||||
exports.isFunction = isFunction;
|
||||
exports.isType = isType;
|
||||
/* eslint-disable
|
||||
no-param-reassign
|
||||
*/
|
||||
function isInitialOrHasNoParents(chunk) {
|
||||
return chunk.isInitial() || chunk.parents.length === 0;
|
||||
let parentCount = 0;
|
||||
|
||||
for (const chunkGroup of chunk.groupsIterable) {
|
||||
parentCount += chunkGroup.getNumberOfParents();
|
||||
}
|
||||
|
||||
return chunk.isOnlyInitial() || parentCount === 0;
|
||||
}
|
||||
|
||||
function isInvalidOrder(a, b) {
|
||||
var bBeforeA = a.getPrevModules().indexOf(b) >= 0;
|
||||
var aBeforeB = b.getPrevModules().indexOf(a) >= 0;
|
||||
return aBeforeB && bBeforeA;
|
||||
// Async chunks' modules don't get turned into ExtractedModule
|
||||
// instances for some reason. This is a temporary fix that
|
||||
// moves the isInvalidOrder check inside a condition.
|
||||
if (a.getPrevModules && b.getPrevModules) {
|
||||
const bBeforeA = a.getPrevModules().indexOf(b) >= 0;
|
||||
const aBeforeB = b.getPrevModules().indexOf(a) >= 0;
|
||||
|
||||
return aBeforeB && bBeforeA;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
function getOrder(a, b) {
|
||||
var aOrder = a.getOrder();
|
||||
var bOrder = b.getOrder();
|
||||
if (aOrder < bOrder) return -1;
|
||||
if (aOrder > bOrder) return 1;
|
||||
var aIndex = a.getOriginalModule().index2;
|
||||
var bIndex = b.getOriginalModule().index2;
|
||||
if (aIndex < bIndex) return -1;
|
||||
if (aIndex > bIndex) return 1;
|
||||
var bBeforeA = a.getPrevModules().indexOf(b) >= 0;
|
||||
var aBeforeB = b.getPrevModules().indexOf(a) >= 0;
|
||||
if (aBeforeB && !bBeforeA) return -1;
|
||||
if (!aBeforeB && bBeforeA) return 1;
|
||||
var ai = a.identifier();
|
||||
var bi = b.identifier();
|
||||
// Async chunks' modules don't get turned into ExtractedModule
|
||||
// instances for some reason. This is a temporary fix that
|
||||
// moves the custom sorting logic inside a condition.
|
||||
if (a.getOriginalModule && b.getOriginalModule) {
|
||||
const aOrder = a.getOrder();
|
||||
const bOrder = b.getOrder();
|
||||
if (aOrder < bOrder) return -1;
|
||||
if (aOrder > bOrder) return 1;
|
||||
|
||||
// We are trying to use the underlying index2 property
|
||||
// of the original module, but this property seems
|
||||
// to be set to null most of the time. It makes
|
||||
// sorting with it pointless. We should look
|
||||
// into saving the index, index2 and depth
|
||||
// props (maybe inside ExtractedModule).
|
||||
const aIndex = a.getOriginalModule().index2;
|
||||
const bIndex = b.getOriginalModule().index2;
|
||||
if (aIndex < bIndex) return -1;
|
||||
if (aIndex > bIndex) return 1;
|
||||
|
||||
const bBeforeA = a.getPrevModules().indexOf(b) >= 0;
|
||||
const aBeforeB = b.getPrevModules().indexOf(a) >= 0;
|
||||
if (aBeforeB && !bBeforeA) return -1;
|
||||
if (!aBeforeB && bBeforeA) return 1;
|
||||
|
||||
// Sorting by id is the default behavior of webpack
|
||||
// and it keeps the modules in the correct order,
|
||||
// except for async imports. That's the reason
|
||||
// it is inside the conditional branch
|
||||
if (a.id < b.id) return -1;
|
||||
if (a.id > b.id) return 1;
|
||||
}
|
||||
|
||||
// Sorting by identifier breaks the order of async imported
|
||||
// modules either because webpack sorts them by default,
|
||||
// or because they are processed in the correct order
|
||||
// in the first place, or maybe because the modules
|
||||
// aren't ExtractedModule instances in this case.
|
||||
// Returning 0 keeps the already correct order.
|
||||
/*
|
||||
const ai = a.identifier();
|
||||
const bi = b.identifier();
|
||||
if (ai < bi) return -1;
|
||||
if (ai > bi) return 1;
|
||||
*/
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -50,7 +97,7 @@ function getLoaderObject(loader) {
|
||||
|
||||
function mergeOptions(a, b) {
|
||||
if (!b) return a;
|
||||
Object.keys(b).forEach(function (key) {
|
||||
Object.keys(b).forEach(key => {
|
||||
a[key] = b[key];
|
||||
});
|
||||
return a;
|
||||
|
||||
99
node_modules/extract-text-webpack-plugin/dist/loader.js
generated
vendored
99
node_modules/extract-text-webpack-plugin/dist/loader.js
generated
vendored
@@ -39,21 +39,23 @@ var _LimitChunkCountPlugin2 = _interopRequireDefault(_LimitChunkCountPlugin);
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
var NS = _path2.default.dirname(_fs2.default.realpathSync(__filename));
|
||||
/* eslint-disable
|
||||
consistent-return,
|
||||
no-param-reassign
|
||||
*/
|
||||
const NS = _path2.default.dirname(_fs2.default.realpathSync(__filename));
|
||||
const plugin = { name: 'ExtractTextPlugin' };
|
||||
|
||||
exports.default = function (source) {
|
||||
return source;
|
||||
};
|
||||
exports.default = source => source;
|
||||
|
||||
function pitch(request) {
|
||||
var _this = this;
|
||||
|
||||
var query = _loaderUtils2.default.getOptions(this) || {};
|
||||
var loaders = this.loaders.slice(this.loaderIndex + 1);
|
||||
const query = _loaderUtils2.default.getOptions(this) || {};
|
||||
let loaders = this.loaders.slice(this.loaderIndex + 1);
|
||||
this.addDependency(this.resourcePath);
|
||||
|
||||
// We already in child compiler, return empty bundle
|
||||
// eslint-disable-next-line no-undefined
|
||||
if (this[NS] === undefined) {
|
||||
// eslint-disable-line no-undefined
|
||||
throw new Error('"extract-text-webpack-plugin" loader is used without the corresponding plugin, ' + 'refer to https://github.com/webpack/extract-text-webpack-plugin for the usage example');
|
||||
} else if (this[NS] === false) {
|
||||
return '';
|
||||
@@ -63,32 +65,36 @@ function pitch(request) {
|
||||
request = request.split('!').slice(+query.omit).join('!');
|
||||
loaders = loaders.slice(+query.omit);
|
||||
}
|
||||
var resultSource = void 0;
|
||||
|
||||
let resultSource;
|
||||
if (query.remove) {
|
||||
resultSource = '// removed by extract-text-webpack-plugin';
|
||||
} else {
|
||||
resultSource = undefined; // eslint-disable-line no-undefined
|
||||
}
|
||||
|
||||
var childFilename = 'extract-text-webpack-plugin-output-filename'; // eslint-disable-line no-path-concat
|
||||
var publicPath = typeof query.publicPath === 'string' ? query.publicPath : this._compilation.outputOptions.publicPath;
|
||||
var outputOptions = {
|
||||
const childFilename = 'extract-text-webpack-plugin-output-filename'; // eslint-disable-line no-path-concat
|
||||
const publicPath = typeof query.publicPath === 'string' ? query.publicPath : this._compilation.outputOptions.publicPath;
|
||||
const outputOptions = {
|
||||
filename: childFilename,
|
||||
publicPath
|
||||
};
|
||||
var childCompiler = this._compilation.createChildCompiler(`extract-text-webpack-plugin ${NS} ${request}`, outputOptions);
|
||||
childCompiler.apply(new _NodeTemplatePlugin2.default(outputOptions));
|
||||
childCompiler.apply(new _LibraryTemplatePlugin2.default(null, 'commonjs2'));
|
||||
childCompiler.apply(new _NodeTargetPlugin2.default());
|
||||
childCompiler.apply(new _SingleEntryPlugin2.default(this.context, `!!${request}`));
|
||||
childCompiler.apply(new _LimitChunkCountPlugin2.default({ maxChunks: 1 }));
|
||||
|
||||
const childCompiler = this._compilation.createChildCompiler(`extract-text-webpack-plugin ${NS} ${request}`, outputOptions);
|
||||
|
||||
new _NodeTemplatePlugin2.default(outputOptions).apply(childCompiler);
|
||||
new _LibraryTemplatePlugin2.default(null, 'commonjs2').apply(childCompiler);
|
||||
new _NodeTargetPlugin2.default().apply(childCompiler);
|
||||
new _SingleEntryPlugin2.default(this.context, `!!${request}`).apply(childCompiler);
|
||||
new _LimitChunkCountPlugin2.default({ maxChunks: 1 }).apply(childCompiler);
|
||||
|
||||
// We set loaderContext[NS] = false to indicate we already in
|
||||
// a child compiler so we don't spawn another child compilers from there.
|
||||
childCompiler.plugin('this-compilation', function (compilation) {
|
||||
compilation.plugin('normal-module-loader', function (loaderContext, module) {
|
||||
// a child compiler so we don't spawn other child compilers from there.
|
||||
childCompiler.hooks.thisCompilation.tap(plugin, compilation => {
|
||||
compilation.hooks.normalModuleLoader.tap(plugin, (loaderContext, module) => {
|
||||
loaderContext[NS] = false;
|
||||
if (module.request === request) {
|
||||
module.loaders = loaders.map(function (loader) {
|
||||
module.loaders = loaders.map(loader => {
|
||||
return {
|
||||
loader: loader.path,
|
||||
options: loader.options
|
||||
@@ -98,56 +104,65 @@ function pitch(request) {
|
||||
});
|
||||
});
|
||||
|
||||
var source = void 0;
|
||||
childCompiler.plugin('after-compile', function (compilation, callback) {
|
||||
let source;
|
||||
childCompiler.hooks.afterCompile.tap(plugin, compilation => {
|
||||
source = compilation.assets[childFilename] && compilation.assets[childFilename].source();
|
||||
|
||||
// Remove all chunk assets
|
||||
compilation.chunks.forEach(function (chunk) {
|
||||
chunk.files.forEach(function (file) {
|
||||
compilation.chunks.forEach(chunk => {
|
||||
chunk.files.forEach(file => {
|
||||
delete compilation.assets[file];
|
||||
});
|
||||
});
|
||||
|
||||
callback();
|
||||
});
|
||||
var callback = this.async();
|
||||
childCompiler.runAsChild(function (err, entries, compilation) {
|
||||
|
||||
const callback = this.async();
|
||||
childCompiler.runAsChild((err, entries, compilation) => {
|
||||
if (err) return callback(err);
|
||||
|
||||
if (compilation.errors.length > 0) {
|
||||
return callback(compilation.errors[0]);
|
||||
}
|
||||
compilation.fileDependencies.forEach(function (dep) {
|
||||
_this.addDependency(dep);
|
||||
}, _this);
|
||||
compilation.contextDependencies.forEach(function (dep) {
|
||||
_this.addContextDependency(dep);
|
||||
}, _this);
|
||||
|
||||
compilation.fileDependencies.forEach(dep => {
|
||||
this.addDependency(dep);
|
||||
}, this);
|
||||
|
||||
compilation.contextDependencies.forEach(dep => {
|
||||
this.addContextDependency(dep);
|
||||
}, this);
|
||||
|
||||
if (!source) {
|
||||
return callback(new Error("Didn't get a result from child compiler"));
|
||||
}
|
||||
|
||||
try {
|
||||
var text = _this.exec(source, request);
|
||||
let text = this.exec(source, request);
|
||||
|
||||
if (typeof text === 'string') {
|
||||
text = [[compilation.entries[0].identifier(), text]];
|
||||
} else {
|
||||
text.forEach(function (item) {
|
||||
var id = item[0];
|
||||
compilation.modules.forEach(function (module) {
|
||||
text.forEach(item => {
|
||||
const [id] = item;
|
||||
|
||||
compilation.modules.forEach(module => {
|
||||
if (module.id === id) {
|
||||
item[0] = module.identifier();
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
_this[NS](text, query);
|
||||
|
||||
this[NS](text, query);
|
||||
|
||||
// NOTE: converting this to ESM will require changes to renderExtractedChunk
|
||||
if (text.locals && typeof resultSource !== 'undefined') {
|
||||
resultSource += `\nmodule.exports = ${JSON.stringify(text.locals)};`;
|
||||
}
|
||||
} catch (e) {
|
||||
return callback(e);
|
||||
}
|
||||
|
||||
if (resultSource) {
|
||||
callback(null, resultSource);
|
||||
} else {
|
||||
|
||||
95
node_modules/extract-text-webpack-plugin/package.json
generated
vendored
95
node_modules/extract-text-webpack-plugin/package.json
generated
vendored
@@ -1,26 +1,26 @@
|
||||
{
|
||||
"_from": "extract-text-webpack-plugin@^3.0.2",
|
||||
"_id": "extract-text-webpack-plugin@3.0.2",
|
||||
"_from": "extract-text-webpack-plugin@v4.0.0-beta.0",
|
||||
"_id": "extract-text-webpack-plugin@4.0.0-beta.0",
|
||||
"_inBundle": false,
|
||||
"_integrity": "sha512-bt/LZ4m5Rqt/Crl2HiKuAl/oqg0psx1tsTLkvWbJen1CtD+fftkZhMaQ9HOtY2gWsl2Wq+sABmMVi9z3DhKWQQ==",
|
||||
"_integrity": "sha512-Hypkn9jUTnFr0DpekNam53X47tXn3ucY08BQumv7kdGgeVUBLq3DJHJTi6HNxv4jl9W+Skxjz9+RnK0sJyqqjA==",
|
||||
"_location": "/extract-text-webpack-plugin",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"type": "range",
|
||||
"type": "version",
|
||||
"registry": true,
|
||||
"raw": "extract-text-webpack-plugin@^3.0.2",
|
||||
"raw": "extract-text-webpack-plugin@v4.0.0-beta.0",
|
||||
"name": "extract-text-webpack-plugin",
|
||||
"escapedName": "extract-text-webpack-plugin",
|
||||
"rawSpec": "^3.0.2",
|
||||
"rawSpec": "v4.0.0-beta.0",
|
||||
"saveSpec": null,
|
||||
"fetchSpec": "^3.0.2"
|
||||
"fetchSpec": "v4.0.0-beta.0"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/laravel-mix"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/extract-text-webpack-plugin/-/extract-text-webpack-plugin-3.0.2.tgz",
|
||||
"_shasum": "5f043eaa02f9750a9258b78c0a6e0dc1408fb2f7",
|
||||
"_spec": "extract-text-webpack-plugin@^3.0.2",
|
||||
"_resolved": "https://registry.npmjs.org/extract-text-webpack-plugin/-/extract-text-webpack-plugin-4.0.0-beta.0.tgz",
|
||||
"_shasum": "f7361d7ff430b42961f8d1321ba8c1757b5d4c42",
|
||||
"_spec": "extract-text-webpack-plugin@v4.0.0-beta.0",
|
||||
"_where": "C:\\xampp\\htdocs\\w4rpservices\\node_modules\\laravel-mix",
|
||||
"author": {
|
||||
"name": "Tobias Koppers @sokra"
|
||||
@@ -32,42 +32,52 @@
|
||||
"dependencies": {
|
||||
"async": "^2.4.1",
|
||||
"loader-utils": "^1.1.0",
|
||||
"schema-utils": "^0.3.0",
|
||||
"webpack-sources": "^1.0.1"
|
||||
"schema-utils": "^0.4.5",
|
||||
"webpack-sources": "^1.1.0"
|
||||
},
|
||||
"deprecated": false,
|
||||
"description": "Extract text from bundle into a file.",
|
||||
"devDependencies": {
|
||||
"@commitlint/cli": "^5.2.8",
|
||||
"@commitlint/config-angular": "^5.1.1",
|
||||
"@webpack-contrib/eslint-config-webpack": "^2.0.2",
|
||||
"babel-cli": "^6.26.0",
|
||||
"babel-jest": "^21.2.0",
|
||||
"babel-jest": "^22.2.2",
|
||||
"babel-plugin-transform-object-rest-spread": "^6.26.0",
|
||||
"babel-polyfill": "^6.26.0",
|
||||
"babel-preset-env": "^1.6.1",
|
||||
"cross-env": "^5.1.0",
|
||||
"css-loader": "^0.28.7",
|
||||
"conventional-github-releaser": "^2.0.0",
|
||||
"cross-env": "^5.1.3",
|
||||
"css-loader": "^0.28.9",
|
||||
"del": "^3.0.0",
|
||||
"del-cli": "^1.1.0",
|
||||
"eslint": "^4.9.0",
|
||||
"eslint-config-webpack": "^1.2.5",
|
||||
"eslint": "^4.17.0",
|
||||
"eslint-plugin-import": "^2.8.0",
|
||||
"file-loader": "^1.1.5",
|
||||
"jest": "^21.2.1",
|
||||
"lint-staged": "^4.3.0",
|
||||
"nsp": "^2.8.1",
|
||||
"eslint-plugin-prettier": "^2.6.0",
|
||||
"file-loader": "^1.1.6",
|
||||
"husky": "^0.14.3",
|
||||
"jest": "^22.3.0",
|
||||
"lint-staged": "^6.1.0",
|
||||
"memory-fs": "^0.4.1",
|
||||
"nsp": "^3.1.0",
|
||||
"pre-commit": "^1.2.2",
|
||||
"prettier": "^1.10.2",
|
||||
"raw-loader": "^0.5.1",
|
||||
"standard-version": "^4.2.0",
|
||||
"style-loader": "^0.19.0",
|
||||
"webpack": "^3.8.1",
|
||||
"webpack-defaults": "^1.6.0"
|
||||
"standard-version": "^4.3.0",
|
||||
"style-loader": "^0.19.1",
|
||||
"webpack": "^4.0.0",
|
||||
"webpack-defaults": "^2.0.0-rc.4"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 4.8 < 5.0.0 || >= 5.10"
|
||||
"node": ">= 6.9.0 || >= 8.9.0"
|
||||
},
|
||||
"files": [
|
||||
"dist",
|
||||
"schema"
|
||||
"dist"
|
||||
],
|
||||
"homepage": "http://github.com/webpack-contrib/extract-text-webpack-plugin",
|
||||
"homepage": "https://github.com/webpack-contrib/extract-text-webpack-plugin",
|
||||
"jest": {
|
||||
"testEnvironment": "node"
|
||||
},
|
||||
"license": "MIT",
|
||||
"lint-staged": {
|
||||
"*.js": [
|
||||
@@ -78,32 +88,35 @@
|
||||
"main": "dist/cjs.js",
|
||||
"name": "extract-text-webpack-plugin",
|
||||
"peerDependencies": {
|
||||
"webpack": "^3.1.0"
|
||||
"webpack": "^3.0.0 || ^4.0.0"
|
||||
},
|
||||
"pre-commit": "lint-staged",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+ssh://git@github.com/webpack-contrib/extract-text-webpack-plugin.git"
|
||||
"url": "git+https://github.com/webpack-contrib/extract-text-webpack-plugin.git"
|
||||
},
|
||||
"scripts": {
|
||||
"appveyor:test": "npm run test",
|
||||
"build": "cross-env NODE_ENV=production babel src -d dist --ignore 'src/**/*.test.js'",
|
||||
"build:example": "(cd example && webpack)",
|
||||
"build": "cross-env NODE_ENV=production babel src -d dist --ignore 'src/**/*.test.js' --copy-files",
|
||||
"ci:coverage": "npm run test:coverage -- --runInBand",
|
||||
"ci:lint": "npm run lint && npm run security",
|
||||
"ci:lint:commits": "commitlint --from=${CIRCLE_BRANCH} --to=${CIRCLE_SHA1}",
|
||||
"ci:test": "npm run test -- --runInBand",
|
||||
"clean": "del-cli dist",
|
||||
"commitlint": "commitlint",
|
||||
"commitmsg": "commitlint -e $GIT_PARAMS",
|
||||
"defaults": "webpack-defaults",
|
||||
"lint": "eslint --cache src test",
|
||||
"lint-staged": "lint-staged",
|
||||
"prebuild": "npm run clean",
|
||||
"prepublish": "npm run build",
|
||||
"prepare": "npm run build",
|
||||
"release": "standard-version",
|
||||
"release:ci": "conventional-github-releaser -p angular",
|
||||
"release:validate": "commitlint --from=$(git describe --tags --abbrev=0) --to=$(git rev-parse HEAD)",
|
||||
"security": "nsp check",
|
||||
"start": "npm run build -- -w",
|
||||
"test": "jest",
|
||||
"test:coverage": "jest --collectCoverageFrom='src/**/*.js' --coverage",
|
||||
"test:watch": "jest --watch",
|
||||
"travis:coverage": "npm run test:coverage -- --runInBand",
|
||||
"travis:lint": "npm run lint && npm run security",
|
||||
"travis:test": "npm run test -- --runInBand",
|
||||
"webpack-defaults": "webpack-defaults"
|
||||
"test:watch": "jest --watch"
|
||||
},
|
||||
"version": "3.0.2"
|
||||
"version": "4.0.0-beta.0"
|
||||
}
|
||||
|
||||
30
node_modules/extract-text-webpack-plugin/schema/loader.json
generated
vendored
30
node_modules/extract-text-webpack-plugin/schema/loader.json
generated
vendored
@@ -1,30 +0,0 @@
|
||||
{
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"properties": {
|
||||
"allChunks": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"disable": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"omit": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"remove": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"fallback": {
|
||||
"type": ["string", "array", "object"]
|
||||
},
|
||||
"filename": {
|
||||
"type": "string"
|
||||
},
|
||||
"use": {
|
||||
"type": ["string", "array", "object"]
|
||||
},
|
||||
"publicPath": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
}
|
||||
40
node_modules/extract-text-webpack-plugin/schema/plugin.json
generated
vendored
40
node_modules/extract-text-webpack-plugin/schema/plugin.json
generated
vendored
@@ -1,40 +0,0 @@
|
||||
{
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"properties": {
|
||||
"allChunks": {
|
||||
"description": "",
|
||||
"type": "boolean"
|
||||
},
|
||||
"disable": {
|
||||
"description": "",
|
||||
"type": "boolean"
|
||||
},
|
||||
"fallback": {
|
||||
"description": "A loader that webpack can fall back to if the original one fails.",
|
||||
"modes": {
|
||||
"type": ["string", "object", "array"]
|
||||
}
|
||||
},
|
||||
"filename": {
|
||||
"description": "The filename and path that ExtractTextPlugin will extract to",
|
||||
"modes": {
|
||||
"type": ["string", "function"]
|
||||
}
|
||||
},
|
||||
"ignoreOrder": {
|
||||
"description": "Ignore dependency order (useful for CSS Modules)",
|
||||
"type": "boolean"
|
||||
},
|
||||
"loader": {
|
||||
"description": "The loader that ExtractTextPlugin will attempt to load through.",
|
||||
"modes": {
|
||||
"type": ["string", "object", "array"]
|
||||
}
|
||||
},
|
||||
"publicPath": {
|
||||
"description": "",
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user