update example configurations

This commit is contained in:
Tobias Koppers 2017-11-21 11:04:18 +01:00
parent 2201b860a5
commit e8f381dd93
33 changed files with 49 additions and 8 deletions

View File

@ -1,6 +1,7 @@
var path = require("path");
var AggressiveMergingPlugin = require("../../lib/optimize/AggressiveMergingPlugin");
module.exports = {
mode: "production",
entry: {
pageA: "./pageA",
pageB: "./pageB",

View File

@ -11,9 +11,11 @@ const fs = require("fs");
const extraArgs = "";
const targetArgs = global.NO_TARGET_ARGS ? "" : " ./example.js js/output.js";
const hasConfiguration = fs.existsSync("webpack.config.js");
const targetArgs = global.NO_TARGET_ARGS ? "" : " ./example.js js/output.js ";
const displayReasons = global.NO_REASONS ? "" : " --display-reasons --display-used-exports --display-provided-exports";
cp.exec(`node ${path.resolve(__dirname, "../bin/webpack.js")} ${displayReasons} --display-chunks --display-max-modules 99999 --display-origins --display-entrypoints --output-public-path "js/" -p ${extraArgs} ${targetArgs}`, function(error, stdout, stderr) {
const modeArgs = hasConfiguration ? "" : "--mode production";
cp.exec(`node ${path.resolve(__dirname, "../bin/webpack.js")} ${modeArgs} ${displayReasons} --display-chunks --display-max-modules 99999 --display-origins --display-entrypoints --output-public-path "js/" -p ${extraArgs} ${targetArgs}`, function(error, stdout, stderr) {
if(stderr)
console.log(stderr);
if(error !== null)
@ -25,7 +27,7 @@ cp.exec(`node ${path.resolve(__dirname, "../bin/webpack.js")} ${displayReasons}
console.log(stderr);
throw e;
}
cp.exec(`node ${path.resolve(__dirname, "../bin/webpack.js")} ${displayReasons} --display-chunks --display-max-modules 99999 --display-origins --display-entrypoints --output-public-path "js/" --output-pathinfo ${extraArgs} ${targetArgs}`, function(error, stdout, stderr) {
cp.exec(`node ${path.resolve(__dirname, "../bin/webpack.js")} ${modeArgs} ${displayReasons} --display-chunks --display-max-modules 99999 --display-origins --display-entrypoints --output-public-path "js/" --output-pathinfo ${extraArgs} ${targetArgs}`, function(error, stdout, stderr) {
console.log(stdout);
if(stderr)
console.log(stderr);

View File

@ -1,6 +1,7 @@
var path = require("path");
var webpack = require("../../");
module.exports = {
mode: "production",
entry: {
main: "./example",
common: ["./vendor"] // optional

View File

@ -1,6 +1,7 @@
const LoaderOptionsPlugin = require("../../lib/LoaderOptionsPlugin");
const ExtractTextPlugin = require("extract-text-webpack-plugin");
module.exports = {
mode: "production",
module: {
rules: [
{

View File

@ -1,4 +1,5 @@
module.exports = {
mode: "production",
module: {
rules: [
{ test: /\.coffee$/, loader: "coffee-loader" }

View File

@ -2,6 +2,7 @@ var path = require("path");
var CommonsChunkPlugin = require("../../lib/optimize/CommonsChunkPlugin");
module.exports = {
mode: "production",
entry: {
vendor: ["./vendor1", "./vendor2"],
pageA: "./pageA",

View File

@ -4,6 +4,7 @@ const path = require("path");
module.exports = [
{
mode: "production",
entry: {
main: ["./example.js"]
},
@ -21,6 +22,7 @@ module.exports = [
]
},
{
mode: "production",
entry: {
main: ["./example.js"]
},

View File

@ -1,6 +1,7 @@
const LoaderOptionsPlugin = require("../../lib/LoaderOptionsPlugin");
const ExtractTextPlugin = require("extract-text-webpack-plugin");
module.exports = {
mode: "production",
module: {
rules: [
{

View File

@ -2,6 +2,7 @@ var path = require("path");
var webpack = require("../../../");
module.exports = {
mode: "production",
context: __dirname,
entry: ["example-vendor"],
output: {

View File

@ -2,6 +2,7 @@ var path = require("path");
var webpack = require("../../../");
module.exports = {
mode: "production",
context: __dirname,
entry: "./example-app",
output: {

View File

@ -1,6 +1,7 @@
var path = require("path");
var webpack = require("../../");
module.exports = {
mode: "production",
plugins: [
new webpack.DllReferencePlugin({
context: path.join(__dirname, "..", "dll"),

View File

@ -1,6 +1,7 @@
var path = require("path");
var webpack = require("../../");
module.exports = {
mode: "production",
resolve: {
extensions: [".js", ".jsx"]
},

View File

@ -3,6 +3,7 @@ var webpack = require("../../");
module.exports = [
{
name: "vendor",
mode: "production",
entry: ["./vendor", "./vendor2"],
output: {
path: path.resolve(__dirname, "js"),
@ -18,6 +19,7 @@ module.exports = [
},
{
name: "app",
mode: "production",
dependencies: ["vendor"],
entry: {
pageA: "./pageA",

View File

@ -1,4 +1,5 @@
module.exports = {
mode: "production",
output: {
libraryTarget: "umd"
},

View File

@ -1,6 +1,7 @@
var CommonsChunkPlugin = require("../../lib/optimize/CommonsChunkPlugin");
module.exports = {
mode: "production",
plugins: [
new CommonsChunkPlugin({
name: "main",

View File

@ -1,6 +1,7 @@
var CommonsChunkPlugin = require("../../lib/optimize/CommonsChunkPlugin");
module.exports = {
mode: "production",
plugins: [
new CommonsChunkPlugin({
// process all children of the main chunk

View File

@ -1,5 +1,6 @@
var path = require("path");
module.exports = {
mode: "production",
entry: "./example",
output: {
path: path.join(__dirname, "js"),

View File

@ -0,0 +1,6 @@
module.exports = {
mode: "production",
optimization: {
concatenateModules: false
}
};

View File

@ -1,6 +1,8 @@
var path = require("path");
var webpack = require("../../");
module.exports = {
mode: "production",
cache: true, // better performance for the AggressiveSplittingPlugin
entry: "./example",
output: {
path: path.join(__dirname, "js"),

View File

@ -1,6 +1,7 @@
var path = require("path");
var CommonsChunkPlugin = require("../../lib/optimize/CommonsChunkPlugin");
module.exports = {
mode: "production",
entry: {
// The entry points for the pages
pageA: "./aEntry",

View File

@ -7,6 +7,7 @@ var languages = {
module.exports = Object.keys(languages).map(function(language) {
return {
name: language,
mode: "production",
entry: "./example",
output: {
path: path.join(__dirname, "js"),

View File

@ -1,4 +1,5 @@
module.exports = {
mode: "production",
module: {
rules: [
{ test: /\.css$/, loader: "css-loader" }

View File

@ -7,12 +7,14 @@ var outputOptions = {
};
module.exports = [{
name: "page",
mode: "production",
entry: {
page: "./page"
},
output: outputOptions
}, {
name: "pageA",
mode: "production",
entry: {
pageA: "./page"
},
@ -26,6 +28,7 @@ module.exports = [{
]
}, {
name: "pageB",
mode: "production",
entry: {
pageB: "./page"
},
@ -40,6 +43,7 @@ module.exports = [{
]
}, {
name: "pageC",
mode: "production",
entry: {
pageC: "./page"
},

View File

@ -3,6 +3,7 @@ var webpack = require("../../");
module.exports = [
{
name: "mobile",
mode: "production",
entry: "./example",
output: {
path: path.join(__dirname, "js"),
@ -16,6 +17,7 @@ module.exports = [
},
{
name: "desktop",
mode: "production",
entry: "./example",
output: {
path: path.join(__dirname, "js"),

View File

@ -1,5 +1,6 @@
var path = require("path");
module.exports = {
mode: "production",
entry: {
alpha: "./alpha",
beta: "./beta"

View File

@ -1,6 +1,7 @@
var path = require("path");
var CommonsChunkPlugin = require("../../lib/optimize/CommonsChunkPlugin");
module.exports = {
mode: "production",
entry: {
pageA: "./pageA",
pageB: "./pageB",

View File

@ -3,6 +3,7 @@ const LoaderOptionsPlugin = require("../../lib/LoaderOptionsPlugin");
const CommonsChunkPlugin = require("../../lib/optimize/CommonsChunkPlugin");
const ExtractTextPlugin = require("extract-text-webpack-plugin");
module.exports = {
mode: "production",
entry: {
A: "./a",
B: "./b",

View File

@ -1,6 +1,7 @@
var path = require("path");
var CommonsChunkPlugin = require("../../lib/optimize/CommonsChunkPlugin");
module.exports = {
mode: "production",
entry: {
pageA: "./pageA",
pageB: "./pageB"

View File

@ -1,7 +1,3 @@
var webpack = require("../../");
module.exports = {
plugins: [
new webpack.optimize.ModuleConcatenationPlugin()
]
mode: "production"
};

View File

@ -13,6 +13,7 @@ module.exports = [
"nosources-source-map",
"source-map",
].map(devtool => ({
mode: "development",
entry: {
bundle: "coffee-loader!./example.coffee",
},

View File

@ -1,6 +1,7 @@
var path = require("path");
var CommonsChunkPlugin = require("../../lib/optimize/CommonsChunkPlugin");
module.exports = {
mode: "production",
entry: {
vendor1: ["./vendor1"],
vendor2: ["./vendor2"],

View File

@ -1,4 +1,5 @@
module.exports = {
mode: "production",
output: {
webassemblyModuleFilename: "[modulehash].wasm",
publicPath: "js/"

View File

@ -1,5 +1,6 @@
var webpack = require("../../");
module.exports = {
mode: "production",
plugins: [
new webpack.LoaderOptionsPlugin({
options: {