Webpack: `target: node` outputs a weird module

Created on 18 Dec 2015  路  1Comment  路  Source: webpack/webpack

The resulting main.js looks like this.
module.exports is an array [1,0].
But in my code I have module.exports = function() { ... }.
Why is it an array?

``` javascript.
module.exports =
exports.ids = [1,0];
exports.modules = [
/* 0 /
/
!***********! ! ./code/page-server/webpack.js !
*
**********/
/
**/ function(module, exports, __webpack_require__) {

// use bluebird for Promises
'use strict';

__webpack_require__(/*! babel-runtime/core-js/promise */ 5)['default'] = __webpack_require__(/*! bluebird */ 18);

if ((undefined)) {
    __webpack_require__(/*! bluebird */ 18).longStackTraces();
}

console.log('$$$$$$$$$$$$', __webpack_require__(/*! ./webpage rendering */ 14));

module.exports = __webpack_require__(/*! ./webpage rendering */ 14);

/*/ },
/* 1 */
...
```

Most helpful comment

The reason was the Commons plugin.
I removed it.

>All comments

The reason was the Commons plugin.
I removed it.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

jaesung2061 picture jaesung2061  路  3Comments

zerkalica picture zerkalica  路  3Comments

yannispanousis picture yannispanousis  路  3Comments

andersekdahl picture andersekdahl  路  3Comments

karyboy picture karyboy  路  3Comments