From 26105034da4fcce7ac883c899d781f016559310d Mon Sep 17 00:00:00 2001 From: ruki Date: Thu, 8 Nov 2018 00:38:48 +0800 Subject: switch to vuepress --- node_modules/mini-css-extract-plugin/CHANGELOG.md | 55 +++ node_modules/mini-css-extract-plugin/LICENSE | 20 ++ node_modules/mini-css-extract-plugin/README.md | 320 +++++++++++++++++ node_modules/mini-css-extract-plugin/dist/cjs.js | 3 + node_modules/mini-css-extract-plugin/dist/index.js | 391 +++++++++++++++++++++ .../mini-css-extract-plugin/dist/loader.js | 152 ++++++++ .../node_modules/.bin/webpack | 1 + .../node_modules/schema-utils/CHANGELOG.md | 134 +++++++ .../node_modules/schema-utils/LICENSE | 20 ++ .../node_modules/schema-utils/README.md | 149 ++++++++ .../node_modules/schema-utils/package.json | 41 +++ .../schema-utils/src/ValidationError.js | 30 ++ .../node_modules/schema-utils/src/index.js | 9 + .../schema-utils/src/validateOptions.js | 38 ++ node_modules/mini-css-extract-plugin/package.json | 91 +++++ 15 files changed, 1454 insertions(+) create mode 100644 node_modules/mini-css-extract-plugin/CHANGELOG.md create mode 100644 node_modules/mini-css-extract-plugin/LICENSE create mode 100644 node_modules/mini-css-extract-plugin/README.md create mode 100644 node_modules/mini-css-extract-plugin/dist/cjs.js create mode 100644 node_modules/mini-css-extract-plugin/dist/index.js create mode 100644 node_modules/mini-css-extract-plugin/dist/loader.js create mode 120000 node_modules/mini-css-extract-plugin/node_modules/.bin/webpack create mode 100644 node_modules/mini-css-extract-plugin/node_modules/schema-utils/CHANGELOG.md create mode 100644 node_modules/mini-css-extract-plugin/node_modules/schema-utils/LICENSE create mode 100644 node_modules/mini-css-extract-plugin/node_modules/schema-utils/README.md create mode 100644 node_modules/mini-css-extract-plugin/node_modules/schema-utils/package.json create mode 100644 node_modules/mini-css-extract-plugin/node_modules/schema-utils/src/ValidationError.js create mode 100644 node_modules/mini-css-extract-plugin/node_modules/schema-utils/src/index.js create mode 100644 node_modules/mini-css-extract-plugin/node_modules/schema-utils/src/validateOptions.js create mode 100644 node_modules/mini-css-extract-plugin/package.json (limited to 'node_modules/mini-css-extract-plugin') diff --git a/node_modules/mini-css-extract-plugin/CHANGELOG.md b/node_modules/mini-css-extract-plugin/CHANGELOG.md new file mode 100644 index 00000000..ad30a359 --- /dev/null +++ b/node_modules/mini-css-extract-plugin/CHANGELOG.md @@ -0,0 +1,55 @@ +# Change Log + +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. + + +## [0.4.4](https://github.com/webpack-contrib/mini-css-extract-plugin/compare/v0.4.3...v0.4.4) (2018-10-10) + + +### Bug Fixes + +* **index:** assign empty `module.id` to prevent `contenthash` from changing unnecessarily ([#284](https://github.com/webpack-contrib/mini-css-extract-plugin/issues/284)) ([d7946d0](https://github.com/webpack-contrib/mini-css-extract-plugin/commit/d7946d0)) + + + + +## [0.4.3](https://github.com/webpack-contrib/mini-css-extract-plugin/compare/v0.4.2...v0.4.3) (2018-09-18) + + +### Bug Fixes + +* **loader:** pass `emitFile` to the child compilation (`loaderContext.emitFile`) ([#177](https://github.com/webpack-contrib/mini-css-extract-plugin/issues/177)) ([18c066e](https://github.com/webpack-contrib/mini-css-extract-plugin/commit/18c066e)) + + + + +## [0.4.2](https://github.com/webpack-contrib/mini-css-extract-plugin/compare/v0.4.0...v0.4.2) (2018-08-21) + + +### Bug Fixes + +* use correct order when multiple chunk groups are merged ([#246](https://github.com/webpack-contrib/mini-css-extract-plugin/issues/246)) ([c3b363d](https://github.com/webpack-contrib/mini-css-extract-plugin/commit/c3b363d)) + + + + +## [0.4.1](https://github.com/webpack-contrib/mini-css-extract-plugin/compare/v0.4.0...v0.4.1) (2018-06-29) + + +### Bug Fixes + +* CSS ordering with multiple entry points ([#130](https://github.com/webpack-contrib/mini-css-extract-plugin/issues/130)) ([79373eb](https://github.com/webpack-contrib/mini-css-extract-plugin/commit/79373eb)) + + + +# Change Log + +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. + +x.x.x / -- +================== + + * Bug fix - + * Feature - + * Chore - + * Docs - diff --git a/node_modules/mini-css-extract-plugin/LICENSE b/node_modules/mini-css-extract-plugin/LICENSE new file mode 100644 index 00000000..8c11fc72 --- /dev/null +++ b/node_modules/mini-css-extract-plugin/LICENSE @@ -0,0 +1,20 @@ +Copyright JS Foundation and other contributors + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +'Software'), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/mini-css-extract-plugin/README.md b/node_modules/mini-css-extract-plugin/README.md new file mode 100644 index 00000000..f072fc05 --- /dev/null +++ b/node_modules/mini-css-extract-plugin/README.md @@ -0,0 +1,320 @@ +
+ + + + + +

