UNPKG

kkt

Version:

Create React apps with no build configuration, Cli tool for creating react apps.

49 lines (48 loc) 1.89 kB
"use strict"; var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault")["default"]; Object.defineProperty(exports, "__esModule", { value: true }); Object.defineProperty(exports, "MiniCssExtractPlugin", { enumerable: true, get: function get() { return _miniCssExtractPlugin["default"]; } }); exports.miniCssExtractPlugin = void 0; var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2")); var _miniCssExtractPlugin = _interopRequireDefault(require("mini-css-extract-plugin")); /** * Fix Conflicting order * https://github.com/webpack-contrib/mini-css-extract-plugin/issues/250#issuecomment-532483344 * https://github.com/webpack-contrib/mini-css-extract-plugin/issues/493 * https://github.com/kktjs/kkt/issues/336 * * ``` * No module factory available for dependency type: CssDependency * chunk 0 [mini-css-extract-plugin] * Conflicting order. Following module has been added: * ``` * @param conf * @param options */ var miniCssExtractPlugin = exports.miniCssExtractPlugin = function miniCssExtractPlugin(conf, env) { var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; var regexp = /(MiniCssExtractPlugin)/; conf.plugins = (conf.plugins || []).map(function (item) { if (item && item.constructor && item.constructor.name && regexp.test(item.constructor.name)) { return new _miniCssExtractPlugin["default"]((0, _objectSpread2["default"])({ // Options similar to the same options in webpackOptions.output // both options are optional filename: 'static/css/[name].[contenthash:8].css', chunkFilename: 'static/css/[name].[contenthash:8].chunk.css', /** * @error Fix Conflicting order */ ignoreOrder: true }, options)); } return item; }).filter(Boolean); return conf; };