docs: update examples
This commit is contained in:
parent
21be52b681
commit
8e7ac44fbd
|
@ -20,7 +20,7 @@ import("./async2");
|
|||
```javascript
|
||||
var path = require("path");
|
||||
module.exports = {
|
||||
// mode: "development || "production",
|
||||
// mode: "development" || "production",
|
||||
entry: {
|
||||
main: "./example"
|
||||
},
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
var path = require("path");
|
||||
module.exports = {
|
||||
// mode: "development || "production",
|
||||
// mode: "development" || "production",
|
||||
entry: {
|
||||
main: "./example"
|
||||
},
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
module.exports = {
|
||||
// mode: "development || "production",
|
||||
// mode: "development" || "production",
|
||||
module: {
|
||||
rules: [
|
||||
{
|
||||
|
|
|
@ -86,7 +86,7 @@ module.exports = function() {
|
|||
const path = require("path");
|
||||
|
||||
module.exports = {
|
||||
// mode: "development || "production",
|
||||
// mode: "development" || "production",
|
||||
entry: {
|
||||
main: ["./example.js"]
|
||||
},
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
const path = require("path");
|
||||
|
||||
module.exports = {
|
||||
// mode: "development || "production",
|
||||
// mode: "development" || "production",
|
||||
entry: {
|
||||
main: ["./example.js"]
|
||||
},
|
||||
|
|
|
@ -13,7 +13,7 @@ var path = require("path");
|
|||
var webpack = require("../../../");
|
||||
|
||||
module.exports = {
|
||||
// mode: "development || "production",
|
||||
// mode: "development" || "production",
|
||||
context: __dirname,
|
||||
entry: ["example-vendor"],
|
||||
output: {
|
||||
|
|
|
@ -2,7 +2,7 @@ var path = require("path");
|
|||
var webpack = require("../../../");
|
||||
|
||||
module.exports = {
|
||||
// mode: "development || "production",
|
||||
// mode: "development" || "production",
|
||||
context: __dirname,
|
||||
entry: ["example-vendor"],
|
||||
output: {
|
||||
|
|
|
@ -10,7 +10,7 @@ This is the _user_ bundle, which uses the manifest from [dll-reference example](
|
|||
var path = require("path");
|
||||
var webpack = require("../../");
|
||||
module.exports = {
|
||||
// mode: "development || "production",
|
||||
// mode: "development" || "production",
|
||||
plugins: [
|
||||
new webpack.DllReferencePlugin({
|
||||
context: path.join(__dirname, "..", "dll"),
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
var path = require("path");
|
||||
var webpack = require("../../");
|
||||
module.exports = {
|
||||
// mode: "development || "production",
|
||||
// mode: "development" || "production",
|
||||
plugins: [
|
||||
new webpack.DllReferencePlugin({
|
||||
context: path.join(__dirname, "..", "dll"),
|
||||
|
|
|
@ -10,7 +10,7 @@ This is the _reference_ bundle (with the manifests) for [dll user example](https
|
|||
var path = require("path");
|
||||
var webpack = require("../../");
|
||||
module.exports = {
|
||||
// mode: "development || "production",
|
||||
// mode: "development" || "production",
|
||||
resolve: {
|
||||
extensions: [".js", ".jsx"]
|
||||
},
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
var path = require("path");
|
||||
var webpack = require("../../");
|
||||
module.exports = {
|
||||
// mode: "development || "production",
|
||||
// mode: "development" || "production",
|
||||
resolve: {
|
||||
extensions: [".js", ".jsx"]
|
||||
},
|
||||
|
|
|
@ -6,7 +6,7 @@ var webpack = require("../../");
|
|||
module.exports = [
|
||||
{
|
||||
name: "vendor",
|
||||
// mode: "development || "production",
|
||||
// mode: "development" || "production",
|
||||
entry: ["./vendor", "./vendor2"],
|
||||
output: {
|
||||
path: path.resolve(__dirname, "dist"),
|
||||
|
@ -23,7 +23,7 @@ module.exports = [
|
|||
|
||||
{
|
||||
name: "app",
|
||||
// mode: "development || "production",
|
||||
// mode: "development" || "production",
|
||||
dependencies: ["vendor"],
|
||||
entry: {
|
||||
pageA: "./pageA",
|
||||
|
|
|
@ -3,7 +3,7 @@ var webpack = require("../../");
|
|||
module.exports = [
|
||||
{
|
||||
name: "vendor",
|
||||
// mode: "development || "production",
|
||||
// mode: "development" || "production",
|
||||
entry: ["./vendor", "./vendor2"],
|
||||
output: {
|
||||
path: path.resolve(__dirname, "dist"),
|
||||
|
@ -20,7 +20,7 @@ module.exports = [
|
|||
|
||||
{
|
||||
name: "app",
|
||||
// mode: "development || "production",
|
||||
// mode: "development" || "production",
|
||||
dependencies: ["vendor"],
|
||||
entry: {
|
||||
pageA: "./pageA",
|
||||
|
|
|
@ -28,7 +28,7 @@ exports.exampleValue = subtract(add(42, 2), 2);
|
|||
|
||||
```javascript
|
||||
module.exports = {
|
||||
// mode: "development || "production",
|
||||
// mode: "development" || "production",
|
||||
output: {
|
||||
libraryTarget: "umd"
|
||||
},
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
module.exports = {
|
||||
// mode: "development || "production",
|
||||
// mode: "development" || "production",
|
||||
output: {
|
||||
libraryTarget: "umd"
|
||||
},
|
||||
|
|
|
@ -23,7 +23,7 @@ require.ensure(["./a", "./e"], function(require) {
|
|||
|
||||
```javascript
|
||||
module.exports = {
|
||||
// mode: "development || "production",
|
||||
// mode: "development" || "production",
|
||||
optimization: {
|
||||
splitChunks: {
|
||||
minSize: 0 // This example is too small
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
module.exports = {
|
||||
// mode: "development || "production",
|
||||
// mode: "development" || "production",
|
||||
optimization: {
|
||||
splitChunks: {
|
||||
minSize: 0 // This example is too small
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
module.exports = {
|
||||
// mode: "development || "production",
|
||||
// mode: "development" || "production",
|
||||
optimization: {
|
||||
splitChunks: {
|
||||
minSize: 0 // This example is too small
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
```javascript
|
||||
var path = require("path");
|
||||
module.exports = {
|
||||
// mode: "development || "production",
|
||||
// mode: "development" || "production",
|
||||
entry: "./example",
|
||||
output: {
|
||||
path: path.join(__dirname, "dist"),
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
var path = require("path");
|
||||
module.exports = {
|
||||
// mode: "development || "production",
|
||||
// mode: "development" || "production",
|
||||
entry: "./example",
|
||||
output: {
|
||||
path: path.join(__dirname, "dist"),
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
module.exports = {
|
||||
// mode: "development || "production",
|
||||
// mode: "development" || "production",
|
||||
optimization: {
|
||||
concatenateModules: false
|
||||
}
|
||||
|
|
|
@ -20,7 +20,7 @@ The backward compatibility (non-HTTP2 client) improves with bigger `maxSize`, as
|
|||
var path = require("path");
|
||||
var webpack = require("../../");
|
||||
module.exports = {
|
||||
// mode: "development || "production",
|
||||
// mode: "development" || "production",
|
||||
cache: true, // better performance for the AggressiveSplittingPlugin
|
||||
entry: "./example",
|
||||
output: {
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
var path = require("path");
|
||||
var webpack = require("../../");
|
||||
module.exports = {
|
||||
// mode: "development || "production",
|
||||
// mode: "development" || "production",
|
||||
cache: true, // better performance for the AggressiveSplittingPlugin
|
||||
entry: "./example",
|
||||
output: {
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
```javascript
|
||||
var path = require("path");
|
||||
module.exports = {
|
||||
// mode: "development || "production",
|
||||
// mode: "development" || "production",
|
||||
entry: {
|
||||
// The entry points for the pages
|
||||
// They also contains router
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
var path = require("path");
|
||||
module.exports = {
|
||||
// mode: "development || "production",
|
||||
// mode: "development" || "production",
|
||||
entry: {
|
||||
// The entry points for the pages
|
||||
// They also contains router
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
module.exports = {
|
||||
// mode: "development || "production",
|
||||
// mode: "development" || "production",
|
||||
module: {
|
||||
rules: [
|
||||
{
|
||||
|
|
|
@ -26,7 +26,7 @@ Note: decreasing `maxInitial/AsyncRequest` will increase duplication further to
|
|||
|
||||
```
|
||||
module.exports = {
|
||||
// mode: "development || "production",
|
||||
// mode: "development" || "production",
|
||||
entry: {
|
||||
pageA: "./pages/a",
|
||||
pageB: "./pages/b",
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
module.exports = {
|
||||
// mode: "development || "production",
|
||||
// mode: "development" || "production",
|
||||
entry: {
|
||||
pageA: "./pages/a",
|
||||
pageB: "./pages/b",
|
||||
|
|
|
@ -15,7 +15,7 @@ var webpack = require("../../");
|
|||
module.exports = [
|
||||
{
|
||||
name: "mobile",
|
||||
// mode: "development || "production",
|
||||
// mode: "development" || "production",
|
||||
entry: "./example",
|
||||
output: {
|
||||
path: path.join(__dirname, "dist"),
|
||||
|
@ -30,7 +30,7 @@ module.exports = [
|
|||
|
||||
{
|
||||
name: "desktop",
|
||||
// mode: "development || "production",
|
||||
// mode: "development" || "production",
|
||||
entry: "./example",
|
||||
output: {
|
||||
path: path.join(__dirname, "dist"),
|
||||
|
|
|
@ -3,7 +3,7 @@ var webpack = require("../../");
|
|||
module.exports = [
|
||||
{
|
||||
name: "mobile",
|
||||
// mode: "development || "production",
|
||||
// mode: "development" || "production",
|
||||
entry: "./example",
|
||||
output: {
|
||||
path: path.join(__dirname, "dist"),
|
||||
|
@ -18,7 +18,7 @@ module.exports = [
|
|||
|
||||
{
|
||||
name: "desktop",
|
||||
// mode: "development || "production",
|
||||
// mode: "development" || "production",
|
||||
entry: "./example",
|
||||
output: {
|
||||
path: path.join(__dirname, "dist"),
|
||||
|
|
|
@ -17,7 +17,7 @@ Note: When your library has dependencies that should not be included in the comp
|
|||
```javascript
|
||||
var path = require("path");
|
||||
module.exports = {
|
||||
// mode: "development || "production",
|
||||
// mode: "development" || "production",
|
||||
entry: {
|
||||
alpha: "./alpha",
|
||||
beta: "./beta"
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
var path = require("path");
|
||||
module.exports = {
|
||||
// mode: "development || "production",
|
||||
// mode: "development" || "production",
|
||||
entry: {
|
||||
alpha: "./alpha",
|
||||
beta: "./beta"
|
||||
|
|
|
@ -51,7 +51,7 @@ require.ensure(["./shared"], function(require) {
|
|||
|
||||
```javascript
|
||||
module.exports = {
|
||||
// mode: "development || "production",
|
||||
// mode: "development" || "production",
|
||||
entry: {
|
||||
pageA: "./pageA",
|
||||
pageB: "./pageB"
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
module.exports = {
|
||||
// mode: "development || "production",
|
||||
// mode: "development" || "production",
|
||||
entry: {
|
||||
pageA: "./pageA",
|
||||
pageB: "./pageB"
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
```javascript
|
||||
var path = require("path");
|
||||
module.exports = {
|
||||
// mode: "development || "production",
|
||||
// mode: "development" || "production",
|
||||
entry: {
|
||||
vendor1: ["./vendor1"],
|
||||
vendor2: ["./vendor2"],
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
var path = require("path");
|
||||
module.exports = {
|
||||
// mode: "development || "production",
|
||||
// mode: "development" || "production",
|
||||
entry: {
|
||||
vendor1: ["./vendor1"],
|
||||
vendor2: ["./vendor2"],
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
module.exports = {
|
||||
// mode: "development || "production",
|
||||
// mode: "development" || "production",
|
||||
output: {
|
||||
publicPath: "dist/"
|
||||
},
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
module.exports = {
|
||||
// mode: "development || "production",
|
||||
// mode: "development" || "production",
|
||||
output: {
|
||||
webassemblyModuleFilename: "[hash].wasm",
|
||||
publicPath: "dist/"
|
||||
|
|
Loading…
Reference in New Issue