mini-css-extract-plugin

+
+ +[![npm][npm]][npm-url] +[![deps][deps]][deps-url] +[![tests][tests]][tests-url] +[![coverage][cover]][cover-url] +[![chat][chat]][chat-url] + +This 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. + +It builds on top of a new webpack v4 feature (module types) and requires webpack 4 to work. + +Compared to the extract-text-webpack-plugin: + +* Async loading +* No duplicate compilation (performance) +* Easier to use +* Specific to CSS + +TODO: + +* HMR support + +

Install

+ +```bash +npm install --save-dev mini-css-extract-plugin +``` + +

Usage

+ +### Configuration + +#### Minimal example + +**webpack.config.js** + +```js +const MiniCssExtractPlugin = require("mini-css-extract-plugin"); +module.exports = { + plugins: [ + new MiniCssExtractPlugin({ + // Options similar to the same options in webpackOptions.output + // both options are optional + filename: "[name].css", + chunkFilename: "[id].css" + }) + ], + module: { + rules: [ + { + test: /\.css$/, + use: [ + { + loader: MiniCssExtractPlugin.loader, + options: { + // you can specify a publicPath here + // by default it use publicPath in webpackOptions.output + publicPath: '../' + } + }, + "css-loader" + ] + } + ] + } +} +``` + +#### Advanced configuration example + +This plugin should be used only on `production` builds without `style-loader` in the loaders chain, especially if you want to have HMR in `development`. + +Here is an example to have both HMR in `development` and your styles extracted in a file for `production` builds. + +(Loaders options left out for clarity, adapt accordingly to your needs.) + + +**webpack.config.js** + +```js +const MiniCssExtractPlugin = require("mini-css-extract-plugin"); +const devMode = process.env.NODE_ENV !== 'production' + +module.exports = { + plugins: [ + new MiniCssExtractPlugin({ + // Options similar to the same options in webpackOptions.output + // both options are optional + filename: devMode ? '[name].css' : '[name].[hash].css', + chunkFilename: devMode ? '[id].css' : '[id].[hash].css', + }) + ], + module: { + rules: [ + { + test: /\.(sa|sc|c)ss$/, + use: [ + devMode ? 'style-loader' : MiniCssExtractPlugin.loader, + 'css-loader', + 'postcss-loader', + 'sass-loader', + ], + } + ] + } +} +``` + +### Minimizing For Production + +While webpack 5 is likely to come with a CSS minimizer built-in, with webpack 4 you need to bring your own. To 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: + +**webpack.config.js** + +```js +const UglifyJsPlugin = require("uglifyjs-webpack-plugin"); +const MiniCssExtractPlugin = require("mini-css-extract-plugin"); +const OptimizeCSSAssetsPlugin = require("optimize-css-assets-webpack-plugin"); +module.exports = { + optimization: { + minimizer: [ + new UglifyJsPlugin({ + cache: true, + parallel: true, + sourceMap: true // set to true if you want JS source maps + }), + new OptimizeCSSAssetsPlugin({}) + ] + }, + plugins: [ + new MiniCssExtractPlugin({ + filename: "[name].css", + chunkFilename: "[id].css" + }) + ], + module: { + rules: [ + { + test: /\.css$/, + use: [ + MiniCssExtractPlugin.loader, + "css-loader" + ] + } + ] + } +} +``` + +### Features + +#### Using preloaded or inlined CSS + +The runtime code detects already added CSS via `` or `