Last active
August 31, 2017 14:34
-
-
Save nemtsov/b1df26c3ed6025879590e34c399f9f2a to your computer and use it in GitHub Desktop.
Sample webpack configuration to demonstrate a non-descriptive error message for an incorrect "dependencies"
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module.exports = { | |
context: `${__dirname}/../js`, | |
output: { | |
pathinfo: true, | |
filename: '[name].js', | |
path: `${__dirname}/../dist` | |
} | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const merge = require('webpack-merge'); | |
const webpack = require('webpack'); | |
const base = require('./_base'); | |
const path = require('path'); | |
module.exports = merge(base, { | |
dependencies: ['common'], | |
entry: { | |
'a': ['./common', './a'], | |
}, | |
plugins: [ | |
new webpack.DllReferencePlugin({ | |
manifest: path.resolve(base.output.path, 'common.manifest.json'), | |
}), | |
], | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const merge = require('webpack-merge'); | |
const webpack = require('webpack'); | |
const base = require('./_base'); | |
const path = require('path'); | |
module.exports = merge(base, { | |
name: 'common', | |
entry: ['./common'], | |
output: { | |
filename: 'common.js', | |
}, | |
plugins: [ | |
new webpack.DllPlugin({ | |
path: path.resolve(base.output.path, 'common.manifest.json'), | |
}), | |
], | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
console.log('a'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
__webpack_public_path__ = "https://cdn.example.com/x3ad76/js" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const base = require('./build/_base'); | |
const common = require('./build/common'); | |
const a = require('./build/a'); | |
module.exports = [ | |
// common, | |
a, | |
]; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Note: put the
build_
prefixed files in the/build
folder andjs_
prefixed ones in thejs
folder.npm install webpack webpack-merge
and./node_modules/.bin/webpack --verbose
. You'll get:Cannot read property 'hash' of null
as the only output in webpack 3.5.5.