Skip to content

Instantly share code, notes, and snippets.

@selvagsz
Last active October 24, 2016 08:22
Show Gist options
  • Save selvagsz/710279afa644c88face93b06fc1f4999 to your computer and use it in GitHub Desktop.
Save selvagsz/710279afa644c88face93b06fc1f4999 to your computer and use it in GitHub Desktop.
Webpack Notes
// Entire default options
{
devtool: false,
cache: true,
context: process.cwd(),
target: 'web',
module: {
unknownContextRequest: '.',
unknownContextRegExp: false,
unknownContextRecursive: true,
unknownContextCritical: true,
exprContextRequest: '.',
exprContextRegExp: false,
exprContextRecursive: true,
exprContextCritical: true,
wrappedContextRegExp: /.*/,
wrappedContextRecursive: true,
wrappedContextCritical: false
},
output: {
filename: '[name].js',
chunkFilename: '[id].js',
library: '',
hotUpdateFunction: '¯\_(ツ)_/¯',
jsonpFunction: '¯\_(ツ)_/¯',
libraryTarget: 'var',
path: process.cwd(),
sourceMapFilename: '[file].map[query]',
hotUpdateChunkFilename: '[id].[hash].hot-update.js',
hotUpdateMainFilename: '[hash].hot-update.json',
crossOriginLoading: false,
hashFunction: 'md5',
hashDigest: 'hex',
hashDigestLength: 20,
devtoolLineToLine: false
},
node: {
console: false,
process: true,
global: true,
Buffer: true,
setImmediate: true,
__filename: 'mock',
__dirname: 'mock'
},
resolve: {
unsafeCache: true,
modules: ['node_modules'],
extensions: ['.js', '.json'],
aliasFields: ['browser'],
mainFields: ['browser', 'module', 'main'],
modulesDirectories: ['web_modules', 'node_modules'],
},
resolveLoader: {
unsafeCache: true,
mainFields: ['loader', 'main'],
extensions: ['.js', '.json'],
moduleExtensions: ['-loader'],
modulesDirectories: ['web_modules', 'web_loaders', 'node_modules', 'node_loaders']
}
}
// ¯\_(ツ)_/¯¯\_(ツ)_/¯¯\_(ツ)_/¯
// Compiler
// recordsInputPath
// recordsOutputPath
// records
// resolvers
// - normal
// - loader
// - context
// Compiler plugin hooks
// - before-run
// - run
// - should emit
// - make
// - after-compile
// Watching
// watchOptions
// - aggregateTimeout
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment