Issue 1:
Hey there!

I just came across WebPack while being in the need to get rid of many requests just to gather together some resources (various scripts, etc). For now, I have been doing this using PHP. A Yii extension allows me to add together all my scripts into a single file. However, minification and things alike don't work. There also is no support for some advanced parsing and pre-processing.

So I have a few questions:

Within webpack-app (the example app) you used the jamjs system for some dependencies. Would you recommend this to work nicely alongside webpack?

I currently have quite a few dependencies that I am currently managing via - you are going to scream... - git submodule. As you can tell, this is not very elegant! My main dependencies include Bootstrap and jQuery, but also smaller jQuery plugins. How can I add these smaller plugins, that are oftenly just a single file, to webpack? Is there a recommended way to do so? As an example for this question, consider jQuery.stickyFooter and jQuery.rangyInputs.

Am I right to assume that loaders are chained by separating them by exclamation points ("!")? I.e.: style-loader!css-loader!scss-loader

I want to build a loader for OJ. It has a runtime that needs to be included for the browser to work. This runtime currently only supports the browser and needs to run in global space. Imagine I had done the loader, how would I go about loading .oj files?

Within my app, I have a slightly changing demand for scripts. When I am at /site/main I only want jQuery, Bootstrap and some fancy stuff. But when I am within /chat, I would like to be able to load a lot more JS files. What is a good way to handle this? I know there is the async way of require-ing files. But how exactly does it work? Do I specify the path directly to the file? Say I have main.js and a subfolder called chat/ containing a few various scripts specially for the chat. How do I load them all?

Does webpack understand symlinks? I currently have the Socket.IO client library symlinked into my main folder. What is the best way to get this to the browser?

Sorry for the load of questions - but I decided that it was better to put it all here instead of spawning one issue per question - I hope you don't mind :)

Webpack looks very promising and I can't wait to use it. I am just currently considering how to. The CLI seems a bit sparse and I am unsure on how exactly I have to create my webpack.

Kind regards, Ingwie!

Issue 2:
Do you want to request a feature or report a bug?

Bug

What is the current behavior?

ProfilingPlugin crashes build when using source-map devtool

If the current behavior is a bug, please provide the steps to reproduce.

const webpack = require('webpack');

module.exports = {
devtool: 'source-maps',
plugins: [
new webpack.debug.ProfilingPlugin()
]
}

webpack --mode=production fails with the following stack trace:

Unhandled rejection TypeError: Cannot read property 'Symbol(Symbol.iterator)' of undefined
at compilation.hooks.afterOptimizeChunkAssets.tap (~/webpack-issue/node_modules/webpack/lib/SourceMapDevToolPlugin.js:108:26)
at args (~/webpack-issue/node_modules/webpack/lib/debug/ProfilingPlugin.js:383:10)
at SyncHook.eval [as call] (eval at create (~/webpack-issue/node_modules/tapable/lib/HookCodeFactory.js:17:12), <anonymous>:9:1)
at SyncHook.lazyCompileHook [as _call] (~/webpack-issue/node_modules/tapable/lib/Hook.js:35:21)
at hooks.optimizeChunkAssets.callAsync.err (~/webpack-issue/node_modules/webpack/lib/Compilation.js:947:42)
...

Removing devtool fixes the build.

What is the expected behavior?

It should work

Please mention other relevant information such as the browser version, Node.js version, webpack version, and Operating System.

webpack 4.1.1

macOS High Siera 10.13.3

node v8.4.0