Skip to content

Instantly share code, notes, and snippets.

@evenstensberg
Last active April 9, 2017 15:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save evenstensberg/41b862e194f0e8e5939cb952fde4544e to your computer and use it in GitHub Desktop.
Save evenstensberg/41b862e194f0e8e5939cb952fde4544e to your computer and use it in GitHub Desktop.

Testing output

Paste this somewhere in a generator
this.configuration.webpackOptions.entry = {
vendor: 'home',
js: 'yes',
ohye: 'no'
};
this.configuration.webpackOptions.output.filename = 'hello';
this.configuration.webpackOptions.output.path = 'dist/assets';
this.configuration.webpackOptions.output.pathinfo = true;
this.configuration.webpackOptions.output.publicPath = "https://newbie.com"
this.configuration.webpackOptions.output.sourceMapFilename = "[name].map"

// buggy
this.configuration.webpackOptions.output.sourcePrefix = `${"\t"}`

this.configuration.webpackOptions.output.umdNamedDefine = true;
this.configuration.webpackOptions.output.strictModuleExceptionHandling = true;

this.configuration.webpackOptions.context = '/hello'

this.configuration.webpackOptions.resolve.alias.hello = ':)'
this.configuration.webpackOptions.resolve.aliasFields = ["browser"]
this.configuration.webpackOptions.resolve.descriptionFiles = ['a', 'b']
this.configuration.webpackOptions.resolve.enforceExtension = false
this.configuration.webpackOptions.resolve.enforceModuleExtension = false
this.configuration.webpackOptions.resolve.extensions = ['hey', 'gi']
this.configuration.webpackOptions.resolve.mainFields = ["mod", 'ho', 'bo']
this.configuration.webpackOptions.resolve.mainFiles = ["index"]
this.configuration.webpackOptions.resolve.modules = ["Heo"]
this.configuration.webpackOptions.resolve.unsafeCache = true
this.configuration.webpackOptions.resolve.resolveLoader = {
modules: ["node_modules"],
 extensions: [".js", ".json"],
mainFields: ["loader", "main"],
moduleExtensions: ['-loader']
}
this.configuration.webpackOptions.resolve.plugins = [];
this.configuration.webpackOptions.resolve.symlinks = true;

// buggy
this.configuration.webpackOptions.resolve.cachePredicate = function() {
return true
}

this.configuration.webpackOptions.devtool = 'eval'
this.configuration.webpackOptions.target = 'async-node'
this.configuration.webpackOptions.watch = true;
this.configuration.webpackOptions.watchOptions = {
 aggregateTimeout: 300,
poll: 1000,
ignored: '/node_modules/'
}
this.configuration.webpackOptions.externals = {
jquery: 'jQuery',
subtract: ['./math', 'subtract'],
lodash : {
   commonjs: "lodash",
   amd: "lodash",
  root: "_" // indicates global variable
 }
}
this.configuration.webpackOptions.node = {
console: false,
 global: true,
 process: true,
 Buffer: true,
 __filename: "mock",
 __dirname: "mock",
 setImmediate: true
}
this.configuration.webpackOptions.performance = {
  hints: "warning",
maxEntrypointSize: 400000,
maxAssetSize: 100000,
//buggy
assetFilter: function(assetFilename) {
  return assetFilename.endsWith('.js');
 }
}

this.configuration.webpackOptions.stats = 'errors-only'
this.configuration.webpackOptions.stats = {
 assets: true,
  // Sort assets by a field
  assetsSort: "field",
  // Add information about cached (not built) modules
  cached: true,
  // Show cached assets (setting this to `false` only shows emitted files)
  cachedAssets: true,
  // Add children information
  children: true,
  // Add chunk information (setting this to `false` allows for a less verbose output)
  chunks: true,
  // Add built modules information to chunk information
  chunkModules: true,
  // Add the origins of chunks and chunk merging info
  chunkOrigins: true,
  // Sort the chunks by a field
  chunksSort: "field",
  // Context directory for request shortening
  context: "../src/",
  // `webpack --colors` equivalent
  colors: true,
  // Display the distance from the entry point for each module
  depth: false,
  // Display the entry points with the corresponding bundles
  entrypoints: false,
  // Add errors
  errors: true,
  // Add details to errors (like resolving log)
  errorDetails: true,
  // Exclude modules which match one of the given strings or regular expressions
  exclude: [],
  // Add the hash of the compilation
  hash: true,
  // Set the maximum number of modules to be shown
  maxModules: 15,
  // Add built modules information
  modules: true,
  // Sort the modules by a field
  modulesSort: "field",
  // Show performance hint when file size exceeds `performance.maxAssetSize`
  performance: true,
  // Show the exports of the modules
  providedExports: false,
  // Add public path information
  publicPath: true,
  // Add information about the reasons why modules are included
  reasons: true,
  // Add the source code of modules
  source: true,
  // Add timing information
  timings: true,
  // Show which exports of a module are used
  usedExports: false,
  // Add webpack version information
  version: true,
  // Add warnings
  warnings: true
}
	this.configuration.webpackOptions.amd = {
				jQuery: true,
				kQuery: false
			}
			this.configuration.webpackOptions.bail = true;
			let SharedCache = {}
			this.configuration.webpackOptions.cache = SharedCache
   this.configuration.webpackOptions.profile = true
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment