{"_id":"@clubdrei/mini-css-extract-plugin","_rev":"6-94802809506721296d894e9254859d37","name":"@clubdrei/mini-css-extract-plugin","dist-tags":{"latest":"0.9.0"},"versions":{"0.9.0":{"name":"@clubdrei/mini-css-extract-plugin","version":"0.9.0","keywords":["webpack","css","extract","hmr"],"author":{"name":"Tobias Koppers @sokra"},"license":"MIT","_id":"@clubdrei/mini-css-extract-plugin@0.9.0","maintainers":[{"name":"clubdrei","email":"office@clubdrei.com"}],"homepage":"https://github.com/webpack-contrib/mini-css-extract-plugin","bugs":{"url":"https://github.com/webpack-contrib/mini-css-extract-plugin/issues"},"dist":{"shasum":"e012d5c4cf7eace8178b4cc7b6da04b2dbc465a1","tarball":"https://registry.npmjs.org/@clubdrei/mini-css-extract-plugin/-/mini-css-extract-plugin-0.9.0.tgz","fileCount":10,"integrity":"sha512-7beZg9gtoEkYEKP66DczrabjkyqfjgMYT/p7NjaBEvAC3EWYvEPoz+2kH1LxAI/EmcCUyst/sYzjeXYIrZPdeQ==","signatures":[{"sig":"MEQCIH/BQ2tSwv5LvMsbq0cW28WpYMcK7OoWijD0Yg/XRe7PAiANjptKLxhcNyaOFwOEkmF8GNz/7A+alJvYgK0/bWvUvA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":55138,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfrjHRCRA9TVsSAnZWagAAyY4P/ic+TRxXt62+TnWhKrgW\n7F/h5JL0fxb8CwrljqNCUk297YH5jV4YjmCPefU0pm9JOR/q7Zqvc2FPcKwi\nN3MOEoOrsH/+z+XqcP+W2lT7E4s0kVzT9cwnoVGzwA9uK2CxqI1tCXY53ap7\n39Bn28I50I7LU3x5GR1szmxtQHJ6I3qh2KpjQISuLw5gr/XHu66/YYj/gOjT\nDy+sPA51pCgeKM25Es6UWgu5o5FpHuv0xe8e+2xV7pCLuUcyGSyh443M5GWJ\nwJzw1UsINpI0bidZvJbdApVKBFVoo3+W0xvw3wsaL2x9x1SI5b+UXokTEv+1\nEZzSR9N/P+yhh29f1iLoOoypBqbMjQHbEjTq897fHwh3CMqXArW5Z0ncc9HU\nLPoYhMXnxiqQ03YmOJG6361eqNu7yTi3yhteARq0C1hIWJYDLpHjjcIr1glS\ncHQ+pqhVCiqHWT6Y0/gEI2jSvLqPfwUtSATftKqWzCVKDGexGQSP0I5rX+F5\n7AKTvKEcZHleMP9fdAPC0kteProdxMEv4eWtjo+DPnCxHblummM5cw1O7d5j\ndxEzOz5QY12vHn9JRxEnX09dWKRDRL8Q3cctkkYVgwQBw3huwCMcas7CXgT/\ni7hIDtvnTOlbeWVQUXd/+XxKyKvm9N9ckiwZBXONKZGZ0xlRf7HzJKwdJ3ka\nJjhk\r\n=9Y88\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/cjs.js","_from":"mini-css-extract-plugin@^0.9.0","_spec":"mini-css-extract-plugin@^0.9.0","_where":"/home/chris/Documents/Arbeiten/Kunden/MPREIS/vue-cli-ssr/node_modules/@vue/cli-service","_shasum":"47f2cf07aa165ab35733b1fc97d4c46c0564339e","engines":{"node":">= 6.9.0"},"gitHead":"4ceb0ebb7a1d0763bcf9a8463beb13b308fcb188","scripts":{"lint":"npm-run-all -l -p \"lint:**\"","test":"cross-env NODE_ENV=test npm run test:coverage","build":"cross-env NODE_ENV=production babel src -d dist --ignore \"src/**/*.test.js\" --copy-files","clean":"del-cli dist","start":"npm run build -- -w","lint:js":"eslint --cache src test","pretest":"npm run lint","release":"standard-version","defaults":"webpack-defaults","prebuild":"npm run clean","security":"npm audit","postbuild":"es-check es5 dist/hmr/hotModuleReplacement.js","test:only":"cross-env NODE_ENV=test jest","commitlint":"commitlint --from=master","test:watch":"cross-env NODE_ENV=test jest --watch","test:manual":"npm run build && webpack-dev-server test/manual/src/index.js --open --config test/manual/webpack.config.js","lint:prettier":"prettier \"{**/*,*}.{js,json,md,yml,css}\" --list-different","test:coverage":"cross-env NODE_ENV=test jest --collectCoverageFrom=\"src/**/*.js\" --coverage"},"_npmUser":{"name":"clubdrei","email":"office@clubdrei.com"},"_inBundle":false,"_location":"/mini-css-extract-plugin","_resolved":"https://registry.npmjs.org/mini-css-extract-plugin/-/mini-css-extract-plugin-0.9.0.tgz","_integrity":"sha512-lp3GeY7ygcgAmVIcRPBVhIkf8Us7FZjA+ILpal44qLdSu11wmjKQ3d9k15lfD7pO4esu9eUIAW7qiYIBppv40A==","_requested":{"raw":"mini-css-extract-plugin@^0.9.0","name":"mini-css-extract-plugin","type":"range","rawSpec":"^0.9.0","registry":true,"saveSpec":null,"fetchSpec":"^0.9.0","escapedName":"mini-css-extract-plugin"},"deprecated":"Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.","repository":{"url":"git+https://github.com/webpack-contrib/mini-css-extract-plugin.git","type":"git"},"_npmVersion":"6.14.6","_requiredBy":["/@vue/cli-service"],"description":"extracts CSS into separate files","directories":{},"_nodeVersion":"12.18.3","dependencies":{"loader-utils":"^1.1.0","schema-utils":"^1.0.0","normalize-url":"1.9.1","webpack-sources":"^1.1.0"},"_hasShrinkwrap":false,"devDependencies":{"del":"^4.1.1","jest":"^24.8.0","husky":"^3.0.0","eslint":"^6.7.2","del-cli":"^1.1.0","webpack":"^4.41.3","es-check":"^5.0.0","prettier":"^1.19.1","cross-env":"^5.2.0","memory-fs":"^0.4.1","@babel/cli":"^7.7.5","babel-jest":"^24.8.0","css-loader":"^3.3.2","jest-junit":"^10.0.0","@babel/core":"^7.7.5","file-loader":"^4.0.0","lint-staged":"^9.5.0","npm-run-all":"^4.1.5","webpack-cli":"^3.3.6","babel-eslint":"^10.0.2","@commitlint/cli":"^8.1.0","standard-version":"^7.0.1","@babel/preset-env":"^7.7.6","webpack-dev-server":"^3.7.2","eslint-plugin-import":"^2.19.1","eslint-config-prettier":"^6.0.0","@webpack-contrib/defaults":"^5.0.2","commitlint-azure-pipelines-cli":"^1.0.2","@commitlint/config-conventional":"^8.1.0","@webpack-contrib/eslint-config-webpack":"^3.0.0"},"_phantomChildren":{"ajv":"6.12.6","sort-keys":"1.1.2","ajv-errors":"1.0.1","ajv-keywords":"3.5.2","prepend-http":"1.0.4","query-string":"4.3.4","object-assign":"4.1.1"},"peerDependencies":{"webpack":"^4.4.0"},"_npmOperationalInternal":{"tmp":"tmp/mini-css-extract-plugin_0.9.0_1605251536873_0.9037596537886934","host":"s3://npm-registry-packages"}}},"time":{"created":"2020-11-13T07:12:16.836Z","modified":"2026-01-08T11:47:22.042Z","0.9.0":"2020-11-13T07:12:17.030Z"},"bugs":{"url":"https://github.com/webpack-contrib/mini-css-extract-plugin/issues"},"author":{"name":"Tobias Koppers @sokra"},"license":"MIT","homepage":"https://github.com/webpack-contrib/mini-css-extract-plugin","keywords":["webpack","css","extract","hmr"],"repository":{"url":"git+https://github.com/webpack-contrib/mini-css-extract-plugin.git","type":"git"},"description":"extracts CSS into separate files","maintainers":[{"email":"aleksandar.spasojevic@clubdrei.com","name":"aspasojevic-c3"},{"email":"chris@clubdrei.com","name":"clubdrei_chris"}],"readme":"<div align=\"center\">\n  <!-- replace with accurate logo e.g from https://worldvectorlogo.com/ -->\n  <img width=\"200\" height=\"200\" src=\"https://cdn.worldvectorlogo.com/logos/javascript.svg\">\n  <a href=\"https://webpack.js.org/\">\n    <img width=\"200\" height=\"200\" vspace=\"\" hspace=\"25\" src=\"https://cdn.rawgit.com/webpack/media/e7485eb2/logo/icon-square-big.svg\">\n  </a>\n  <h1>mini-css-extract-plugin</h1>\n</div>\n\n[![npm][npm]][npm-url]\n[![deps][deps]][deps-url]\n[![tests][tests]][tests-url]\n[![coverage][cover]][cover-url]\n[![chat][chat]][chat-url]\n\nThis plugin extracts CSS into separate files. It creates a CSS file per JS file which contains CSS. It supports On-Demand-Loading of CSS and SourceMaps.\n\nIt builds on top of a new webpack v4 feature (module types) and requires webpack 4 to work.\n\nCompared to the extract-text-webpack-plugin:\n\n- Async loading\n- No duplicate compilation (performance)\n- Easier to use\n- Specific to CSS\n\n<h2 align=\"center\">Install</h2>\n\n```bash\nnpm install --save-dev mini-css-extract-plugin\n```\n\n<h2 align=\"center\">Usage</h2>\n\n### Configuration\n\n#### `publicPath`\n\nType: `String|Function`\nDefault: the `publicPath` in `webpackOptions.output`\n\nSpecifies a custom public path for the target file(s).\n\n#### `esModule`\n\nType: `Boolean`\nDefault: `false`\n\nBy default, `mini-css-extract-plugin` generates JS modules that use the CommonJS modules syntax.\nThere are some cases in which using ES modules is beneficial, like in the case of [module concatenation](https://webpack.js.org/plugins/module-concatenation-plugin/) and [tree shaking](https://webpack.js.org/guides/tree-shaking/).\n\nYou can enable a ES module syntax using:\n\n**webpack.config.js**\n\n```js\nconst MiniCssExtractPlugin = require('mini-css-extract-plugin');\n\nmodule.exports = {\n  plugins: [new MiniCssExtractPlugin()],\n  module: {\n    rules: [\n      {\n        test: /\\.css$/i,\n        use: [\n          {\n            loader: MiniCssExtractPlugin.loader,\n            options: {\n              esModule: true,\n            },\n          },\n          'css-loader',\n        ],\n      },\n    ],\n  },\n};\n```\n\n#### Minimal example\n\n**webpack.config.js**\n\n```js\nconst MiniCssExtractPlugin = require('mini-css-extract-plugin');\n\nmodule.exports = {\n  plugins: [\n    new MiniCssExtractPlugin({\n      // Options similar to the same options in webpackOptions.output\n      // all options are optional\n      filename: '[name].css',\n      chunkFilename: '[id].css',\n      ignoreOrder: false, // Enable to remove warnings about conflicting order\n    }),\n  ],\n  module: {\n    rules: [\n      {\n        test: /\\.css$/,\n        use: [\n          {\n            loader: MiniCssExtractPlugin.loader,\n            options: {\n              // you can specify a publicPath here\n              // by default it uses publicPath in webpackOptions.output\n              publicPath: '../',\n              hmr: process.env.NODE_ENV === 'development',\n            },\n          },\n          'css-loader',\n        ],\n      },\n    ],\n  },\n};\n```\n\n#### `publicPath` function example\n\n**webpack.config.js**\n\n```js\nconst MiniCssExtractPlugin = require('mini-css-extract-plugin');\nmodule.exports = {\n  plugins: [\n    new MiniCssExtractPlugin({\n      // Options similar to the same options in webpackOptions.output\n      // both options are optional\n      filename: '[name].css',\n      chunkFilename: '[id].css',\n    }),\n  ],\n  module: {\n    rules: [\n      {\n        test: /\\.css$/,\n        use: [\n          {\n            loader: MiniCssExtractPlugin.loader,\n            options: {\n              publicPath: (resourcePath, context) => {\n                // publicPath is the relative path of the resource to the context\n                // e.g. for ./css/admin/main.css the publicPath will be ../../\n                // while for ./css/main.css the publicPath will be ../\n                return path.relative(path.dirname(resourcePath), context) + '/';\n              },\n            },\n          },\n          'css-loader',\n        ],\n      },\n    ],\n  },\n};\n```\n\n#### Advanced configuration example\n\nThis plugin should be used only on `production` builds without `style-loader` in the loaders chain, especially if you want to have HMR in `development`.\n\nHere is an example to have both HMR in `development` and your styles extracted in a file for `production` builds.\n\n(Loaders options left out for clarity, adapt accordingly to your needs.)\n\n**webpack.config.js**\n\n```js\nconst MiniCssExtractPlugin = require('mini-css-extract-plugin');\nconst devMode = process.env.NODE_ENV !== 'production';\n\nmodule.exports = {\n  plugins: [\n    new MiniCssExtractPlugin({\n      // Options similar to the same options in webpackOptions.output\n      // both options are optional\n      filename: devMode ? '[name].css' : '[name].[hash].css',\n      chunkFilename: devMode ? '[id].css' : '[id].[hash].css',\n    }),\n  ],\n  module: {\n    rules: [\n      {\n        test: /\\.(sa|sc|c)ss$/,\n        use: [\n          {\n            loader: MiniCssExtractPlugin.loader,\n            options: {\n              hmr: process.env.NODE_ENV === 'development',\n            },\n          },\n          'css-loader',\n          'postcss-loader',\n          'sass-loader',\n        ],\n      },\n    ],\n  },\n};\n```\n\n#### Hot Module Reloading (HMR)\n\nextract-mini-css-plugin supports hot reloading of actual css files in development. Some options are provided to enable HMR of both standard stylesheets and locally scoped CSS or CSS modules. Below is an example configuration of mini-css for HMR use with CSS modules.\n\nWhile we attempt to hmr css-modules. It is not easy to perform when code-splitting with custom chunk names. `reloadAll` is an option that should only be enabled if HMR isn't working correctly. The core challenge with css-modules is that when code-split, the chunk ids can and do end up different compared to the filename.\n\n**webpack.config.js**\n\n```js\nconst MiniCssExtractPlugin = require('mini-css-extract-plugin');\nmodule.exports = {\n  plugins: [\n    new MiniCssExtractPlugin({\n      // Options similar to the same options in webpackOptions.output\n      // both options are optional\n      filename: '[name].css',\n      chunkFilename: '[id].css',\n    }),\n  ],\n  module: {\n    rules: [\n      {\n        test: /\\.css$/,\n        use: [\n          {\n            loader: MiniCssExtractPlugin.loader,\n            options: {\n              // only enable hot in development\n              hmr: process.env.NODE_ENV === 'development',\n              // if hmr does not work, this is a forceful method.\n              reloadAll: true,\n            },\n          },\n          'css-loader',\n        ],\n      },\n    ],\n  },\n};\n```\n\n### Minimizing For Production\n\nTo minify the output, use a plugin like [optimize-css-assets-webpack-plugin](https://github.com/NMFR/optimize-css-assets-webpack-plugin). Setting `optimization.minimizer` overrides the defaults provided by webpack, so make sure to also specify a JS minimizer:\n\n**webpack.config.js**\n\n```js\nconst TerserJSPlugin = require('terser-webpack-plugin');\nconst MiniCssExtractPlugin = require('mini-css-extract-plugin');\nconst OptimizeCSSAssetsPlugin = require('optimize-css-assets-webpack-plugin');\nmodule.exports = {\n  optimization: {\n    minimizer: [new TerserJSPlugin({}), new OptimizeCSSAssetsPlugin({})],\n  },\n  plugins: [\n    new MiniCssExtractPlugin({\n      filename: '[name].css',\n      chunkFilename: '[id].css',\n    }),\n  ],\n  module: {\n    rules: [\n      {\n        test: /\\.css$/,\n        use: [MiniCssExtractPlugin.loader, 'css-loader'],\n      },\n    ],\n  },\n};\n```\n\n### Features\n\n#### Using preloaded or inlined CSS\n\nThe runtime code detects already added CSS via `<link>` or `<style>` tag.\nThis can be useful when injecting CSS on server-side for Server-Side-Rendering.\nThe `href` of the `<link>` tag has to match the URL that will be used for loading the CSS chunk.\nThe `data-href` attribute can be used for `<link>` and `<style>` too.\nWhen inlining CSS `data-href` must be used.\n\n#### Extracting all CSS in a single file\n\nSimilar to what [extract-text-webpack-plugin](https://github.com/webpack-contrib/extract-text-webpack-plugin) does, the CSS\ncan be extracted in one CSS file using `optimization.splitChunks.cacheGroups`.\n\n**webpack.config.js**\n\n```js\nconst MiniCssExtractPlugin = require('mini-css-extract-plugin');\nmodule.exports = {\n  optimization: {\n    splitChunks: {\n      cacheGroups: {\n        styles: {\n          name: 'styles',\n          test: /\\.css$/,\n          chunks: 'all',\n          enforce: true,\n        },\n      },\n    },\n  },\n  plugins: [\n    new MiniCssExtractPlugin({\n      filename: '[name].css',\n    }),\n  ],\n  module: {\n    rules: [\n      {\n        test: /\\.css$/,\n        use: [MiniCssExtractPlugin.loader, 'css-loader'],\n      },\n    ],\n  },\n};\n```\n\n#### Extracting CSS based on entry\n\nYou may also extract the CSS based on the webpack entry name. This is especially useful if you import routes dynamically\nbut want to keep your CSS bundled according to entry. This also prevents the CSS duplication issue one had with the\nExtractTextPlugin.\n\n```javascript\nconst path = require('path');\nconst MiniCssExtractPlugin = require('mini-css-extract-plugin');\n\nfunction recursiveIssuer(m) {\n  if (m.issuer) {\n    return recursiveIssuer(m.issuer);\n  } else if (m.name) {\n    return m.name;\n  } else {\n    return false;\n  }\n}\n\nmodule.exports = {\n  entry: {\n    foo: path.resolve(__dirname, 'src/foo'),\n    bar: path.resolve(__dirname, 'src/bar'),\n  },\n  optimization: {\n    splitChunks: {\n      cacheGroups: {\n        fooStyles: {\n          name: 'foo',\n          test: (m, c, entry = 'foo') =>\n            m.constructor.name === 'CssModule' && recursiveIssuer(m) === entry,\n          chunks: 'all',\n          enforce: true,\n        },\n        barStyles: {\n          name: 'bar',\n          test: (m, c, entry = 'bar') =>\n            m.constructor.name === 'CssModule' && recursiveIssuer(m) === entry,\n          chunks: 'all',\n          enforce: true,\n        },\n      },\n    },\n  },\n  plugins: [\n    new MiniCssExtractPlugin({\n      filename: '[name].css',\n    }),\n  ],\n  module: {\n    rules: [\n      {\n        test: /\\.css$/,\n        use: [MiniCssExtractPlugin.loader, 'css-loader'],\n      },\n    ],\n  },\n};\n```\n\n#### Module Filename Option\n\nWith the `moduleFilename` option you can use chunk data to customize the filename. This is particularly useful when dealing with multiple entry points and wanting to get more control out of the filename for a given entry point/chunk. In the example below, we'll use `moduleFilename` to output the generated css into a different directory.\n\n```javascript\nconst miniCssExtractPlugin = new MiniCssExtractPlugin({\n  moduleFilename: ({ name }) => `${name.replace('/js/', '/css/')}.css`,\n});\n```\n\n#### Long Term Caching\n\nFor long term caching use `filename: \"[contenthash].css\"`. Optionally add `[name]`.\n\n### Remove Order Warnings\n\nFor projects where css ordering has been mitigated through consistent use of scoping or naming conventions, the css order warnings can be disabled by setting the ignoreOrder flag to true for the plugin.\n\n```javascript\nnew MiniCssExtractPlugin({\n  ignoreOrder: true,\n}),\n```\n\n### Media Query Plugin\n\nIf you'd like to extract the media queries from the extracted CSS (so mobile users don't need to load desktop or tablet specific CSS anymore) you should use one of the following plugins:\n\n- [Media Query Plugin](https://github.com/SassNinja/media-query-plugin)\n- [Media Query Splitting Plugin](https://github.com/mike-diamond/media-query-splitting-plugin)\n\n## License\n\n[MIT](./LICENSE)\n\n[npm]: https://img.shields.io/npm/v/mini-css-extract-plugin.svg\n[npm-url]: https://npmjs.com/package/mini-css-extract-plugin\n[node]: https://img.shields.io/node/v/mini-css-extract-plugin.svg\n[node-url]: https://nodejs.org\n[deps]: https://david-dm.org/webpack-contrib/mini-css-extract-plugin.svg\n[deps-url]: https://david-dm.org/webpack-contrib/mini-css-extract-plugin\n[tests]: https://dev.azure.com/webpack-contrib/mini-css-extract-plugin/_apis/build/status/webpack-contrib.mini-css-extract-plugin?branchName=master\n[tests-url]: https://dev.azure.com/webpack-contrib/mini-css-extract-plugin/_build/latest?definitionId=6&branchName=master\n[cover]: https://codecov.io/gh/webpack-contrib/mini-css-extract-plugin/branch/master/graph/badge.svg\n[cover-url]: https://codecov.io/gh/webpack-contrib/mini-css-extract-plugin\n[chat]: https://img.shields.io/badge/gitter-webpack%2Fwebpack-brightgreen.svg\n[chat-url]: https://gitter.im/webpack/webpack\n[size]: https://packagephobia.now.sh/badge?p=mini-css-extract-plugin\n[size-url]: https://packagephobia.now.sh/result?p=mini-css-extract-plugin\n","readmeFilename":"README.md"}