Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Webpack deterministic module ids #388

Merged
merged 4 commits into from
May 15, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@
"vm2": "^3.6.6",
"vue": "^2.5.17",
"vue-server-renderer": "^2.5.17",
"webpack": "5.0.0-alpha.9",
"webpack": "5.0.0-alpha.12",
"when": "^3.7.8",
"yoga-layout": "^1.9.3"
}
Expand Down
6 changes: 5 additions & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,9 +91,13 @@ module.exports = (
name: `ncc_${hashOf(entry)}`,
version: nccVersion
},
amd: false,
optimization: {
nodeEnv: false,
minimize: false
minimize: false,
moduleIds: 'deterministic',
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

deterministic module and chunk ids is the default in production mode anyway.

chunkIds: 'deterministic',
mangleExports: false
},
devtool: sourceMap ? "source-map" : false,
mode: "production",
Expand Down
4 changes: 2 additions & 2 deletions test/unit/shebang/output-coverage.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ module.exports =
/******/ // the startup function
/******/ function startup() {
/******/ // Load entry module and return exports
/******/ return __webpack_require__(610);
/******/ return __webpack_require__(817);
/******/ };
/******/
/******/ // run startup
Expand All @@ -43,7 +43,7 @@ module.exports =
/************************************************************************/
/******/ ({

/***/ 610:
/***/ 817:
/***/ (function(module) {

module.exports = 'asdf';
Expand Down
4 changes: 2 additions & 2 deletions test/unit/shebang/output.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ module.exports =
/******/ // the startup function
/******/ function startup() {
/******/ // Load entry module and return exports
/******/ return __webpack_require__(72);
/******/ return __webpack_require__(408);
/******/ };
/******/
/******/ // run startup
Expand All @@ -43,7 +43,7 @@ module.exports =
/************************************************************************/
/******/ ({

/***/ 72:
/***/ 408:
/***/ (function(module) {

module.exports = 'asdf';
Expand Down
28 changes: 14 additions & 14 deletions test/unit/ts-decl/output-coverage.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ module.exports =
/******/ // the startup function
/******/ function startup() {
/******/ // Load entry module and return exports
/******/ return __webpack_require__(49);
/******/ return __webpack_require__(492);
/******/ };
/******/ // initialize runtime
/******/ runtime(__webpack_require__);
Expand All @@ -44,29 +44,29 @@ module.exports =
/************************************************************************/
/******/ ({

/***/ 49:
/***/ (function(__unusedmodule, __webpack_exports__, __webpack_require__) {
/***/ 177:
/***/ (function(__unusedmodule, exports) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _test_ts__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(400);
/* harmony import */ var _test_ts__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_test_ts__WEBPACK_IMPORTED_MODULE_0__);
/* harmony reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in _test_ts__WEBPACK_IMPORTED_MODULE_0__) if(__WEBPACK_IMPORT_KEY__ !== 'default') (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return _test_ts__WEBPACK_IMPORTED_MODULE_0__[key]; }) }(__WEBPACK_IMPORT_KEY__));

exports.__esModule = true;
function test(arg) {
return arg;
}
exports.test = test;


/***/ }),

/***/ 400:
/***/ (function(__unusedmodule, exports) {
/***/ 492:
/***/ (function(__unusedmodule, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _test_ts__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(177);
/* harmony import */ var _test_ts__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_test_ts__WEBPACK_IMPORTED_MODULE_0__);
/* harmony reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in _test_ts__WEBPACK_IMPORTED_MODULE_0__) if(__WEBPACK_IMPORT_KEY__ !== "default") __webpack_require__.d(__webpack_exports__, __WEBPACK_IMPORT_KEY__, function(key) { return _test_ts__WEBPACK_IMPORTED_MODULE_0__[key]; }.bind(0, __WEBPACK_IMPORT_KEY__));

exports.__esModule = true;
function test(arg) {
return arg;
}
exports.test = test;


/***/ })
Expand Down
28 changes: 14 additions & 14 deletions test/unit/ts-decl/output.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ module.exports =
/******/ // the startup function
/******/ function startup() {
/******/ // Load entry module and return exports
/******/ return __webpack_require__(140);
/******/ return __webpack_require__(724);
/******/ };
/******/ // initialize runtime
/******/ runtime(__webpack_require__);
Expand All @@ -44,29 +44,29 @@ module.exports =
/************************************************************************/
/******/ ({

/***/ 140:
/***/ (function(__unusedmodule, __webpack_exports__, __webpack_require__) {
/***/ 550:
/***/ (function(__unusedmodule, exports) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _test_ts__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(999);
/* harmony import */ var _test_ts__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_test_ts__WEBPACK_IMPORTED_MODULE_0__);
/* harmony reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in _test_ts__WEBPACK_IMPORTED_MODULE_0__) if(__WEBPACK_IMPORT_KEY__ !== 'default') (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return _test_ts__WEBPACK_IMPORTED_MODULE_0__[key]; }) }(__WEBPACK_IMPORT_KEY__));

exports.__esModule = true;
function test(arg) {
return arg;
}
exports.test = test;


/***/ }),

/***/ 999:
/***/ (function(__unusedmodule, exports) {
/***/ 724:
/***/ (function(__unusedmodule, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _test_ts__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(550);
/* harmony import */ var _test_ts__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_test_ts__WEBPACK_IMPORTED_MODULE_0__);
/* harmony reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in _test_ts__WEBPACK_IMPORTED_MODULE_0__) if(__WEBPACK_IMPORT_KEY__ !== "default") __webpack_require__.d(__webpack_exports__, __WEBPACK_IMPORT_KEY__, function(key) { return _test_ts__WEBPACK_IMPORTED_MODULE_0__[key]; }.bind(0, __WEBPACK_IMPORT_KEY__));

exports.__esModule = true;
function test(arg) {
return arg;
}
exports.test = test;


/***/ })
Expand Down
16 changes: 8 additions & 8 deletions test/unit/tsconfig-paths-conflicting-external/output-coverage.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ module.exports =
/******/ // the startup function
/******/ function startup() {
/******/ // Load entry module and return exports
/******/ return __webpack_require__(990);
/******/ return __webpack_require__(478);
/******/ };
/******/
/******/ // run startup
Expand All @@ -42,25 +42,25 @@ module.exports =
/************************************************************************/
/******/ ({

/***/ 43:
/***/ (function(__unusedmodule, exports) {
/***/ 478:
/***/ (function(__unusedmodule, exports, __webpack_require__) {

"use strict";

exports.__esModule = true;
exports["default"] = {};
var _module_1 = __webpack_require__(744);
console.log(_module_1["default"]);


/***/ }),

/***/ 990:
/***/ (function(__unusedmodule, exports, __webpack_require__) {
/***/ 744:
/***/ (function(__unusedmodule, exports) {

"use strict";

exports.__esModule = true;
var _module_1 = __webpack_require__(43);
console.log(_module_1["default"]);
exports["default"] = {};


/***/ })
Expand Down
20 changes: 10 additions & 10 deletions test/unit/tsconfig-paths-conflicting-external/output.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ module.exports =
/******/ // the startup function
/******/ function startup() {
/******/ // Load entry module and return exports
/******/ return __webpack_require__(519);
/******/ return __webpack_require__(266);
/******/ };
/******/
/******/ // run startup
Expand All @@ -42,23 +42,23 @@ module.exports =
/************************************************************************/
/******/ ({

/***/ 519:
/***/ 250:
/***/ (function(module) {

module.exports = require("@module");

/***/ }),

/***/ 266:
/***/ (function(__unusedmodule, exports, __webpack_require__) {

"use strict";

exports.__esModule = true;
var _module_1 = __webpack_require__(816);
var _module_1 = __webpack_require__(250);
console.log(_module_1["default"]);


/***/ }),

/***/ 816:
/***/ (function(module) {

module.exports = require("@module");

/***/ })

/******/ });
8 changes: 4 additions & 4 deletions test/unit/tsconfig-paths/output-coverage.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ module.exports =
/******/ // the startup function
/******/ function startup() {
/******/ // Load entry module and return exports
/******/ return __webpack_require__(447);
/******/ return __webpack_require__(921);
/******/ };
/******/
/******/ // run startup
Expand All @@ -42,19 +42,19 @@ module.exports =
/************************************************************************/
/******/ ({

/***/ 447:
/***/ 921:
/***/ (function(__unusedmodule, exports, __webpack_require__) {

"use strict";

exports.__esModule = true;
var _module_1 = __webpack_require__(579);
var _module_1 = __webpack_require__(923);
console.log(_module_1["default"]);


/***/ }),

/***/ 579:
/***/ 923:
/***/ (function(__unusedmodule, exports) {

"use strict";
Expand Down
8 changes: 4 additions & 4 deletions test/unit/tsconfig-paths/output.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ module.exports =
/******/ // the startup function
/******/ function startup() {
/******/ // Load entry module and return exports
/******/ return __webpack_require__(962);
/******/ return __webpack_require__(710);
/******/ };
/******/
/******/ // run startup
Expand All @@ -42,20 +42,20 @@ module.exports =
/************************************************************************/
/******/ ({

/***/ 816:
/***/ 250:
/***/ (function(module) {

module.exports = require("@module");

/***/ }),

/***/ 962:
/***/ 710:
/***/ (function(__unusedmodule, exports, __webpack_require__) {

"use strict";

exports.__esModule = true;
var _module_1 = __webpack_require__(816);
var _module_1 = __webpack_require__(250);
console.log(_module_1["default"]);


Expand Down
Loading